function f_kartuhasiltudi(nimnya, titleyy) {
var ds_jabatan_dekan = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: BASE_URL + 'data_controller/get_jabatan_dekan',
method: 'POST'
}),
autoLoad: true,
root: 'data',
fields: [
{ name: "idjabatan", mapping: "idjabatan" }
, { name: "nmjabatan", mapping: "nmjabatan" }
]
});
var titley = 'KHS (Kartu Hasil Studi)';
var NIMZ;
p = new Ext.Panel({
border: true,
frame: true,
style: 'margin-left: 70px;margin-bottom: 30px',
width: 120,
height: 135,
html: '
PHOTO
'
});
var hiddencari;
if (nimnya==''){
hiddencari = false;
}else{
hiddencari = true;
}
var tplDetail = new Ext.XTemplate( '',
'
',
'',
' |
',
'
Nim: ',
' {nim} ',
'Nama Mahasiswa: ',
' {nmmhs} ',
'Fakultas: ',
' {nmfakultas} ',
'Program Studi: ',
' {nmprodi} ',
'Tahun Masuk / Angkatan: ',
' {tahunmsk} ',
'Tahun Akademik / Semester: ',
' {kdthnakademik} ',
// 'Status Aktivitas Mahasiswa: ',
// ' {nmstaktivitasmhs} ',
' |
',
'
',
'',
'
');
//=======================================
//datax = {
// nim:'001'
// }
var p2 = new Ext.Panel({
listeners:{
afterrender:function(){
// tplDetail.overwrite(p2.body, datax);
// p2.body.highlight('#c3daf9', {block:true});
}
}
});
var mhsDispPanel = new Ext.form.FormPanel({
id: 'fp.mhsFDisp',
border: false,
bodyStyle: 'padding:5px 5px 0',
frame: true,
labelAlign: 'top',
layout: 'anchor',
forceFit:true,
items: [
{
layout: 'form',
defaultType: 'textfield',
defaults: { readOnly: true},
items: [
p
,
{
id: 'frm.nim',
fieldLabel: 'NPM',
width: 250,
height:24,
validator: function(value){
var a = value;
if (a) {
//if (grid_nya.getStore().getCount() == 0) {
var waitmsg = Ext.MessageBox.wait('Proses mendapatkan data...', 'Info');
Ext.Ajax.request({
url: BASE_URL + 'c_kartuhasilstudi/form_mhs',
method: 'POST',
params: {
userid: a
},
success: function(response) {
waitmsg.hide();
var r = Ext.decode(response.responseText);
kelengkapan(r.nim,r.kdprodi,r.idklsmhs,r.tahunmsk);
Ext.getCmp("frm.foto").setValue(r.foto);
Ext.getCmp("frm.kdfakultas").setValue(r.kdfakultas);
}
});
//}
}
}
}
,
{ id: 'frm.nama', fieldLabel: 'Nama Mahasiswa' ,width: 250, height:24}
,
{ id: 'frm.fakultas', fieldLabel: 'Fakultas' ,width: 250, height:24}
,
{ id: 'frm.prodi', fieldLabel: 'Program Studi' ,width: 250, height:24}
,
{ id: 'frm.thmasuk', fieldLabel: 'Tahun Masuk' ,width: 250, height:24}
,
{ id: 'frm.staktiv', fieldLabel: 'Status Aktivitas Mahasiswa' ,width: 250, height:24}
,
{ id: 'frm.stawal', fieldLabel: 'Status Awal Mahasiswa' ,width: 250, height:24}
,
{ id: 'frm.kdfakultas', hidden: true ,width: 250, height:24}
,
{
id: 'frm.foto',
hidden:true,
fieldLabel: '' ,
validator: function(value){
mhs_foto_ori(Ext.getCmp("frm.foto").getValue());
},width: 250, height:24
}
]
}]
});
//=======================================
var ds_ttd = new Ext.data.JsonStore({ //from database
id: 'id_ds_ttd',
proxy: new Ext.data.HttpProxy({
url: BASE_URL + 'data_controller/get_tandatangan',
method: 'POST'
}),
autoLoad: true,
root: 'data',
fields: [
{ name: "idpimpinan", mapping: "idpimpinan" }
, { name: "nmpimpinan", mapping: "nmpimpinan" }
, { name: "jabatan", mapping: "jabatan" }
]
});
var ds_nya = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: BASE_URL + 'c_kartuhasilstudi/grid',
method: 'POST'
}),
root: 'data',
totalProperty: 'results',
//autoLoad: true,
fields: [{
name: "kdmk",
mapping: "kdmk"
},
{
name: "nmmk",
mapping: "nmmk"
},
{
name: "jmlsks",
mapping: "jmlsks"
},
{
name: "nilaihuruf",
mapping: "nilaihuruf"
},
{
name: "bobotnilai",
mapping: "bobotnilai"
},
{
name: "mutu",
mapping: "mutu"
},
{
name: "sm",
mapping: "sm"
},
{
name: "dsnpengampu",
mapping: "dsnpengampu"
}],
listeners: {
load: function(store, records, options) {
// Ext.getCmp('jmlsks2').setValue(store.getAt(0));
// alert(store.getAt(0).data['kdmk']);
}
}
});
var sm_nya = new Ext.grid.CheckboxSelectionModel({
listeners: {
selectionchange: function(sm) {
}
}
});
var vw = new Ext.grid.GridView({
emptyText: '< No Data To Display >'
});
var cm = new Ext.grid.ColumnModel({
// specify any defaults for each column
defaults: {
sortable: true // columns are not sortable by default
},
columns: [//sm_nya,
new Ext.grid.RowNumberer(),
{
header: 'Kode Mata Kuliah ',
width: 120,
dataIndex: 'kdmk',
sortable: true
},
{
header: 'Nama Mata Kuliah (Bahasa Indonesia)',
width: 360,
dataIndex: 'nmmk',
sortable: true
},
{
header: 'HM',
width: 40,
dataIndex: 'nilaihuruf',
sortable: true
},
{
header: 'AM',
width: 50,
dataIndex: 'bobotnilai',
sortable: true
},
{
header: 'Sks',
width: 50,
dataIndex: 'jmlsks',
sortable: true
},
{
header: 'M',
width: 100,
dataIndex: 'mutu',
sortable: true
}]
});
var grid_nya = new Ext.grid.EditorGridPanel({
store: ds_nya,
vw: vw,
sm: sm_nya,
cm: cm,
autoScroll: true,
columnLines: true,
clicksToEdit: 1,
loadMask: true,
frame: true,
height: 310,
id: 'grid_det_nya',
tbar: [
{
text: "Tahun Akademik - Semester"
},
{
xtype: 'combo',
id: 'thnakademik',
name: 'thnakademik',
width:150,
store: ds_thnakademik2,
triggerAction: 'all',
editable: false,
valueField: 'kdstsemester',
displayField: 'nmthnakademik',
forceSelection: true,
submitValue: true,
emptyText: 'Pilih...',
hiddenName: 'h_thakademik',
listeners: {
select: function(c, r, i) {
if (Ext.getCmp("frm.nim").getValue()) {
search_grid();
}
}
},
typeAhead: true,
mode: 'local',
emptyText: 'Belum Dipilih...',
selectOnFocus: true
},{
text: "Dosen Wali"
},
{
xtype: 'textfield',
id:'dosenwali',
name:'dosenwali',
readOnly:true
}],
listeners: {
rowclick: function rowClick(grid, rowIdx) {
// var rec = ds_nya.getAt(rowIdx);
// KDMK= rec.data['kdmk'];
// NIDU= rec.data['nidu'];
}
}
});
var form_bp_general = new Ext.form.FormPanel({
id: 'form_bp_general',
forceFit: true,
//title: titley,
autoScroll: true,
tbar: [{
text: 'Cari',
id: 'tb.find-mhs',
iconCls: 'silk-find',
hidden:hiddencari,
handler: function() {
wGridMhs('KHS');
}
},
{
text: 'Cetak',
iconCls: 'silk-printer',
handler: function() {
if (grid_nya.getStore().getCount() == 0) {
Ext.MessageBox.alert("Informasi", "Data Kosong");
} else {
if (Ext.getCmp('cb.ttd').getValue()) {
var parsing = '';
parsing = parsing + Ext.getCmp('frm.nim').getValue() + '/' ;
parsing = parsing + Ext.getCmp('ipkup').getValue() + '/' ;
parsing = parsing + Ext.getCmp('cb.jabatan').getValue() + '/' ;
parsing = parsing + Ext.getCmp('cb.ttd').getValue() + '/' ;
parsing = parsing + Ext.getCmp('thnakademik').getValue() + '/' ;
parsing = parsing + Ext.getCmp('nidu').getValue() + '/' ;
parsing = parsing + Ext.getCmp('tglkhs').getValue().format('Y-m-d');
var win = window.open();
win.location.reload();
win.location = BASE_URL + 'rpt/rpt_khs_transkrip/pkartuhasilstudi/'+parsing;
} else {
Ext.MessageBox.alert("Informasi", "Silahkan Tentukan Penandatangan");
}
}
}
},'->',
{
text: 'Tanggal Cetak'
},
{
xtype: 'datefield', id: 'tglkhs',
value: new Date(), width: 100
}],
layout: 'column',
reader: new Ext.data.JsonReader({
root: 'data',
totalProperty: 'results',
id: 'id',
fields: [{
name: "nim",
mapping: "nim"
},
{
name: "nmmhs",
mapping: "nmmhs"
},
{
name: "nmfakultas",
mapping: "nmfakultas"
},
{
name: "kdprodi",
mapping: "kdprodi"
},
{
name: "nmprodi",
mapping: "nmprodi"
},
{
name: "idklsmhs",
mapping: "idklsmhs"
},
{
name: "tahunmsk",
mapping: "tahunmsk"
}, //1
{
name: "persen",
mapping: "persen"
},
{
name: "stbayar",
mapping: "stbayar"
},
{
name: "foto",
mapping: "foto"
},
{
name: "idjnssemester",
mapping: "idjnssemester"//kdstsemester
},
{
name: "kdstsemester",
mapping: "kdstsemester"
},
{
name: "kdthnakademik",
mapping: "kdthnakademik"
},
{
name: "nmstaktivitasmhs",
mapping: "nmstaktivitasmhs"
}]
}),//
items: [{
columnWidth: 1,
xtype: 'panel',
border: false,
bodyStyle: 'padding:0px 0px 0px 3px',
items: [{
layout: 'form',
// bodyStyle: 'padding:10px 3px 3px 5px',
border: false,
items: [{
xtype: 'fieldset',
title: 'Daftar Mata Kuliah',
//height: 530,
// labelAlign: 'top',
items: [grid_nya]
},
{
xtype: 'fieldset',
items: [{
layout: 'column',
border: false,
items: [{
columnWidth: .65,
layout: 'form',
border: false,
items: [{
xtype: 'textfield',
// fieldLabel: 'First Name',
hidden: true,
name: 'first',
anchor: '95%'
},
{
xtype: 'textfield',
// fieldLabel: 'Company',
hidden: true,
name: 'company',
anchor: '95%'
},
{
xtype: 'textfield',
// fieldLabel: 'Company',
hidden: true,
name: 'company',
anchor: '95%'
}]
},
{
columnWidth: .50,
layout: 'form',
border: false,
items: [{
xtype: 'textfield',
style: 'text-align: right;',
labelStyle: 'width:200px;',
fieldLabel: 'Jumlah Angka Mutu x SKS',
id: 'jmlskskalimutu',
name: 'jmlskskalimutu',
width: 50,
readOnly: true,
listeners: {}
},
{
xtype: 'textfield',
style: 'text-align: right;',
labelStyle: 'width:200px;',
fieldLabel: 'Jumlah SKS',
id: 'jmlsksall',
width: 50,
readOnly: true,
listeners: {}
},
{
xtype: 'textfield',
style: 'text-align: right;',
labelStyle: 'width:200px;',
fieldLabel: 'Indeks Prestasi',
id: 'ipeka',
width: 50,
readOnly: true,
listeners: {}
},
{
xtype: 'textfield',
style: 'text-align: right;',
labelStyle: 'width:200px;',
fieldLabel: 'Indeks Prestasi Akumulasi',
id: 'ipkup',
width: 50,
readOnly: true,
listeners: {}
}]
},
{
columnWidth: .50,
layout: 'form',
border: false,
items: [{
store: ds_jabatan_dekan,
xtype: 'combo', id: 'cb.jabatan',
fieldLabel: 'Jabatan',
triggerAction: 'all',
valueField: 'idjabatan', displayField: 'nmjabatan',
forceSelection: true, submitValue: true,
mode: 'local', emptyText:'Pilih...', width: 150,
editable: false, allowBlank: true,
listeners:{
select: function(combo, record) {
var kdfakultas = Ext.getCmp("frm.kdfakultas").getValue();
ds_ttd.setBaseParam('kdfakultas', kdfakultas);
ds_ttd.setBaseParam('jabatan', record.data.idjabatan);
Ext.getCmp("cb.ttd").disable();
Ext.getCmp("cb.ttd").setValue(null);
ds_ttd.load({
scope : this,
callback: function(records, operation, success) {
Ext.getCmp("cb.ttd").enable();
}
});
}
}
},
{
xtype: 'combo', id: 'cb.ttd',
fieldLabel: 'Penandatangan',
store: ds_ttd,
triggerAction: 'all',
valueField: 'idpimpinan', displayField: 'nmpimpinan',
forceSelection: true, submitValue: true,
mode: 'local', emptyText:'Pilih...', width: 250,
allowBlank: true
}]
}]
}]
},
{
xtype: 'fieldset',
hidden:true,
title: 'Perwalian Online',
height:100,
items: [
{
xtype: 'compositefield',
//fieldLabel: 'Dosen Wali',
//labelStyle: 'width:160px',
items: [{
xtype: 'textfield',
id: 'nidu',
anchor: '100%',
readOnly: true//,
//allowBlank: false
},{
xtype: 'textfield',
id: 'dosenwalicc',
anchor: '100%',
readOnly: true//,
//allowBlank: false
},{
xtype: 'button',
text: 'Pesan',
//hidden:true,
// iconCls: 'silk-find',
id: 'btn_data_submenu',
width: 3,
handler: function() {
f_pesan(NIDUZ,Ext.getCmp('nim').getValue());
}
}]
}
]
}]
}]
}],
listeners: {
}
});
var akhir = new Ext.Panel({
layout: 'border',
// autoLoad :true,
defaults: {
collapsible: true,
split: true,
bodyStyle: 'padding:15px'
},
items: [{
collapsible: false,
bodyStyle: 'padding:0px',
region: 'center',
id: 'images-view',
frame: true,
title: titley,
items: [form_bp_general]
},
{
bodyStyle: 'padding:0px',
collapsible: true,
autoScroll: true,
region: 'east',
minSize: 75,
title: 'Informasi Mahasiswa',
frame: true,
width: 300,
height:495,
//autoHeight: true,
id: 'images-view2',
items: [mhsDispPanel]
}]
});
SET_PAGE_CONTENT(akhir);
function kelengkapan(nimc, kdprodic,idklsmhsc,tahunmskc) {
var kdstsemesternya = (Ext.getCmp("thnakademik").getValue()) ? Ext.getCmp("thnakademik").getValue():KDSTSEMESTER;
var waitmsg = Ext.MessageBox.wait('Proses mendapatkan data...', 'Info');
Ext.Ajax.request({
url: BASE_URL + 'c_kartuhasilstudi/kelengkapan',
method: 'POST',
params: {
nim:nimc,
kdprodi: kdprodic,
idklsmhs: idklsmhsc,
tahunmsk: tahunmskc,
kdstsemester:kdstsemesternya
},
success: function(response) {
waitmsg.hide();
var r = Ext.decode(response.responseText);
Ext.getCmp("nidu").setValue(r.nidu);
Ext.getCmp("dosenwali").setValue(r.dosenwali);
Ext.getCmp("thnakademik").setValue(kdstsemesternya);
ds_nya.setBaseParam('kdstsemester', kdstsemesternya);
ds_nya.setBaseParam('nim', nimc);
ds_nya.load({
scope : this,
callback: function(records, operation, success) {
var jumlahsksmutu = 0;
var jumlahmutu=0;
var jumlahsks=0;
var jumlahsksall=0;
var nh = ["A", "B", "C", "D", "E"];
ds_nya.each(function (rec) {
if (nh.indexOf(rec.get('nilaihuruf').substr(0,1)) != -1) {
jumlahsksmutu += parseFloat(rec.get('sm'));
jumlahmutu += parseFloat(rec.get('mutu'));
jumlahsks += parseFloat(rec.get('jmlsks'));
}
jumlahsksall += parseFloat(rec.get('jmlsks'));
});
Ext.getCmp('jmlskskalimutu').setValue(jumlahmutu);
Ext.getCmp('jmlsksall').setValue(jumlahsksall);
var ipeka=0;
ipeka = jumlahmutu/jumlahsks;
if (jumlahmutu == 0 || jumlahsks == 0) {
Ext.getCmp('ipeka').setValue(0);
} else {
Ext.getCmp('ipeka').setValue(ipeka.toFixed(2));
}
}
});
Ext.getCmp("ipkup").setValue(r.ipkakumulatif);
}
});
}
function search_grid(){
var waitmsg = Ext.MessageBox.wait('Proses mendapatkan data...', 'Info');
Ext.Ajax.request({
url: BASE_URL + 'c_kartuhasilstudi/form_mhs',
method: 'POST',
params: {
userid: Ext.getCmp("frm.nim").getValue()
},
success: function(response) {
waitmsg.hide();
var r = Ext.decode(response.responseText);
kelengkapan(r.nim,r.kdprodi,r.idklsmhs,r.tahunmsk);
Ext.getCmp("frm.foto").setValue(r.foto);
Ext.getCmp("frm.kdfakultas").setValue(r.kdfakultas);
}
});
}
}