function pDosen(user){ var hiddencari,hiddennotdos; if (user==''){ hiddencari = false; hiddennotdos = true }else{ hiddencari = true; hiddennotdos = false; } var hapusfotox = 0; p = new Ext.Panel({ border: true, frame: true, style: 'margin-left: 50px;margin-bottom: 30px', width: 120, height: 135, html: '

PHOTO

' }); // TABS PANEL var dosFTabPanel = new Ext.form.FormPanel({ //var dosFTabPanel = new Ext.Panel({ layout: 'form', id: 'fp.dosFTabPanel', region: 'center', buttonAlign: 'left', bodyStyle: 'padding: 0px', border: false, layout: 'fit', waitMsg: 'Waiting...', maskDisabled: false, monitorValid: true, items: [getDosTabs(hiddencari)], //[dosTabs], ///// TOOL BAR //////////////////////////// tbar: [{ text: 'Tambah Baru', id: 'tb.add-dos', iconCls: 'silk-add', hidden:true, handler: function() { fnAddDosen(); } }, { text: 'Edit', id: 'tb.edit-dos', iconCls: 'silk-application-edit', hidden:hiddennotdos, handler: function() { fnEditDosen(); } }, { text: 'Simpan (Insert)', id: 'tb.save-dos', iconCls: 'silk-save', hidden:true, handler: function() { /*fnSaveDosen('insert');*/ upload_foto_dosen('fp.dosDispPanel','insert'); } }, { text: 'Simpan (Update)', id: 'tb.update-dos', iconCls: 'silk-save', hidden:hiddennotdos, hidden: true, handler: function() { /*fnSaveDosen('update');*/ upload_foto_dosen('fp.dosDispPanel','update'); } }, { text: 'Cari', id: 'tb.find-dos', iconCls: 'silk-find', hidden:hiddencari, //handler: function() { wLookup(lu_dos, 'Dosen', '0','0');} handler: function() { wGridDos();} }, { text: 'Print', iconCls: 'silk-printer', hidden:true, //handler: function() {} }, '->', { text: 'Refresh', id: 'tb.ref-mhs', iconCls: 'silk-arrow-refresh', handler: function() { sett_oto_nidu(); } }] ////////////// }); //DISPLAY_FORM_PANEL var dosDispPanel = new Ext.form.FormPanel({ id: 'fp.dosDispPanel', name: 'fp.dosDispPanel', fileUpload: true, border: false, bodyStyle: 'padding:5px 5px 0', forceFit:true, frame: true, autoScroll:true, labelAlign: 'top', layout: 'anchor', items: [ { layout: 'form', defaultType: 'textfield', defaults: { readOnly: true}, items: [ p , { xtype: 'fileuploadfield', id: 'file_gambar', emptyText: 'Select an image', fieldLabel: 'Pilih Foto', name: 'file_gambar', width: 200, buttonText: '', buttonCfg: { iconCls: 'silk-image' }, listeners: { valid: function() { hapusfotox = 1; } } } , { id: 'frm.nidu', fieldLabel: 'NIDU', width: 200, height:24} , { id: 'frm.nama_l-dos', fieldLabel: 'Nama Dosen', width: 200, height:24 } , { id: 'frm.fakultas-dos', fieldLabel: 'Fakultas', width: 200, height:24 } , { id: 'frm.prodi-dos', fieldLabel: 'Program Studi', width: 200, height:24 } , { id: 'frm.nidn', fieldLabel: 'NIDN', width: 200, height:24} , { id: 'frm.staktiv-dos', fieldLabel: 'Status Aktivasi Dosen', width: 200, height:24} , { id: 'frm.stikj-dos', fieldLabel: 'Status Ikatan Dosen di PT', width: 200, height:24 } , { id: 'frm.foto', hidden:true, fieldLabel: '' , validator: function(value){ dosen_foto_ori(Ext.getCmp("frm.foto").getValue()); },width: 200, height:24 } , { id: 'oto1', fieldLabel: '' ,width: 200, height:24, hidden:true} ] }] }); //PANEL var dosPanel = new Ext.Panel({ bodyStyle: 'padding: 5px', title: 'Dosen', iconCls: 'silk-group-add', frame: false, defaults: { //anchor: '-10' }, border: true, margins: '0 0 5 0', plain: true, forceFit: true, layout: 'border', //'column', items: [{ region: 'center', xtype: 'panel', border: true, bodyStyle: 'padding:3px 3px 3px 3px', layout: 'fit', items: [dosFTabPanel], //autoScroll: true }, { region: 'east', xtype: 'panel', title: 'Short Profile', border: true, layout:'fit', width:250, collapsible: true, collapseMode: 'header', titleCollapse: true, titleAlign: 'center', items: [dosDispPanel], }], listeners: { afterrender:function(){ if (user!=''){ var waitmsg = Ext.MessageBox.wait('Proses mendapatkan data...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'dosen_controller/get_dos_byId', method: 'POST', params :{ nidu: USERID }, scope: this, async:false, //waitMsg: "sedang diproses...", success: function(result){ var jsonData = Ext.decode(result.responseText); //bisa utk Ext3 dan Ext4 if(jsonData.status == false){ Ext.Ajax.request({ url: BASE_URL + 'user/ext_logout', method: 'POST', success: function(xhr) { localStorage.removeItem('access_token'); window.location = BASE_URL + 'user/login'; } }); } var dataArray = jsonData.data; if(dataArray == null || dataArray =='') return; var data = dataArray[0]; if(data == null || data =='') return; if(data.nidu == null || data.nidu == '') return; //Ext.getCmp('tf.npm-mhs', data.nim); setDataDos(data); //Ext.getCmp('personal-dos').setValue(data.nidu); /* Ext.getCmp('paramnimdpk').setValue(data.nidu); Ext.getCmp('paramnimdpp').setValue(data.nidu); Ext.getCmp('paramnimabsen').setValue(data.nidu); */ //Ext.getCmp('w.search-mhs').close(); disableDosContents(); waitmsg.hide(); } }); } } } }); get_content(dosPanel); //sett_oto_nidu(); }; function setDataDos(data){ //DATA PRIBADI Ext.getCmp('cb.prodi-dos').setValue(data.kdprodi); Ext.getCmp('cb.status-dos').setValue(data.kdstdosen); Ext.getCmp('tf.nidu-dos').setValue(data.nidu); Ext.getCmp('tf.nidn-dos').setValue(data.nidn); Ext.getCmp('tf.nup-dos').setValue(data.nup); Ext.getCmp('tf.nama-dos').setValue(data.nmdostpgelar); Ext.getCmp('tf.namawgelar-dos').setValue(data.nmdosdgngelar); Ext.getCmp('tf.glrdpn-dos').setValue(data.gelardpn); Ext.getCmp('tf.glrblk-dos').setValue(data.gelarblk); Ext.getCmp('tf.glrtop-dos').setValue(data.gelartertinggi); Ext.getCmp('tf.tplahir-dos').setValue(data.tptlahir); Ext.getCmp('df.tglahir-dos').setValue(data.tgllahir); Ext.getCmp('cb.gender-dos').setValue(data.kdjnskelamin); Ext.getCmp('cb.jabak-dos').setValue(data.kdjabakademik); Ext.getCmp('tf.noktp-dos').setValue(data.noktp); Ext.getCmp('cb.pdktop-dos').setValue(data.kdpendidikantertinggi); Ext.getCmp('cb.stikj-dos').setValue(data.kdstikatankerjadosen); Ext.getCmp('cb.staktiv-dos').setValue(data.kdstaktivitasdosen); Ext.getCmp('cb.smt-dos').setValue(data.kdstsemester); Ext.getCmp('tf.nip-dos').setValue(data.nippns); Ext.getCmp('tf.kdhome-dos').setValue(data.kdpt); //Ext.getCmp('tf.nmhome-dos').setValue(data.nup); Ext.getCmp('cb.goldarah-dos').setValue(data.idgoldarah); Ext.getCmp('cb.wn-dos').setValue(data.kdwarga); //DATA KONTAK Ext.getCmp('tf.alamat-dos').setValue(data.alamat); Ext.getCmp('tf.kel-dos').setValue(data.kelurahan); Ext.getCmp('tf.kec-dos').setValue(data.kecamatan); //Ext.getCmp('kota-dos').setValue(data.kdkotkab); Ext.getCmp('tf.kdkota-dos').setValue(data.kdkotkab); Ext.getCmp('tf.kdpos-dos').setValue(data.kdpos); Ext.getCmp('tf.telp-dos').setValue(data.notelp); Ext.getCmp('tf.email-dos').setValue(data.email); Ext.getCmp('tf.fb-dos').setValue(data.facebook); Ext.getCmp('tf.twit-dos').setValue(data.twitter); Ext.getCmp('tf.pinbb-dos').setValue(data.pinbb); Ext.getCmp('tf.web-dos').setValue(data.website); //DATA LAIN Ext.getCmp('ta.notes-dos').setValue(data.catatan); //DATA SHORT PROFILE Ext.getCmp('frm.foto').setValue(data.foto); Ext.getCmp('file_gambar').setValue(data.foto); Ext.getCmp('frm.nidu').setValue(data.nidu); Ext.getCmp('frm.nama_l-dos').setValue(data.nmdosdgngelar); Ext.getCmp('frm.fakultas-dos').setValue(data.nmfakultas); Ext.getCmp('frm.prodi-dos').setValue(data.nmprodi); Ext.getCmp('frm.nidn').setValue(data.nidn); Ext.getCmp('frm.staktiv-dos').setValue(data.nmaktivitasdosen); Ext.getCmp('frm.stikj-dos').setValue(data.nmikatankerjadosen); }