function f_jurnal_form(id_module,ds) { //VARIABEL SESSION// var userid = USERID; var ds_jnsjurnal = store_jnsjurnal(); var ds_stpublish = store_stpublish(); var ds_fakultas = store_fakultas(); var ds_prodi_jurnal = store_prodi_jurnal(); var form_bp_general = new Ext.form.FormPanel({ border: false, autoScroll: true, id: 'form_bp_general', labelAlign: 'left', buttonAlign: 'right', fileUpload: true, bodyStyle: 'padding:10px 3px 3px 5px', // atas, kanan, bawah, kiri monitorValid: true, height: 570, width: 800, layout: 'form', reader: new Ext.data.JsonReader ({ root: 'data', totalProperty: 'results', id: 'id', fields: [ { name: "kdjurnal", mapping: "kdjurnal" }, { name: "idjnsjurnal", mapping: "idjnsjurnal" }, { name: "judul", mapping: "judul" }, { name: "penulis", mapping: "penulis" }, { name: "warganegara", mapping: "warganegara" }, { name: "tglterbit", mapping: "tglterbit" }, { name: "deskripsi", mapping: "deskripsi" }, { name: "file", mapping: "file" }, { name: "idstpublish", mapping: "idstpublish" }, { name: "userid", mapping: "userid" }, { name: "tgluserinput", mapping: "tgluserinput" }, { name: "download", mapping: "download" }, { name: "url", mapping: "url" }, { name: "tipe", mapping: "tipe" }, { name: "issn", mapping: "issn" }, { name: "cover", mapping: "cover" }, { name: "kdfakultas", mapping: "kdfakultas" }, { name: "kdprodi", mapping: "kdprodi" } ] }), items: [ { xtype: 'textfield', fieldLabel: 'Userid', hidden:true, readOnly:true, name: 'userid', value:userid }, { xtype: 'textfield', fieldLabel: 'Download', hidden:true, readOnly:true, name: 'download' }, { xtype: 'datefield', name: 'tgluserinput', hidden:true, readOnly:true, fieldLabel: 'Tanggal Input', value: new Date() }, { xtype: 'textfield', fieldLabel: 'Kode', hidden:true, name: 'kdjurnal' }, { xtype: 'textfield', fieldLabel: 'ISSN', width:230, name: 'issn' }, { xtype: 'fileuploadfield', emptyText: 'Select an image to upload...', fieldLabel: 'Gambar Cover', width: 230, buttonText: 'Browse', name: 'cover', id: 'cover' }, { xtype: 'combo', width: 230, store: ds_jnsjurnal, fieldLabel: 'Jenis Jurnal', id: 'idjnsjurnal', triggerAction: 'all', editable: false, valueField: 'idjnsjurnal', displayField: 'nmjnsjurnal', forceSelection: true, submitValue: true, hiddenName: 'h_jnsjurnal', listeners: {}, typeAhead: true, mode: 'local', emptyText:'Pilih...', selectOnFocus:true, allowBlank: false }, { xtype: 'textarea', fieldLabel: 'Judul', width:500, height:50, name: 'judul', allowBlank: false }, { xtype: 'textfield', fieldLabel: 'Penulis', width:230, name: 'penulis', allowBlank: false }, { store:[ ['WNA', 'WNA'], ['WNI', 'WNI'], ], xtype: 'combo', id: 'warganegara', fieldLabel: 'Warga Negara', triggerAction: 'all', forceSelection: true, submitValue: true, mode: 'local', emptyText:'Pilih...', editable: false, name: 'warganegara', allowBlank: false }, { xtype: 'datefield', name: 'tglterbit', fieldLabel: 'Tanggal Terbit', value: new Date(), width: 100, allowBlank: false }, { xtype: 'combo', width: 230, store: ds_fakultas, fieldLabel: 'Fakultas', id: 'kdfakultas', triggerAction: 'all', editable: false, valueField: 'kdfakultas', displayField: 'nmfakultas', forceSelection: true, submitValue: true, hiddenName: 'h_fakultas', listeners: {}, typeAhead: true, mode: 'local', emptyText:'Pilih...', selectOnFocus:true, allowBlank: false, //name: 'kdfakultas', listeners:{ select: function(){ var kdfak = Ext.getCmp('kdfakultas').getValue(); if(kdfak){ ds_prodi_jurnal.setBaseParam('kdfakultas', kdfak); ds_prodi_jurnal.load(); Ext.getCmp('kdprodi').enable(); }else{ Ext.getCmp('kdprodi').disable(); } } } }, { xtype: 'combo', width: 230, store: ds_prodi_jurnal, fieldLabel: 'Prodi', id: 'kdprodi', triggerAction: 'all', editable: false, valueField: 'kdprodi', displayField: 'nmprodi', forceSelection: true, submitValue: true, hiddenName: 'h_prodi', listeners: {}, typeAhead: true, mode: 'local', emptyText:'Pilih...', selectOnFocus:true, allowBlank: false, //name: 'kdprodi', disabled: true }, { xtype: 'htmleditor', fieldLabel: 'Deskripsi', height:200, anchor:'99%', name: 'deskripsi', allowBlank: false }, { xtype: 'fileuploadfield', emptyText: 'Select an file to upload...', fieldLabel: 'File', width: 230, buttonText: 'Browse', name: 'file', id: 'file', validator: function() { var kurung = Ext.getCmp('file').getValue(); for (i=0;i String(str).length) return str; else { var iLen = String(str).length; return String(str).substring(iLen, iLen - n); } } function simpan_grid(namaForm) { var x3File = Right(Ext.getCmp('file').getValue(),3); var x4File = Right(Ext.getCmp('file').getValue(),4); var x3Cover = Right(Ext.getCmp('cover').getValue(),3); var x4Cover = Right(Ext.getCmp('cover').getValue(),4); var form_nya = Ext.getCmp(namaForm); if (x3File=="" || x4File=="" || x3File=="doc" || x4File=="docx" || x3File=="pdf" || x3File=="rar" || x3File=="zip" || x3File=="DOC" || x4File=="DOCX" || x3File=="PDF" || x3File=="RAR" || x3File=="ZIP") { if (x3Cover=="" || x4Cover=="" || x3Cover=="jpg" || x3Cover=="png" || x4Cover=="jpeg" || x3Cover=="JPG" || x3Cover=="PNG" || x4Cover=="JPEG") { form_nya.getForm().submit({ url: BASE_URL + 'e_library/c_jurnal/upload_save', method: 'POST', params:{ }, success: function(form_bp_general, o) { Ext.MessageBox.alert('Informasi', 'Upload Data Berhasil'); ds.load(); win.close(); }, failure: function() { Ext.MessageBox.alert("Informasi", "
Upload Data Gagal
Periksa Kembali Data Anda Atau File Gambar Anda Lebih Dari 800kb
"); } }); }else{ Ext.MessageBox.alert('Informasi', '
Upload Gambar Gagal
File Gambar Yang Di Izinkan (jpg|png|jpeg|JPG|PNG|JPEG)
'); } }else{ Ext.MessageBox.alert('Informasi', '
Upload Dokumen Gagal
File Dokumen Yang Di Izinkan (doc|docx|pdf|rar|zip|DOC|DOCX|PDF|RAR|ZIP)
'); } } function ubah_grid(namaForm) { var msgplus=''; var form_nya = Ext.getCmp(namaForm); var x3File = Right(Ext.getCmp('file').getValue(),3); var x4File = Right(Ext.getCmp('file').getValue(),4); var x3Cover = Right(Ext.getCmp('cover').getValue(),3); var x4Cover = Right(Ext.getCmp('cover').getValue(),4); if (x3File=="" || x4File=="" || x3File=="doc" || x4File=="docx" || x3File=="pdf" || x3File=="rar" || x3File=="zip" || x3File=="DOC" || x4File=="DOCX" || x3File=="PDF" || x3File=="RAR" || x3File=="ZIP") { if (x3Cover=="" || x4Cover=="" || x3Cover=="jpg" || x3Cover=="png" || x4Cover=="jpeg" || x3Cover=="JPG" || x3Cover=="PNG" || x4Cover=="JPEG") { Ext.MessageBox.show({ title: "Konfirmasi", width: 350, msg: msgplus +"
Anda Yakin Mengubah Data ini?
", buttons: Ext.MessageBox.YESNO, fn: function(btn) { if (btn == 'yes') { form_nya.getForm().submit({ url: BASE_URL + 'e_library/c_jurnal/upload_update', params:{ }, method: 'POST', success: function() { Ext.MessageBox.alert("Informasi", "Ubah Data Berhasil"); ds.load(); win.close(); }, failure: function() { Ext.MessageBox.alert("Informasi", "
Upload Data Gagal
Periksa Kembali Data Anda Atau File Gambar Anda Lebih Dari 800kb
"); } }); } } }); }else{ Ext.MessageBox.alert('Informasi', '
Upload Gambar Gagal
File Gambar Yang Di Izinkan (jpg|png|jpeg|JPG|PNG|JPEG)
'); } }else{ Ext.MessageBox.alert('Informasi', '
Upload Dokumen Gagal
File Dokumen Yang Di Izinkan (doc|docx|pdf|rar|zip|DOC|DOCX|PDF|RAR|ZIP)
'); } } }