function f_verifikasipmb() {
var module_id;
var ds_grid = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: BASE_URL + 'pendaftaran/c_verifikasipmb/grid',
method: 'POST'
}),
params: {
start: 0,
limit: 5
},
root: 'data',
totalProperty: 'results',
autoLoad: true,
fields: [{
name: "nopmb",
mapping: "nopmb"
},
{
name: "tglpmb",
mapping: "tglpmb"
},
{
name: "nama",
mapping: "nama"
},
{
name: "kdjk",
mapping: "kdjk"
},
{
name: "idstmskmhs",
mapping: "idstmskmhs"
},
{
name: "kdprodi1",
mapping: "kdprodi1"
},
{
name: "kdprodi2",
mapping: "kdprodi2"
},
{
name: "nokuitansipmb",
mapping: "nokuitansipmb"
},
{
name: "idcarabyr",
mapping: "idcarabyr"
},
{
name: "penguji",
mapping: "penguji"
},
{
name: "catatanusm",
mapping: "catatanusm"
},
{
name: "nokuitansipmb",
mapping: "nokuitansipmb"
},
{
name: "nobuktitransfer",
mapping: "nobuktitransfer"
},
{
name: "tgltransfer",
mapping: "tgltransfer"
},
{
name: "uangditerima",
mapping: "uangditerima"
},
{
name: "verifikasipmb",
mapping: "verifikasipmb",
type: 'bool'
},
{
name: "nominal",
mapping: "nominal"
}]
});
var sm_nya = new Ext.grid.CheckboxSelectionModel({
listeners: {
selectionchange: function(sm) {
if (sm.getCount()) {
var c = sm_nya.getSelected().data['idcarabyr'];
// alert(c);
if (c == '' || c == null) { //isi
Ext.getCmp('veritbar').disable();
} else {
Ext.getCmp('veritbar').enable();
}
} else {
Ext.getCmp('veritbar').disable();
}
}
}
});
var cm = new Ext.grid.ColumnModel({
// specify any defaults for each column
defaults: {
sortable: true // columns are not sortable by default
},
columns: [//sm_nya,
{
header: '
No. PMB',
width: 75,
dataIndex: 'nopmb'
// ,
// sortable: true
},
{
header: 'Tgl. Daftar',
width: 75,
dataIndex: 'tglpmb',
sortable: true
// ,
// editor: {
// xtype: 'datefield',
// allowBlank: false
// minValue: '01/01/2006',
// minText: 'Can\'t have a start date before the company existed!',
// maxValue: (new Date()).format('m/d/Y')
// }
},
{
header: 'Nama Pendaftar',
width: 150,
dataIndex: 'nama',
sortable: true
// ,
// editor: {
// xtype: 'textfield',
// allowBlank: false
// }
},
{
header: '(L/P)',
width: 40,
dataIndex: 'kdjk',
sortable: true
// ,
// editor: {
// xtype: 'textfield',
// allowBlank: false
// }
},
{
header: 'Status Pendaftar',
width: 110,
dataIndex: 'idstmskmhs',
sortable: true
// ,
// editor: {
// xtype: 'textfield',
// allowBlank: false
// }
},
{
header: 'Prodi Pilihan 1',
width: 150,
dataIndex: 'kdprodi1',
sortable: true
// ,
// editor: {
// xtype: 'textfield',
// allowBlank: false
// }
},
{
header: 'Prodi Pilihan 2',
width: 150,
dataIndex: 'kdprodi2',
sortable: true
// ,
// editor: {
// xtype: 'textfield',
// allowBlank: false
// }
},
{
header: 'No. Kwitansi',
width: 100,
dataIndex: 'nokuitansipmb',
//kuitansipmb
sortable: true
// ,
// editor: {
// xtype: 'textfield',
// allowBlank: false
// }
},
{
header: 'Cara Bayar',
width: 100,
dataIndex: 'idcarabyr',
sortable: true,
editor: {
xtype: 'combo',
allowBlank: false,
store: ds_carabyr,
name: 'cmbidcarabyr',
id: 'cmbidcarabyr',
editable: false,
triggerAction: 'all',
valueField: 'nmcarabyr',
displayField: 'nmcarabyr',
forceSelection: true,
submitValue: true,
hiddenName: 'h_cmbidcarabyr',
listeners: {
select: function() {
var cannot = cek(sm_nya);
if (cannot != 0) {
Ext.getCmp('veritbar').enable();
}
}
},
typeAhead: true,
mode: 'local',
emptyText: 'Pilih...',
selectOnFocus: true
}
},
{
header: 'No Ref. / Bukti
Transfer',
width: 100,
dataIndex: 'nobuktitransfer',
sortable: true
// ,
// editor: {
// xtype: 'textfield',
// allowBlank: false
// }
},
{
header: 'Tgl. Transfer',
width: 75,
dataIndex: 'tgltransfer',
sortable: true
// ,
// editor: {
// xtype: 'datefield',
// allowBlank: false,
// minValue: '01/01/2006',
// minText: 'Can\'t have a start date before the company existed!',
// maxValue: (new Date()).format('m/d/Y')
// }
},
{
header: 'Nominal',
width: 100,
dataIndex: 'nominal',//'uangditerima',
sortable: true,
renderer : formatmoney_grid
// ,
// editor: new Ext.form.TextField(
// {
// allowNegative: false
// })
},
{
xtype: 'checkcolumn',
header: 'Verifikasi',
dataIndex: 'verifikasipmb',
id: 'verifikasipmb',
width: 60,
readonly: false,
editor: {
xtype: 'checkbox'
}
},
{
header: 'Catatan',
width: 150,
dataIndex: 'catatanusm',
sortable: true
// ,
// editor: {
// xtype: 'textfield',
// allowBlank: false
// }
}]
});
var vw = new Ext.grid.GridView({
emptyText: '< No Data To Display >'
});
var cari_data = [new Ext.ux.grid.Search({
iconCls: 'btn_search',
minChars: 1,
autoFocus: true,
autoHeight: true,
position: 'top',
mode: 'remote',
width: 200
})];
var paging = new Ext.PagingToolbar({
pageSize: 50,
store: ds_grid,
displayInfo: true,
displayMsg: 'Data Verifikasi PMB Dari {0} - {1} of {2}',
emptyMsg: 'Verifikasi PMB Belum Dipilih.'
});
var editor = new Ext.ux.grid.RowEditor({
saveText: 'Update'
});
var grid_nya = new Ext.grid.EditorGridPanel({
//autoExpandColumn: 'common',
//width: 1140,
//plugins:[editor],// cari_data,
// autoWidth:true,
// autoSizeColumns:true,
// enableColumnResize: true,
// enableColumnHide: false,
// enableColumnMove: false,
// enableHdMenu: false,
// columnLines: true,
// loadMask: true,
store: ds_grid,
sm: sm_nya,
vw: vw,
autoScroll: true,
cm: cm,
bbar: paging,
clicksToEdit: 1,
frame: true,
autoHeight: true,
autoWidth: true,
id: 'grid_det',
region: 'center',
buttonAlign: 'left',
defaults: {
anchor: '-10'
},
forceFit: true,
tbar: [{
xtype: 'buttongroup',
title: 'Pencarian',
columns: 4,
width: 500,
defaults: {
scale: 'small'
},
items: [{
// text: 'Jadwal PMB'
xtype: 'checkbox',
boxLabel: 'Jadwal PMB',
name: 'jadwalpmb',
id: 'jadwalpmb',
value: '1',
listeners: {
check: function() {
var nilai = Ext.getCmp('jadwalpmb').getValue();
if (nilai == true) {
Ext.getCmp('kdjadwalpmb').setDisabled(false);
} else {
Ext.getCmp('kdjadwalpmb').setDisabled(true);
Ext.getCmp('kdjadwalpmb').setValue('');
}
}
}
},
{
xtype: 'combo',
store: ds_jadwalpmb,
name: 'kdjadwalpmb',
id: 'kdjadwalpmb',
triggerAction: 'all',
editable: false,
disabled: true,
width:300,
valueField: 'kdjadwalpmb',
displayField: 'nmjadwalpmb',
forceSelection: true,
submitValue: true,
hiddenName: 'h_kdjadwalpmb',
listeners: {},
typeAhead: true,
mode: 'local',
emptyText: 'Pilih...',
selectOnFocus: true
},
{
xtype: 'label',
text: ''
},
{
xtype: 'label',
text: ''
},
{
// text: 'Jadwal PMB'
xtype: 'checkbox',
boxLabel: 'Cari Berdasarkan',
name: 'cariberdasakan',
id: 'cariberdasakan',
value: '1',
listeners: {
check: function() {
var nilai = Ext.getCmp('cariberdasakan').getValue();
if (nilai == true) {
Ext.getCmp('idfield').setDisabled(false);
Ext.getCmp('fieldnya').setDisabled(false);
} else {
Ext.getCmp('idfield').setDisabled(true);
Ext.getCmp('fieldnya').setDisabled(true);
Ext.getCmp('idfield').setValue('');
Ext.getCmp('fieldnya').setValue('');
}
}
}
},
{
xtype: 'combo',
store: ['No PMB', 'Tgl. Daftar', 'Nama Pendaftar', '(L/P)', 'Status', 'Program Studi', 'Hasil', 'Penguji', 'Catatan'],
//ds_fieldpmb,
name: 'idfield',
id: 'idfield',
triggerAction: 'all',
editable: false,
disabled: true,
width:300,valueField: 'kolom',
displayField: 'kolom',
forceSelection: true,
submitValue: true,
hiddenName: 'h_kolom',
listeners: {},
typeAhead: true,
mode: 'remote',
emptyText: 'Pilih...',
selectOnFocus: true
},
{
xtype: 'textfield',
name: 'fieldnya',
id: 'fieldnya',
width: 300,
disabled: true
// fieldLabel:'Dodol'
},
{
xtype: 'button',
text: ' Cari ',
iconCls: 'silk-find',
id: 'btn_data',
width: 3,
handler: function() {
ds_grid.setBaseParam('idjadwalpmb', Ext.getCmp('kdjadwalpmb').getValue());
ds_grid.setBaseParam('idnya', Ext.getCmp('idfield').getValue());
ds_grid.setBaseParam('fieldnya', Ext.getCmp('fieldnya').getValue());
ds_grid.load();
}
}]
},
{
text: 'Verifikasi',
id: 'veritbar',
iconCls: 'silk-save',
disabled: true,
handler: function() {
//alert(USERNAME);
verifikasi();
}
}, '->',
{
text: 'Tambah',
iconCls: 'silk-add',
handler: function() {
f_verifikasipmb_form('','','Tambah Mahasiswa Baru');
}
},
{
text: 'Lihat/Edit',
iconCls: 'silk-edit',
handler: function() {
f_verifikasipmb_form(module_id, ds_grid, 'Verifikasi PMB');
}
}, '-',
{
text: 'Cetak Kuitansi',
iconCls: 'silk-printer',
handler: function() {
var parsing = ''; //20121istra2012_2013istraGanjil
parsing = parsing + '20121';
parsing = parsing + 'istra' + '2012_2013';
parsing = parsing + 'istra' + 'Ganjil';
var win = window.open();
win.location.reload();
win.location = BASE_URL + 'print/print_topdf/pcetakskwitansi/'+parsing;
} //f_verifikasipmb_form(module_id,ds_grid);
}],
listeners: {
rowclick: function rowClick(grid, rowIdx) {
var rec = ds_grid.getAt(rowIdx);
//alert(rec.data["kdmenu"] + ', ' + Ext.getCmp('combox').getValue());
if (sm_nya.getCount() > 0) {
module_id = sm_nya.getSelected().data['nopmb'];
//f_verifikasipmb_form(module_id,ds_grid);
}
}
}
});
var form_bp_general = new Ext.form.FormPanel({
id: 'form_bp_general_id',
title: 'Verifikasi PMB',
region: 'center',
//autoScroll: true,
buttonAlign: 'left',
bodyStyle: 'padding: 5px',
border: false,
disabled: true,
waitMsg: 'Waiting...',
maskDisabled: false,
monitorValid: true,
items: [{
layout: 'form',
border: false,
items: [grid_nya]
}],
listeners:{
afterrender:function(){
Ext.getCmp('jadwalpmb').setValue(true);
}
}
});
function verifikasi() {
var cannot = cek(sm_nya);
// alert(cannot);
if (cannot == 0) {
Ext.MessageBox.show({
title: "Konfirmasi",
width: 350,
msg: " Anda Yakin Untuk Mengubah Data ini?",
buttons: Ext.MessageBox.YESNOCANCEL,
fn: function(btn) {
if (btn == 'yes') {
var hasil_akhir = get_detail_item(sm_nya);
Ext.Ajax.request({
url: BASE_URL + 'pendaftaran/c_verifikasipmb/verifikasiidcarabyr',
params: {
details: hasil_akhir
},
success: function() {
Ext.MessageBox.alert("Informasi", "Ubah Data Berhasil");
ds_grid.load();
},
failure: function() {
Ext.MessageBox.alert("Informasi", "Ubah Data Gagal");
}
});
}
}
});
} else {
Ext.MessageBox.alert("Perhatian", "Ada data [Cara bayar] yang masih kosong?!");
}
}
function get_detail_item(sm) {
var par = '';
var c = ';';
var i = 0;
var cntrec = sm.getCount();
var arr = sm.getSelections();
for (i = 0; i < cntrec; i++) {
if (i == cntrec - 1) {
c = ''
}
par += arr[i].data['nopmb'] + 'x' + arr[i].data['idcarabyr'] + 'x' + USERNAME + c;
}
return par;
}
function cek(sm) {
var par = '';
var i = 0;
var j = 0;
var cntrec = sm.getCount();
var arr = sm.getSelections();
for (i = 0; i < cntrec; i++) {
var y = arr[i].data['idcarabyr'];
if (y == "" || y == null) {
j++;
}
}
return j;
}
get_content(form_bp_general);
}