function peserta_sidang(L_MEMBER,NM_KLP){
/** COMMON STORES */
var ds_prodireg = store_prodireg();
var ds_stsmt = store_stsmt();
var ds_staktiv = store_staktiv();
var ds_cutidet = store_cutidet();
var ds_tskripsi = store_tskripsi();
var ds_jskripsi = store_jskripsi();
var ds_dosen1 = store_nmdosen();
var ds_dosen2 = store_nmdosen();
var ds_dosen3 = store_nmdosen();
var ds_dosen4 = store_nmdosen();
var ds_dosen5 = store_nmdosen();
var nimx;
/** STORE for GRID COLUMN EDITOR type COMBO */
var dcUrl = BASE_URL + 'data_controller/';
var obj2Fields = new Object([
{ name: 'kode' }, { name: 'nama' }
]);
var obj4Fields = new Object([
{ name: 'id' }, { name: 'kode' }, { name: 'nama' }, { name: 'deskripsi' }
]);
var ds_semester = RH.getCommonJsonStore(obj4Fields, dcUrl + 'get_semester');
/** GRID STORE: ds_peserta_sidang */
var fields_psidang = RH.storeFields('idstmhssemester','total_syaratsidang','nmstaktivitasmhs','nmmhs','kdjnskelamin','nim', 'thnmasuk', 'nmkodtbkod',
'kdprodi', 'kdstsemester', 'kdstaktivitasmhs', 'catnonaktif', 'tgllulus', 'skslulus', 'ipk',
'nosk', 'tglsk', 'noijazah', 'kdjskripsi', 'kdtskripsi', 'awalbimbingan',
'idklppengguna', 'nidu1', 'nidu2', 'nidu2', 'nidu3', 'nidu4', 'nidu5','idsemester',
'idkelas', 'nmkelas', 'tingkat', 'tingsem','tot_statusdet','nmcutidet','persendpp','stkrs');
var pageSize = 20;
var ds_peserta_sidang = RH.JsonStore({
url : BASE_URL + 'psidang_controller/get_psidang',
fields : fields_psidang,
//limit : pageSize,
params: [
{key:'kdprodi', id: 'cb.prodi-psidang'}
,{key:'kdstsemester', id: 'cb.smt-psidang'}
,{key:'idklppengguna', id: L_MEMBER}
],
enableSearch: true,
});
var ds_search = new Ext.data.JsonStore({ //static data
autoDestroy: true,
fields: [ 'field', 'value' ],
/* data: [
{ "field":"-","value":"Pilih..."}
],
listeners : {
load : function() {
}
} */
});
var ds_idsemester = new Ext.data.JsonStore({ //from database
proxy: new Ext.data.HttpProxy({
url: BASE_URL + 'data_controller/get_semester',
method: 'POST'
}),
autoLoad: true,
root: 'data',
fields: [
{ name: "kode", mapping: "kode" }
, { name: "tingsem", mapping: "tingsem" }
]
});
var ds_idkelas = new Ext.data.JsonStore({ //from database
proxy: new Ext.data.HttpProxy({
url: BASE_URL + 'data_controller/get_kelas_combo',
method: 'POST'
}),
autoLoad: true,
root: 'data',
fields: [
{ name: "idkelas", mapping: "idkelas" }
, { name: "nmkelas", mapping: "nmkelas" }
]
});
ds_peserta_sidang.on('beforeload', function(){ RH.removeDetail('fp.detil') });
ds_peserta_sidang.on('load', function(store, recs, opt){
var count1 = 0;
var count2 = 0;
var count3 = 0;
var count4 = 0;
var count5 = 0;
var count6 = 0;
var count7 = 0;
ds_peserta_sidang.each(function (rec) {
if (rec.data['kdstaktivitasmhs'] == 'A') {
count1 = count1 + 1;
}
if (rec.data['kdstaktivitasmhs'] == 'C') {
count2 = count2 + 1;
}
if (rec.data['kdstaktivitasmhs'] == 'D') {
count3 = count3 + 1;
}
if (rec.data['kdstaktivitasmhs'] == 'G') {
count4 = count4 + 1;
}
if (rec.data['kdstaktivitasmhs'] == 'K') {
count5 = count5 + 1;
}
if (rec.data['kdstaktivitasmhs'] == 'L') {
count6 = count6 + 1;
}
if (rec.data['kdstaktivitasmhs'] == 'N') {
count7 = count7 + 1;
}
});
/* RH.setCompValue('tf.to-aktif', count1);
RH.setCompValue('tf.to-cuti', count2);
RH.setCompValue('tf.to-dropout', count3);
RH.setCompValue('tf.to-double', count4);
RH.setCompValue('tf.to-keluar', count5);
RH.setCompValue('tf.to-lulus', count6);
RH.setCompValue('tf.to-nonaktif', count7); */
}, this);
//SEARCH COMPONENT
var sb_peserta_sidang = RH.searchComp({
id : 'sb_peserta_sidang',
fields : ['nim:NPM','nmmhs:Nama Mahasiswa', 'nmstaktivitasmhs:St.Mahasiswa', 'nmkodtbkod:St.Masuk','thnmasuk:Thn.Msk/Angkatan'],
selected : 'idstmhssemester',
store : ds_peserta_sidang,
textWidth : 250,
});
//LISTENER KELAS
var fnSelectKelas = function(combo, record){
var idkelas = record.data['idkelas'];
//Update kelas
updateKelas(idkelas);
};
//LISTENER TINGKAT/SEMESTER
var fnSelectTingsem = function(combo, record){
var idsemester = record.data['kode'];
//Update tingkat/semester
updateTingsem(idsemester);
};
/** GRID COLUMN MODEL */
var cm_peserta_sidang = new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer({width: 40}), //for rows numbering
{
header: RH.h3('NPM'), width:100,
dataIndex: 'nim',
sortable: true,
}, {
header: RH.h3('Nama Mahasiswa'), width: 250,
dataIndex: 'nmmhs',
sortable: true,
}, {
header: RH.h3('(L/P)'), width: 50,
dataIndex: 'kdjnskelamin',
align:'center', sortable: true,
}, {
header: RH.h3('Thn.Masuk/ Angkatan'), width: 130,
dataIndex: 'thnmasuk',
align:'center',sortable: true,
},{
header: RH.h3('St.Masuk'), width: 100,
dataIndex: 'nmkodtbkod', hidden:true,
align:'left', sortable: true,
},{
header: RH.h3('Kelas'), width: 100,
dataIndex: 'nmkelas', sortable: true, hidden:true,
renderer: function(value) {
if (value) {
return RH.qtipEdit(value,'12px');
}
},
editor: RH.getComboEditor('idkelas', false, ds_idkelas, 'nmkelas', 'nmkelas', fnSelectKelas),
}, {
header: RH.h3('Tingkat/ Semester'), width: 130,
dataIndex: 'tingsem', hidden: true,
renderer: function(value) {
if (value) {
return RH.qtipEdit(value,'12px');
}
},
align:'center', sortable: true,
editor: RH.getComboEditor('idsemester', false, ds_idsemester, 'tingsem', 'tingsem', fnSelectTingsem),
}, {
header: RH.h3('St.Mahasiswa'), width: 130,hidden:true,
dataIndex: 'nmstaktivitasmhs', sortable: true,
}, {
header: RH.h3('Ctt.St.Mahasiswa'), width: 130,hidden:true,
dataIndex: 'nmcutidet', sortable: true,
}, {
header: RH.h3('Status KRS'), width: 130,hidden:true,
dataIndex: 'stkrs', sortable: true,
}, {
header: RH.h3('Persen Bayar DPP'), width: 130,
dataIndex: 'persendpp', sortable: true, align:'center', hidden:true,
},{
xtype: 'actioncolumn',
width: 100,
header: RH.h3('Syarat Wisuda'),
hidden: true,
align:'center',
items: [{
getClass: function(v, meta, record) {
meta.attr = "style='cursor:pointer;'";
},
icon : 'resources/img/icons/fam/add.gif',
tooltip: 'Tambah',
handler: function(grid, rowIndex) {
var rec = grid.store.getAt(rowIndex);
kelengkapanWisuda(rec.data['nim'], rec.data['nmmhs'], rec.data['kdstsemester'])
}
}]
},{
xtype: 'actioncolumn',
header: RH.h3('Status (Umum)'),
width: 160,
dataIndex: 'total_syaratsidang',
align:'left',
renderer: function(value) {
Ext.QuickTips.init();
if (value > 0)
return '
Belum / Sedang Di Periksa
';
if (value == 0)
return 'Sudah Di Periksa
';
//else
//return '';
//return 'Lihat Detail
';
},
/* getClass: function(v, meta, record) {
var get_idujikesehatan = record.get('idujikesehatan');
if(get_idujikesehatan != null) meta.attr = "style='cursor:pointer;'";
}, */
},{
xtype: 'actioncolumn',
header: RH.h3('Status (Per Klp Pengguna)'),
width: 160,
dataIndex: 'tot_statusdet',
align:'left',
renderer: function(value) {
Ext.QuickTips.init();
if (value > 0)
return 'Belum / Sedang Di Periksa
';
if (value == 0)
return 'Sudah Di Periksa
';
//else
//return '';
//return 'Lihat Detail
';
},
/* getClass: function(v, meta, record) {
var get_idujikesehatan = record.get('idujikesehatan');
if(get_idujikesehatan != null) meta.attr = "style='cursor:pointer;'";
}, */
},{
xtype: 'actioncolumn',
width: 100,
header: RH.h3('Syarat Sidang'),
align:'center',
items: [{
getClass: function(v, meta, record) {
meta.attr = "style='cursor:pointer;'";
},
icon : 'resources/img/icons/fam/add.gif',
tooltip: 'Tambah',
handler: function(grid, rowIndex) {
var rec = grid.store.getAt(rowIndex);
kelengkapanSidang(L_MEMBER,NM_KLP,rec.data['nim'], rec.data['nmmhs'], rec.data['kdstsemester'], rec.data['kdprodi'])
}
}]
},
RH.DeleteColumn()
]
);
// Selection Model
var sm_peserta_sidang = new Ext.grid.RowSelectionModel({ singleSelect: true });
// Grid View
var gv_peserta_sidang = new Ext.grid.GridView({emptyText: '< Belum ada Data >'});
/** GRID PANEL */
var gp_peserta_sidang = new Ext.grid.EditorGridPanel({ //PAKE EditorGridPanel
ds: ds_peserta_sidang,
cm: cm_peserta_sidang,
sm: sm_peserta_sidang,
view: gv_peserta_sidang,
clicksToEdit: 1, //for cell editing (single click =1, dblclick=2)
forceFit: true, //autoHeight: true,
layout:'anchor', //autoSizeColumns: true,
//autoExpandColumn: 'nmmkind',
autoScroll:true, //enableColumnResize: true,
columnLines: true,
loadMask: true,
tbar:[{
xtype: 'combo', fieldLabel: '', width:150,
id:'cb.search', autoWidth: true, store: ds_search,
valueField: 'value', displayField: 'field', editable: false, allowBlank: true,
triggerAction: 'all',forceSelection: true, submitValue: true, mode: 'local',
emptyText:'Cari berdasarkan ...',
listeners: {
afterrender: function () {
var a, rec, header, index;
for (a=1;a<=11;a++) {
header = gp_peserta_sidang.getColumnModel().getColumnHeader(a).replace("","").replace("
","");
index = gp_peserta_sidang.getColumnModel().getDataIndex(a);
rec = new ds_search.recordType({field:header, value:index});
rec.commit();
ds_search.add(rec);
//if (a==1) { Ext.getCmp('cb.search').setValue(index) }
}
}
}
},{
xtype: 'textfield',
id: 'tf.search',
margins:'0 0 0 5',
width:150,
},{
xtype: 'button',
id: 'bsearch',
margins:'0 0 0 5',
iconCls: 'silk-zoom',
handler: function() {
if(RH.isEmpty('cb.prodi-psidang')) return;
if(RH.isEmpty('cb.smt-psidang')) return;
if(RH.isEmpty('cb.search')) return;
ds_peserta_sidang.reload({
params: {
key: RH.getCompValue('cb.search'),
value: RH.getCompValue('tf.search'),
},
});
}
}],
/* bbar:
new Ext.PagingToolbar({
store: ds_peserta_sidang,
displayInfo: true,
pageSize: pageSize,
mode: 'local',
displayMsg: 'Data {0} - {1} dari {2}',
emptyMsg: "Belum ada data"
}), */
listeners: {
cellclick: onCellStsmtmhsClick
}
});
/* gp_peserta_sidang.store.on( 'load', function( store, records, options ) {
reloadGridStmhssmt();
} ); */
var fp_peserta_sidang = new Ext.Panel({
xtype: 'panel',
title: 'Calon Peserta Sidang', iconCls:'silk-user',
buttonAlign: 'left',
bodyStyle: 'padding: 5px',
defaults: { labelWidth: 150, labelAlign: 'right'},
border: false,
layout: 'border',
waitMsg: 'Waiting...',
maskDisabled: false,
monitorValid: true,
autoScroll:true,
frame: true,
items: [{
xtype: 'fieldset', flex: 1, region:'north', layout:'form', autoHeight:true,
items: [{
xtype: 'container', layout: 'hbox',
items:[{
layout:'form', labelWidth:90, labelAlign:'right',
items: [
RH.ActionCombo({
id: 'cb.prodi-psidang', label: 'Program Studi', width: 300,
data: ds_prodireg, key: 'kdprodi', display: 'lnmprodi',
fnSelect: function(){ reloadGridStmhssmt(); }
})
]
},{
layout:'form', labelWidth:200, labelAlign:'right',
items: [
RH.ActionCombo({
id: 'cb.smt-psidang', label: 'Tahun Akademik-Semester', width: 160,
data: ds_stsmt, key: 'kdstsemester', display: 'nmsmt',
fnSelect: function(){ reloadGridStmhssmt(); },
})
]
},{
xtype: 'textfield', id: 'hidden.idstmhssemester', hidden:true,
}]
}]
},{
region: 'center', layout:'form', autoScroll:true,
items:[{
xtype: 'panel', layout:'fit', height:475,
/* title:'Data Status Mahasiswa', */ id:'fp.master', frame:true,
items: [gp_peserta_sidang],
tbar: [{
text: 'Tambah', id: 'idadd-peserta_sidang', iconCls: 'silk-add',
handler: function(){
var prodi = Ext.getCmp('cb.prodi-psidang').getRawValue();
var tahun = Ext.getCmp('cb.smt-psidang').getRawValue();
if(prodi == '') {
Ext.Msg.alert("Info", "Program Studi Harus Diisi");
} else if(tahun == '') {
Ext.Msg.alert("Info", "Tahun Akademik Harus Diisi");
} else if(prodi != '' && tahun != '') {
fnAddpeserta_sidang();
}
}
},
{
xtype: 'button',
id: 'btn_excel_psidang',
iconCls: 'silk-save',
text: ' Export To Excel',
handler: function() {
export_excel_psidang();
}
},
{
text: 'Salin Calon Peserta Sidang dari Tahun Akademik - Semester Sebelumnya',
id: 'tb.copy-stmhs', iconCls: 'silk-page-copy', hidden:true,
handler: function() { fnCopyStmhs(); }
}],
/* bbar:[{
xtype:'form', border: false,
items:[{
xtype: 'textfield', fieldLabel: 'Mhs.Aktif',
id:'tf.to-aktif', readOnly: true, disabled: false, width:50
}]
}, {
xtype: 'form', border: false,
items:[{
xtype: 'textfield', fieldLabel: 'Mhs.Non Aktif',
id:'tf.to-nonaktif', readOnly: true, disabled: false, width:50
}]
}, {
xtype: 'form', border: false,
items:[{
xtype: 'textfield', fieldLabel: 'Mhs.Cuti',
id:'tf.to-cuti', readOnly: true, disabled: false, width:50
}]
}, {
xtype: 'form', border: false,
items:[{
xtype: 'textfield', fieldLabel: 'Mhs.Keluar',
id:'tf.to-keluar', readOnly: true, disabled: false, width:50
}]
},{
xtype: 'form', border: false,
items:[{
xtype: 'textfield', fieldLabel: 'Mhs.Drop Out',
id:'tf.to-dropout', readOnly: true, disabled: false, width:50
}]
},{
xtype: 'form', border: false,
items:[{
xtype: 'textfield', fieldLabel: 'Mhs.Double Degree',
id:'tf.to-double', readOnly: true, disabled: false, width:50
}]
},{
xtype: 'form', border: false,
items:[{
xtype: 'textfield', fieldLabel: 'Mhs.Lulus',
id:'tf.to-lulus', readOnly: true, disabled: false, width:50
}]
}], */
}],
}]
});
SET_PAGE_CONTENT(fp_peserta_sidang);
/**AKSI ONCELL**/
function onCellStsmtmhsClick(grid, rowIndex, columnIndex, e) {
var t = e.getTarget();
var record = grid.getStore().getAt(rowIndex); // Get the Record
var kdprodi = record.data['kdprodi'];
var kdstsemester = record.data['kdstsemester'];
var idstmhssemester = record.data['idstmhssemester'];
nimx = record.data['nim'];
RH.removeDetail('fp.detil');
RH.setCompValue('hidden.idstmhssemester', idstmhssemester);
RH.EditClick(e, function(){fnEditpeserta_sidang(grid, record)});
/* var rec = ds_peserta_sidang.getAt(rowIndex);
var columnName = gp_peserta_sidang.getColumnModel().getDataIndex(columnIndex);
var st = rec.data['nmstaktivitasmhs'];
if (columnName == 'tingsem') {
if (st == 'NON-AKTIF' ) {
Ext.MessageBox.alert("Informasi", "Nilai Sudah Diatas Minimal");
Ext.getCmp('tingsem').disable();
return;
}else{
Ext.getCmp('tingsem').enable();
}
} */
RH.DeleteClick(e, function(){fnDeletepeserta_sidang(grid, record)});
return true; //back to ClickToEdit=1
}
//input//
function fnAddpeserta_sidang(){
var grid = gp_peserta_sidang;
var combo_stsmt = Ext.getCmp('cb.smt-psidang');
var combo_prodi = Ext.getCmp('cb.prodi-psidang');
wform_peserta_sidang(false, grid, combo_prodi, combo_stsmt, null);
}
//edit//
function fnEditpeserta_sidang(grid, record){
var combo_stsmt = Ext.getCmp('cb.smt-psidang');
var combo_prodi = Ext.getCmp('cb.prodi-psidang');
wform_peserta_sidang(true, grid, combo_prodi, combo_stsmt, record);
}
//delete//
function fnDeletepeserta_sidang(grid, record){
var st = record.data['nmstaktivitasmhs'];
var url = BASE_URL + 'psidang_controller/delete_psidang';
var params = new Object({
nim : record.data['nim']
});
RH.deleteGridRecord(url, params, grid );
}
//print//
function fnPrintStmhssmt(){
var kdprodi = RH.getCompValue('cb.prodi-psidang');
var kdstsemester = RH.getCompValue('cb.smt-psidang');
var key = (RH.getCompValue('cb.search')) ? RH.getCompValue('cb.search'):'null';
var value = (RH.getCompValue('tf.search')) ? RH.getCompValue('tf.search'):'null';
if(kdprodi && kdstsemester){
RH.ShowReport(BASE_URL + 'rpt/rpt_peserta_sidang/get_st_mhs_smt/'+kdprodi+'/'+kdstsemester+'/'+key+'/'+value);
} else
{}
}
function export_excel_psidang(){
//var tablename = 'excel_daftar_ijazah';
var waitmsgexport = Ext.MessageBox.wait('Exporting Data...', 'Info');
var kdprodi = RH.getCompValue('cb.prodi-psidang');
var kdstsemester = RH.getCompValue('cb.smt-psidang');
if(kdprodi && kdstsemester){
Ext.Ajax.request({
url : BASE_URL + 'psidang_controller/get_psidang',
params: {
kdprodi: kdprodi,
kdstsemester: kdstsemester
},
success: function() {
waitmsgexport.hide();
window.location = BASE_URL + 'psidang_controller/export_excel/'+kdprodi+'/'+kdstsemester;
},
failure: function() {
waitmsgexport.hide();
Ext.MessageBox.alert("Info", "Export Data Gagal");
}
});
}else{
Ext.MessageBox.alert("Info", "Data Kosong");
}
}
function reloadGridStmhssmt(){
if(RH.isEmpty('cb.prodi-psidang')) return;
if(RH.isEmpty('cb.smt-psidang')) return;
RH.setCompValue('cb.search', null);
RH.setCompValue('tf.search', null);
//RH.setCompValue('tf.to-aktif', 0);
//remove detail
RH.removeDetail('fp.detil');
//reload master-grid
ds_peserta_sidang.reload({
params: {
kdprodi: RH.getCompValue('cb.prodi-psidang', true),
kdstsemester: RH.getCompValue('cb.smt-psidang', true),
idklppengguna: L_MEMBER
},
/* RH.setCompValue('tf.to-aktif', count1);
RH.setCompValue('tf.to-cuti', count2);
RH.setCompValue('tf.to-dropout', count3);
RH.setCompValue('tf.to-double', count4);
RH.setCompValue('tf.to-keluar', count5);
RH.setCompValue('tf.to-lulus', count6);
RH.setCompValue('tf.to-nonaktif', count7); */
/* Ext.Ajax.request({
url:BASE_URL + 'psidang_controller/get_jmlstmhssemester',
method:'POST',
params: {
kdprodi: RH.getCompValue('cb.prodi-psidang', true),
kdstsemester: RH.getCompValue('cb.smt-psidang', true)
},
success: function(response){
var r = Ext.decode(response.responseText);
var aktif = r.aktif;
var cuti = r.cuti;
var dropout = r.dropout;
var doubledegree = r.doubledegree;
var keluar = r.keluar;
var lulus = r.lulus;
var nonaktif = r.nonaktif;
RH.setCompValue('tf.to-aktif', aktif);
RH.setCompValue('tf.to-nonaktif', nonaktif);
RH.setCompValue('tf.to-cuti', cuti);
RH.setCompValue('tf.to-keluar', keluar);
RH.setCompValue('tf.to-dropout', dropout);
RH.setCompValue('tf.to-double', doubledegree);
RH.setCompValue('tf.to-lulus', lulus);
}
}); */
});
ds_idkelas.reload({
params: {
kdprodi: RH.getCompValue('cb.prodi-psidang', true)
}
});
}
/**FUNCTIONS UPDATE GRID KELAS*/
function updateKelas(idkelas){
Ext.Ajax.request({
url: BASE_URL + 'psidang_controller/update_kelas',
params: {
idstmhssemester : RH.getCompValue('hidden.idstmhssemester'),
nim : nimx,
kdprodi : RH.getCompValue('cb.prodi-psidang'),
kdstsemester : RH.getCompValue('cb.smt-psidang'),
idkelas : idkelas,
},
success: function() {
Ext.Msg.alert("Info", "Ubah Berhasil");
//ds_peserta_sidang.reload();
},
failure: function() {
Ext.Msg.alert("Info", "Ubah Data Gagal");
}
});
}
/**FUNCTIONS UPDATE GRID TINGKAT/SEMESTER*/
function updateTingsem(idsemester){
Ext.Ajax.request({
url: BASE_URL + 'psidang_controller/update_tingsem',
params: {
idstmhssemester : RH.getCompValue('hidden.idstmhssemester'),
idsemester : idsemester,
},
success: function() {
Ext.Msg.alert("Info", "Ubah Berhasil");
//ds_peserta_sidang.reload();
},
failure: function() {
Ext.Msg.alert("Info", "Ubah Data Gagal");
}
});
}
/**FUNCTIONS COPY STMHSSEMESTER*/
function fnCopyStmhs(){
var grid = gp_peserta_sidang;
var kdprodi = RH.getCompValue('cb.prodi-psidang', true);
var kdstsemester = RH.getCompValue('cb.smt-psidang', true);
if(kdprodi == '') { RH.warning('Program Studi harus diisi'); return; };
if(kdstsemester == '') { RH.warning('Tahun Akademik - Semester harus diisi'); return; };
if(ds_peserta_sidang.getCount() > 0){
RH.warning('Data sudah ada. Hapus terlebih dahulu');
return;
}
var combo_prodi = Ext.getCmp('cb.prodi-psidang');
var combo_stsmt = Ext.getCmp('cb.smt-psidang');
wFormCopyStmhsSemester(combo_prodi, combo_stsmt, grid);
}
/**
FORM COPY STMHSSEMESTER
*/
function wFormCopyStmhsSemester(combo_prodi, combo_stsmt, masterGrid){
//the store must same (shared store)
var ds_prodireg = combo_prodi.getStore();
var ds_stsmt = combo_stsmt.getStore();
var kdprodi = combo_prodi.getValue();
var kdstsemester = combo_stsmt.getValue();
var copy_form = new Ext.form.FormPanel({
xtype:'form',
id: 'frm.copy',
buttonAlign: 'left',
labelWidth: 215, labelAlign: 'right',
bodyStyle: 'padding:10px 3px 3px 5px', // atas, kanan, bawah, kiri
monitorValid: true,
height: 160, width: 545,
layout: 'form',
frame: false,
defaultType:'combo',
items: [{
id: 'cb.prodi-copy', fieldLabel: 'Program Studi',
store: ds_prodireg, triggerAction: 'all',
valueField: 'kdprodi', displayField: 'lnmprodi',
forceSelection: true, submitValue: true, mode: 'local',
allowBlank: false, editable: false,
width: 300,
},{
id: 'cb.smtbaru-copy', fieldLabel: 'Tahun Akademik - Semester (Baru)',
store: ds_stsmt, triggerAction: 'all', allowBlank: false,
valueField: 'kdstsemester', displayField: 'nmsmt',
forceSelection: true, submitValue: true, mode: 'local',
width: 250,
},{
id: 'cb.smtlama-copy', fieldLabel: 'Tahun Akademik - Semester (Lama)',
store: ds_stsmt, triggerAction: 'all',
valueField: 'kdstsemester', displayField: 'nmsmt',
forceSelection: true, submitValue: true, mode: 'local',
emptyText:'Pilih...', width:250,
}],
buttons: [{
text: 'Simpan', iconCls:'silk-save',
handler: function() {
fnSaveCopy();
}
}, {
text: 'Kembali', iconCls:'',
handler: function() {
wCopyStmhsSemester.close();
}
}]
});
/**SET THE FORM */
setForm();
var wCopyStmhsSemester = new Ext.Window({
title: 'Salin Calon Peserta Sidang dari Tahun Akademik - Semester Sebelumnya',
modal: true, closable:false,
items: [copy_form]
}).show();
/**
FUNCTIONS
*/
function setForm(){
Ext.getCmp('cb.prodi-copy').disable();
Ext.getCmp('cb.smtbaru-copy').disable();
RH.setCompValue('cb.prodi-copy', kdprodi);
RH.setCompValue('cb.smtbaru-copy', kdstsemester);
}
/**
SAVE COPY FUNCTIONS
*/
function fnSaveCopy(){
var smtlama = RH.getCompValue('cb.smtlama-copy',true);
if(smtlama == '') { RH.warning('Tahun Akademik - Semester (Lama) harus diisi'); return; };
var idForm = 'frm.copy';
var sUrl = BASE_URL +'psidang_controller/copy_stmhssemester';
var sParams = new Object({
kdprodi : RH.getCompValue('cb.prodi-copy'),
smtbaru : RH.getCompValue('cb.smtbaru-copy'),
smtlama : smtlama
});
var grid = masterGrid;
var msgWait = 'Tunggu, sedang proses menyimpan...';
var msgSuccess = 'Salin data berhasil';
var msgFail = 'Salin data gagal';
var msgInvalid = 'Data belum valid (data primer belum terisi)!';
//call form grid submit function (common function by RH)
RH.submitGridForm(idForm, sUrl, sParams, grid, wCopyStmhsSemester,
msgWait, msgSuccess, msgFail, msgInvalid);
}
}
//FORM PANEL HALAMAN TAMBAH//
function wform_peserta_sidang(isUpdate, grid, combo_prodi, combo_stsmt, record){
var winTitle = (isUpdate)?'Calon Peserta Sidang (Edit)':'Calon Peserta Sidang (Entry)';
var ds_stsmt = combo_stsmt.getStore();
var ds_prodireg = combo_prodi.getStore();
var kdstsemester = combo_stsmt.getValue();
var kdprodi = combo_prodi.getValue();
//Form Lulus
/* var form_lulus = new Ext.form.FormPanel({
items: [{
xtype: 'fieldset',
autoHeight:true,
border: false,
bodyStyle: 'padding:5px 3px 3px 3px', // atas, kanan, bawah, kiri
title: 'Khusus untuk status mahasiswa "Lulus"',
items: [{
xtype: 'datefield',
id: 'id.tgllulus',
fieldLabel: 'Tgl.Lulus', disabled: true,
width: 100
},
{
xtype: 'textfield',
id: 'id.sks', disabled: true,
fieldLabel: 'Total SKS Lulus',
width: 100,
},
{
xtype: 'textfield',
id: 'id.ipk', disabled: true,
fieldLabel: 'IPK Terakhir',
width: 100,
},
{
xtype: 'textfield',
id: 'id.nosk', disabled: true,
fieldLabel: 'No.S.K Yudisium',
width: 100,
},
{
xtype: 'datefield',
id: 'id.tglsk', disabled: true,
fieldLabel: 'Tgl.S.K Yudisium',
width: 100
},
{
xtype: 'textfield',
id: 'id.noseriizh', disabled: true,
fieldLabel: 'No.Seri Ijazah',
width: 100
},
{
xtype: 'combo', id: 'cb.tskripsi',
fieldLabel: 'Tipe Skripsi',
store: ds_tskripsi, triggerAction: 'all',
valueField: 'kdtskripsi', displayField: 'nmtskripsi',
forceSelection: true, submitValue: true, disabled: true,
mode: 'local', emptyText:'Pilih...', width: 100,
editable: false
},
{
xtype: 'combo', id: 'cb.jskripsi',
fieldLabel: 'Jenis Skripsi', disabled: true,
store: ds_jskripsi, triggerAction: 'all',
valueField: 'kdjskripsi', displayField: 'nmjskripsi',
forceSelection: true, submitValue: true,
mode: 'local', emptyText:'Pilih...', width: 100,
editable: false
},
{
xtype: 'datefield',
id: 'id.tglawalbimbing', disabled: true,
fieldLabel: 'Awal Bimbingan',
width: 100
},
{
xtype: 'datefield',
id: 'id.tglakhirbimbing', disabled: true,
fieldLabel: 'Akhir Bimbingan',
width: 100
},
{
xtype: 'combo', id: 'cb.idnidu1',
fieldLabel: 'Dosen Pembimbing 1',
store: ds_dosen1, triggerAction: 'all',
valueField: 'iddosen', displayField: 'nmdosen',
forceSelection: true, submitValue: true, disabled: true,
mode: 'local', emptyText:'Pilih...', width: 250,
editable: false
},
{
xtype: 'combo', id: 'cb.idnidu2',
fieldLabel: 'Dosen Pembimbing 2',
store: ds_dosen2, triggerAction: 'all',
valueField: 'iddosen', displayField: 'nmdosen',
forceSelection: true, submitValue: true, disabled: true,
mode: 'local', emptyText:'Pilih...', width: 250,
editable: false
},
{
xtype: 'combo', id: 'cb.idnidu3',
fieldLabel: 'Dosen Pembimbing 3',
store: ds_dosen3, triggerAction: 'all',
valueField: 'iddosen', displayField: 'nmdosen',
forceSelection: true, submitValue: true, disabled: true,
mode: 'local', emptyText:'Pilih...', width: 250,
editable: false
},
{
xtype: 'combo', id: 'cb.idnidu4',
fieldLabel: 'Dosen Pembimbing 4',
store: ds_dosen4, triggerAction: 'all',
valueField: 'iddosen', displayField: 'nmdosen',
forceSelection: true, submitValue: true, disabled: true,
mode: 'local', emptyText:'Pilih...', width: 250,
editable: false
},
{
xtype: 'combo', id: 'cb.idnidu5',
fieldLabel: 'Dosen Pembimbing 5',
store: ds_dosen5, triggerAction: 'all',
valueField: 'iddosen', displayField: 'nmdosen',
forceSelection: true, submitValue: true, disabled: true,
mode: 'local', emptyText:'Pilih...', width: 250,
editable: false
}]
}],
}); */
//Form Utama
var peserta_sidang_form = new Ext.form.FormPanel({
xtype:'form',
id: 'frm.psidang',
buttonAlign: 'left',
labelWidth: 200, labelAlign: 'right',
bodyStyle: 'padding:10px 3px 3px 5px', // atas, kanan, bawah, kiri
monitorValid: true,
height: 200, width: 500,
autoScroll: true,
layout: 'form',
frame: false,
defaultType:'textfield',
items: [
{
id: 'idstmhssemester',
hidden: true,
},
{
xtype: 'compositefield',
name: 'nim',
fieldLabel: 'NPM',
allowBlank: false,
id: 'nim',
items: [{
id: 'tf.frm.nim',
xtype:'textfield',
fieldLabel: 'NPM',
width: 150, allowBlank: false,
disabled: true,
},
{
xtype: 'button',
fieldLabel: 'Cari',
hidden:false,
labelStyle: 'width:160px',
id: 'btncari',
name: 'btncari',
width: 50,
handler:function() {
wGridMhsProdi('stmhssmt',kdprodi); //,kdstsemester
Ext.getCmp('cb.staktiv').setValue('N');
Ext.getCmp('cb.staktiv').disable();
Ext.getCmp('cbidcatnonaktif').enable();
}
}]
},
{
id: 'id.nmmhs',
fieldLabel: 'Nama Mahasiswa',
width: 250,
allowBlank: false,
disabled: true,
},
{
xtype: 'combo', id: 'cb.prodireg',
fieldLabel: 'Program Studi',
store: ds_prodireg, triggerAction: 'all',
valueField: 'kdprodi', displayField: 'lnmprodi',
forceSelection: true, submitValue: true,
mode: 'local', emptyText:'Pilih...', width: 250,
allowBlank: false,
editable: false
},
{
xtype: 'combo', id: 'cb.kdstsemester',
fieldLabel: 'Tahun Akademik-Semester',
store: ds_stsmt, triggerAction: 'all',
valueField: 'kdstsemester', displayField: 'nmsmt',
forceSelection: true, submitValue: true,
mode: 'local', emptyText:'Pilih...', width: 250,
allowBlank: false
},
{
xtype: 'combo', id: 'cb.idsemester',
fieldLabel: 'Tingkat/ Semester', hidden: true,
store: ds_idsemester, triggerAction: 'all',
valueField: 'kode', displayField: 'tingsem',
forceSelection: true, submitValue: true,
mode: 'local', emptyText:'Pilih...', width: 70,
allowBlank: true
},
{
xtype: 'combo', id: 'cb.idkelas',
fieldLabel: 'Kelas',hidden: true,
store: ds_idkelas, triggerAction: 'all',
valueField: 'idkelas', displayField: 'nmkelas',
forceSelection: true, submitValue: true,
mode: 'local', emptyText:'Pilih...', width: 100,
allowBlank: true
},
{
xtype: 'combo', id: 'cb.staktiv',
fieldLabel: 'Status Mahasiswa', hidden: true,
store: ds_staktiv, triggerAction: 'all',
valueField: 'kode', displayField: 'nama',
forceSelection: true, submitValue: true,
mode: 'local', emptyText:'Pilih...', width: 250,
editable: false, allowBlank: true,
listeners:{
select: function() {
var stmhs = Ext.getCmp('cb.staktiv').getRawValue();
if (stmhs == "LULUS"){
Ext.getCmp('id.tgllulus').enable();
Ext.getCmp('id.sks').enable();
Ext.getCmp('id.ipk').enable();
Ext.getCmp('id.nosk').enable();
Ext.getCmp('id.tglsk').enable();
Ext.getCmp('id.noseriizh').enable();
Ext.getCmp('cb.tskripsi').enable();
Ext.getCmp('cb.jskripsi').enable();
Ext.getCmp('id.tglawalbimbing').enable();
Ext.getCmp('id.tglakhirbimbing').enable();
Ext.getCmp('cb.idnidu1').enable();
Ext.getCmp('cb.idnidu2').enable();
Ext.getCmp('cb.idnidu3').enable();
Ext.getCmp('cb.idnidu4').enable();
Ext.getCmp('cb.idnidu5').enable();
} else {
Ext.getCmp('id.tgllulus').disable();
Ext.getCmp('id.sks').disable();
Ext.getCmp('id.ipk').disable();
Ext.getCmp('id.nosk').disable();
Ext.getCmp('id.tglsk').disable();
Ext.getCmp('id.noseriizh').disable();
Ext.getCmp('cb.tskripsi').disable();
Ext.getCmp('cb.jskripsi').disable();
Ext.getCmp('id.tglawalbimbing').disable();
Ext.getCmp('id.tglakhirbimbing').disable();
Ext.getCmp('cb.idnidu1').disable();
Ext.getCmp('cb.idnidu2').disable();
Ext.getCmp('cb.idnidu3').disable();
Ext.getCmp('cb.idnidu4').disable();
Ext.getCmp('cb.idnidu5').disable();
//value//
Ext.getCmp('id.tgllulus').setValue('');
Ext.getCmp('id.sks').setValue('');
Ext.getCmp('id.ipk').setValue('');
Ext.getCmp('id.nosk').setValue('');
Ext.getCmp('id.tglsk').setValue('');
Ext.getCmp('id.noseriizh').setValue('');
Ext.getCmp('cb.tskripsi').setValue('');
Ext.getCmp('cb.jskripsi').setValue('');
Ext.getCmp('id.tglawalbimbing').setValue('');
Ext.getCmp('id.tglakhirbimbing').setValue('');
Ext.getCmp('cb.idnidu1').setValue('');
Ext.getCmp('cb.idnidu2').setValue('');
Ext.getCmp('cb.idnidu3').setValue('');
Ext.getCmp('cb.idnidu4').setValue('');
Ext.getCmp('cb.idnidu5').setValue('');
}
/* if (stmhs == "NON-AKTIF"){
Ext.getCmp('cbidcatnonaktif').enable();
}else{
Ext.getCmp('cbidcatnonaktif').disable();
Ext.getCmp('cbidcatnonaktif').setValue('');
} */
}
}
},
{
xtype: 'combo', id: 'cbidcatnonaktif',
fieldLabel: 'Catatan Calon Peserta Sidang',
store: ds_cutidet, triggerAction: 'all',
valueField: 'idcutidet', displayField: 'nmcutidet', hidden: true,
forceSelection: true, submitValue: true,
mode: 'local', emptyText:'Pilih...', width: 150,
allowBlank: true,
listeners:{
select: function() {
var ctt = Ext.getCmp('cbidcatnonaktif').getValue();
if (ctt == "4"){
ds_staktiv.reload({
params: {
kdstaktivitas: 'A'
}
});
} else if (ctt != "4"){
ds_staktiv.reload({
params: {
kdstaktivitas: 'N'
}
});
}
}
}
},
/* {
xtype: 'textarea',
id: 'idcatnonaktif',
fieldLabel: 'Catatan Non-Aktif',
width: 250,
}, */
{
xtype: 'fieldset',
autoHeight:true, hidden: true,
border: true,
bodyStyle: 'padding:5px 3px 3px 3px', // atas, kanan, bawah, kiri
title: 'Khusus untuk status mahasiswa "Lulus"',
items: [{
xtype: 'datefield',
id: 'id.tgllulus',
fieldLabel: 'Tgl.Lulus', disabled: true,
width: 100
},
{
xtype: 'textfield',
id: 'id.sks', disabled: true,
fieldLabel: 'Total SKS Lulus',
width: 100,
},
{
xtype: 'textfield',
id: 'id.ipk', disabled: true,
fieldLabel: 'IPK Terakhir',
width: 100,
},
{
xtype: 'textfield',
id: 'id.nosk', disabled: true,
fieldLabel: 'No.S.K Yudisium',
width: 100,
},
{
xtype: 'datefield',
id: 'id.tglsk', disabled: true,
fieldLabel: 'Tgl.S.K Yudisium',
width: 100
},
{
xtype: 'textfield',
id: 'id.noseriizh', disabled: true,
fieldLabel: 'No.Seri Ijazah',
width: 100
},
{
xtype: 'combo', id: 'cb.tskripsi',
fieldLabel: 'Tipe Skripsi',
store: ds_tskripsi, triggerAction: 'all',
valueField: 'kdtskripsi', displayField: 'nmtskripsi',
forceSelection: true, submitValue: true, disabled: true,
mode: 'local', emptyText:'Pilih...', width: 100,
editable: false
},
{
xtype: 'combo', id: 'cb.jskripsi',
fieldLabel: 'Jenis Skripsi', disabled: true,
store: ds_jskripsi, triggerAction: 'all',
valueField: 'kdjskripsi', displayField: 'nmjskripsi',
forceSelection: true, submitValue: true,
mode: 'local', emptyText:'Pilih...', width: 100,
editable: false
},
{
xtype: 'datefield',
id: 'id.tglawalbimbing', disabled: true,
fieldLabel: 'Awal Bimbingan',
width: 100
},
{
xtype: 'datefield',
id: 'id.tglakhirbimbing', disabled: true,
fieldLabel: 'Akhir Bimbingan',
width: 100
},
{
xtype: 'combo', id: 'cb.idnidu1',
fieldLabel: 'Dosen Pembimbing 1',
store: ds_dosen1, triggerAction: 'all',
valueField: 'iddosen', displayField: 'nmdosen',
forceSelection: true, submitValue: true, disabled: true,
mode: 'local', emptyText:'Pilih...', width: 250,
editable: false
},
{
xtype: 'combo', id: 'cb.idnidu2',
fieldLabel: 'Dosen Pembimbing 2',
store: ds_dosen2, triggerAction: 'all',
valueField: 'iddosen', displayField: 'nmdosen',
forceSelection: true, submitValue: true, disabled: true,
mode: 'local', emptyText:'Pilih...', width: 250,
editable: false
},
{
xtype: 'combo', id: 'cb.idnidu3',
fieldLabel: 'Dosen Pembimbing 3',
store: ds_dosen3, triggerAction: 'all',
valueField: 'iddosen', displayField: 'nmdosen',
forceSelection: true, submitValue: true, disabled: true,
mode: 'local', emptyText:'Pilih...', width: 250,
editable: false
},
{
xtype: 'combo', id: 'cb.idnidu4',
fieldLabel: 'Dosen Pembimbing 4',
store: ds_dosen4, triggerAction: 'all',
valueField: 'iddosen', displayField: 'nmdosen',
forceSelection: true, submitValue: true, disabled: true,
mode: 'local', emptyText:'Pilih...', width: 250,
editable: false
},
{
xtype: 'combo', id: 'cb.idnidu5',
fieldLabel: 'Dosen Pembimbing 5',
store: ds_dosen5, triggerAction: 'all',
valueField: 'iddosen', displayField: 'nmdosen',
forceSelection: true, submitValue: true, disabled: true,
mode: 'local', emptyText:'Pilih...', width: 250,
editable: false
}]
}
],
buttons: [{
text: 'Simpan', iconCls:'silk-save',
handler: function() {
fnSimpanPsidang();
}
}, {
text: 'Kembali', iconCls:'',
handler: function() {
wStmhssemester.close();
}
}]
});
/**SET THE FORM */
setForm();
var wStmhssemester = new Ext.Window({
title: winTitle,
modal: true, closable:false,
items: [peserta_sidang_form],
/* listeners:{
hide: function() {
alert('hide');
},
collapse: function() {
alert('collapse');
}
} */
});
/**
CALL SET FORM AND SHOW THE FORM (WINDOW)
*/
setStmhssmt(isUpdate, record);
wStmhssemester.show();
/**
FUNCTIONS
*/
function setForm(){
Ext.getCmp('cb.prodireg').disable();
Ext.getCmp('cb.kdstsemester').disable();
RH.setCompValue('cb.prodireg', kdprodi);
RH.setCompValue('cb.kdstsemester', kdstsemester);
}
/**
/**
FORM FUNCTIONS
*/
function setStmhssmt(isUpdate, record){
if(isUpdate){
if(record != null){
Ext.getCmp('btncari').disable();
Ext.getCmp('id.tgllulus').enable();
Ext.getCmp('id.sks').enable();
Ext.getCmp('id.ipk').enable();
Ext.getCmp('id.nosk').enable();
Ext.getCmp('id.tglsk').enable();
Ext.getCmp('id.noseriizh').enable();
Ext.getCmp('cb.tskripsi').enable();
Ext.getCmp('cb.jskripsi').enable();
Ext.getCmp('id.tglawalbimbing').enable();
Ext.getCmp('id.tglakhirbimbing').enable();
Ext.getCmp('cb.idnidu1').enable();
Ext.getCmp('cb.idnidu2').enable();
Ext.getCmp('cb.idnidu3').enable();
Ext.getCmp('cb.idnidu4').enable();
Ext.getCmp('cb.idnidu5').enable();
RH.setCompValue('idstmhssemester', record.data['idstmhssemester']);
RH.setCompValue('tf.frm.nim', record.data['nim']);
RH.setCompValue('id.nmmhs', record.data['nmmhs']);
RH.setCompValue('cb.prodireg', record.data['kdprodi']);
RH.setCompValue('cb.kdstsemester', record.data['kdstsemester']);
RH.setCompValue('cb.staktiv', record.data['kdstaktivitasmhs']);
RH.setCompValue('id.tgllulus', record.data['tgllulus']);
RH.setCompValue('id.sks', record.data['skslulus']);
RH.setCompValue('id.ipk', record.data['ipk']);
RH.setCompValue('id.nosk', record.data['nosk']);
RH.setCompValue('id.tglsk', record.data['tglsk']);
RH.setCompValue('id.noseriizh', record.data['noijazah']);
RH.setCompValue('cb.tskripsi', record.data['kdtskripsi']);
RH.setCompValue('cb.jskripsi', record.data['kdjskripsi']);
RH.setCompValue('id.tglawalbimbing', record.data['awalbimbingan']);
RH.setCompValue('id.tglakhirbimbing', record.data['akhirbimbingan']);
RH.setCompValue('cb.idnidu1', record.data['nidu1']);
RH.setCompValue('cb.idnidu2', record.data['nidu2']);
RH.setCompValue('cb.idnidu3', record.data['nidu3']);
RH.setCompValue('cb.idnidu4', record.data['nidu4']);
RH.setCompValue('cb.idnidu5', record.data['nidu5']);
RH.setCompValue('cb.idsemester', record.data['idsemester']);
RH.setCompValue('cb.idkelas', record.data['idkelas']);
RH.setCompValue('cbidcatnonaktif', record.data['catnonaktif']);
//Ext.getCmp('cb.staktiv').disable();
ds_staktiv.reload({
params: {
kdstaktivitas: 'N'
}
});
return;
}
}else{
ds_staktiv.reload({
params: {
kdstaktivitas: null
}
});
}
}
function fnSimpanPsidang(){
var idForm = 'frm.psidang';
var sUrl = BASE_URL +'psidang_controller/insert_psidang';
var sParams = getInsertPsidangParams();
var msgWait = 'Tunggu, sedang proses menyimpan...';
var msgSuccess = 'Tambah data berhasil';
var msgFail = 'Tambah data gagal';
var msgInvalid = 'Data belum valid (data primer belum terisi)!';
if(isUpdate){
sUrl = BASE_URL +'psidang_controller/update_stmhssemester';
msgSuccess = 'Update data berhasil';
msgFail = 'Update data gagal';
}
//call form grid submit function (common function by RH)
RH.submitGridForm(idForm, sUrl, sParams, grid, wStmhssemester, msgWait, msgSuccess, msgFail, msgInvalid);
//RH.submitGridForm(idForm, sUrl, sParams, grid, wStmhssemester, msgWait, msgSuccess, msgFail, msgInvalid);
}
function getInsertPsidangParams(){
return new Object({
idstmhssemester : RH.getCompValue('idstmhssemester'),
nim : RH.getCompValue('tf.frm.nim'),
kdprodi : RH.getCompValue('cb.prodireg'),
kdstsemester : RH.getCompValue('cb.kdstsemester'),
stmhs : RH.getCompValue('cb.staktiv'),
tgllulus : RH.getCompValue('id.tgllulus'),
sks : RH.getCompValue('id.sks'),
ipk : RH.getCompValue('id.ipk'),
nosk : RH.getCompValue('id.nosk'),
tglsk : RH.getCompValue('id.tglsk'),
noseriizh : RH.getCompValue('id.noseriizh'),
tskripsi : RH.getCompValue('cb.tskripsi'),
jskripsi : RH.getCompValue('cb.jskripsi'),
tglawalbimbing : RH.getCompValue('id.tglawalbimbing'),
tglakhirbimbing : RH.getCompValue('id.tglakhirbimbing'),
idnidu1 : RH.getCompValue('cb.idnidu1'),
idnidu2 : RH.getCompValue('cb.idnidu2'),
idnidu3 : RH.getCompValue('cb.idnidu3'),
idnidu4 : RH.getCompValue('cb.idnidu4'),
idnidu5 : RH.getCompValue('cb.idnidu5'),
idsemester : RH.getCompValue('cb.idsemester'),
idkelas : RH.getCompValue('cb.idkelas'),
catnonaktif : Ext.getCmp('cbidcatnonaktif').getValue(),
//idcatnonaktif : RH.getCompValue('idcatnonaktif'), //Ext.getCmp('idcatnonaktif').getValue(),
});
}
}
//====================================================================
function kelengkapanSidang(L_MEMBER,NM_KLP,nim, nmmhs, kdstsemester, kdprodi){
var ds_grid = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: BASE_URL + 'psidang_controller/get_klkpsyaratsidang',
method: 'POST',
}),
baseParams: { nim:nim, kdstsemester:kdstsemester, kdprodi:kdprodi, nm_klp:NM_KLP },
totalProperty: 'results',
autoLoad : true,
root: 'data',
fields: [
, { name: 'kdsyaratsidang' }
, { name: 'nmsyaratsidang' }
, { name: 'deskripsi' }
, { name: 'kdstsemester' }
, { name: 'kdprodi' }
, { name: 'cek' ,type:'bool'}
]
});
var cm = new Ext.grid.ColumnModel({
columns: [
new Ext.grid.RowNumberer({width: 35}),
{
header: RH.h3('Syarat Sidang'),
width: 500,
dataIndex: 'nmsyaratsidang',
sortable: true
},{
xtype: 'checkcolumn',
header: RH.h3('Check List'),
width: 100,
dataIndex: 'cek',
sortable: true,
processEvent : function(name, e, grid, rowIndex, colIndex){
var rec = grid.store.getAt(rowIndex);
rec.set(this.dataIndex, !rec.data[this.dataIndex]);
}
}]
});
var cari_data_nya = [new Ext.ux.grid.Search({
iconCls: 'btn_search',
minChars: 1,
autoFocus: true,
autoHeight: true,
position: 'top',
mode: 'local',
width: 200
})];
var grid_nya = new Ext.grid.EditorGridPanel({
id: 'gp.grid_nya',
//plugins: cari_data_nya,
ds: ds_grid,
cm: cm,
sm: new Ext.grid.RowSelectionModel({ singleSelect: true}),
view: new Ext.grid.GridView({ emptyText: '< Belum ada Data >'}),
forceFit: true, //autoHeight: true, width: 720,
border: true,
tbar: [{
html: 'NPM : '+nim+', Nama : '+nmmhs+''
},'->',{
xtype: 'button',
id: 'bsimpan',
text: 'Simpan',
iconCls: 'silk-save',
handler: function() {
if (grid_nya.getStore().getCount() > 0) {
savesyaratsidang(L_MEMBER);
}
}
}],
autoSizeColumns: true,
enableColumnResize: true,
enableColumnHide: false,
enableColumnMove: false,
enableHdaccess: false,
columnLines: true,
loadMask: true,
layout: 'anchor',
});
var formnya = new Ext.form.FormPanel({
xtype:'form',
id: 'formnya',
buttonAlign: 'left',
labelWidth: 200, labelAlign: 'right',
bodyStyle: 'padding:10px 3px 3px 5px', // atas, kanan, bawah, kiri
monitorValid: true,
height: 400,
width: 1300,
layout: 'fit',
frame: true,
fileUpload: true,
items: [grid_nya]
});
var win = new Ext.Window({
title: 'Kelengkapan Syarat Sidang',
modal: true,
height: 300,
width: 800,
layout: 'fit',
items: [formnya]
}).show();
function savesyaratsidang(L_MEMBER){
var par='';
var count= 1;
var endpar = ';';
grid_nya.getStore().each(function(rec){
var rowData = rec.data;
if (count == grid_nya.getStore().getCount()) {
endpar = ''
}
var ceklis = (rowData['cek']) ? 1 : 0;
par += nim + 'x' +
rowData['kdstsemester'] + 'x' +
rowData['kdprodi'] + 'x' +
rowData['kdsyaratsidang'] + 'x' +
ceklis + 'x' +
L_MEMBER + 'x' +
endpar;
count= count+1;
});
var waitmhssave = Ext.MessageBox.wait('Menyimpan Data...', 'Info');
Ext.Ajax.request({
url: BASE_URL +'psidang_controller/save_syaratsidang',
method: 'POST',
params: {
par : par
},
waitMsg: 'Tunggu, sedang proses menyimpan...',
success: function(result) {
waitmhssave.hide();
Ext.Msg.alert("Info", "Simpan Data Berhasil");
win.close();
ds_peserta_sidang.reload();
ds_grid.reload();
},
failure: function(result){
waitmhssave.hide();
Ext.Msg.alert("Info", "Simpan Data Gagal");
}
});
}
}
function kelengkapanWisuda(nim, nmmhs, kdstsemester){
var ds_grid = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: BASE_URL + 'psidang_controller/get_klkpsyaratwisuda',
method: 'POST',
}),
baseParams: { nim:nim, kdstsemester:kdstsemester },
totalProperty: 'results',
autoLoad : true,
root: 'data',
fields: [
, { name: 'kdsyaratwisuda' }
, { name: 'nmsyaratwisuda' }
, { name: 'deskripsi' }
, { name: 'kdstsemester' }
, { name: 'cek' ,type:'bool'}
]
});
var cm = new Ext.grid.ColumnModel({
columns: [
new Ext.grid.RowNumberer({width: 35}),
{
header: RH.h3('Syarat Wisuda'),
width: 500,
dataIndex: 'nmsyaratwisuda',
sortable: true
},{
xtype: 'checkcolumn',
header: RH.h3('Check List'),
width: 100,
dataIndex: 'cek',
sortable: true,
processEvent : function(name, e, grid, rowIndex, colIndex){
var rec = grid.store.getAt(rowIndex);
rec.set(this.dataIndex, !rec.data[this.dataIndex]);
}
}]
});
var cari_data_nya = [new Ext.ux.grid.Search({
iconCls: 'btn_search',
minChars: 1,
autoFocus: true,
autoHeight: true,
position: 'top',
mode: 'local',
width: 200
})];
var grid_nya = new Ext.grid.EditorGridPanel({
id: 'gp.grid_nya',
//plugins: cari_data_nya,
ds: ds_grid,
cm: cm,
sm: new Ext.grid.RowSelectionModel({ singleSelect: true}),
view: new Ext.grid.GridView({ emptyText: '< Belum ada Data >'}),
forceFit: true, //autoHeight: true, width: 720,
border: true,
tbar: [{
html: 'NPM : '+nim+', Nama : '+nmmhs+''
},'->',{
xtype: 'button',
id: 'bsimpan',
text: 'Simpan',
iconCls: 'silk-save',
handler: function() {
if (grid_nya.getStore().getCount() > 0) {
savesyaratwisuda();
}
}
}],
autoSizeColumns: true,
enableColumnResize: true,
enableColumnHide: false,
enableColumnMove: false,
enableHdaccess: false,
columnLines: true,
loadMask: true,
layout: 'anchor',
});
var formnya = new Ext.form.FormPanel({
xtype:'form',
id: 'formnya',
buttonAlign: 'left',
labelWidth: 200, labelAlign: 'right',
bodyStyle: 'padding:10px 3px 3px 5px', // atas, kanan, bawah, kiri
monitorValid: true,
height: 400,
width: 1300,
layout: 'fit',
frame: true,
fileUpload: true,
items: [grid_nya]
});
var win = new Ext.Window({
title: 'Kelengkapan Syarat Wisuda',
modal: true,
height: 300,
width: 800,
layout: 'fit',
items: [formnya]
}).show();
function savesyaratwisuda(){
var par='';
var count= 1;
var endpar = ';';
grid_nya.getStore().each(function(rec){
var rowData = rec.data;
if (count == grid_nya.getStore().getCount()) {
endpar = ''
}
var ceklis = (rowData['cek']) ? 1 : 0;
par += nim + 'x' +
rowData['kdstsemester'] + 'x' +
rowData['kdsyaratwisuda'] + 'x' +
ceklis + 'x' +
endpar;
count= count+1;
});
var waitmhssave = Ext.MessageBox.wait('Menyimpan Data...', 'Info');
Ext.Ajax.request({
url: BASE_URL +'psidang_controller/save_syaratwisuda',
method: 'POST',
params: {
par : par
},
waitMsg: 'Tunggu, sedang proses menyimpan...',
success: function(result) {
waitmhssave.hide();
win.close();
ds_peserta_sidang.reload();
Ext.Msg.alert("Info", "Simpan Data Berhasil");
},
failure: function(result){
waitmhssave.hide();
Ext.Msg.alert("Info", "Simpan Data Gagal");
}
});
}
}
}