var USERNAME=''; var L_MEMBER=''; var NM_KLP=''; var CLIENT=''; var waitmsgpub = Ext.MessageBox.wait('Proses mendapatkan data...', 'Info'); Ext.Ajax.request({ url:BASE_URL + 'c_tools/get_user', method:'POST', success: function(response){ var r = Ext.decode(response.responseText); if(r.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'; } }); } USERID = r.user_id; USERNAME = r.username; L_MEMBER = r.level_member; NM_KLP = r.nm_klp; CLIENT = r.client; if (!USERID) { window.location = BASE_URL + 'user/login'; } else { waitmsgpub.hide(); tab_center = new Ext.Panel({ xtype: 'container', region: 'center', layout: 'fit', id: 'centerRegion', split: true, autoEl: {}, items: [] }); menuTreeLoader = new Ext.tree.TreeLoader({ dataUrl: BASE_URL + 'c_mutama/getTree', baseParams: { id: "1", OTOR: USERID }, listeners: { 'load': function() { Ext.MessageBox.hide(); } } }); tree = new Ext.tree.TreePanel({ id: 'menu-tree', region: 'west', title: 'Menu', iconCls: 'silk-sitemap', split: true, width: 200, //height: 200, minSize: 175, maxSize: 400, collapsible: true, margins: '0 0 5 5', loader: menuTreeLoader, rootVisible: false, lines: false, autoScroll: true, root: new Ext.tree.AsyncTreeNode({ expanded: false }), listeners: { 'click': function(n) { //var sn=this.selModel.selNode||{}; var kd_menu; //,url; if (n.leaf) { kd_menu = n.attributes.kode; //url=n.attributes.url; //alert(kd_menu); control_page(kd_menu); } }, 'afterlayout': function() { // Ext.MessageBox.hide(); } } }); layout_main = new Ext.Viewport({ layout: 'border', renderTo: Ext.getBody(), defaults: { collapsible: true, split: true, frame: false, bodyStyle: 'padding: 0px 0px 0px 1px' }, items: [{ collapsible: false, region:'north', height:62, border:false, split:false, margins:'0 0 0 0', bodyStyle: 'padding:0px;background:#eee;font-family:"Lucida Grande";height: 62px;-moz-box-shadow:0px 0px 3px 1px rgba(0,0,0,0.3);-webkit-box-shadow:0px 0px 3px 1px rgba(0,0,0,0.3);box-shadow:0px 0px 3px 1px rgba(0,0,0,0.3);background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#2d9de3),color-stop(100%,#0c52a1));background-image:-webkit-linear-gradient(top,#2d9de3,#0c52a1);background-image:-moz-linear-gradient(top,#2d9de3,#0c52a1);background-image:-o-linear-gradient(top,#2d9de3,#0c52a1); background-image:linear-gradient(top,#2d9de3,#0c52a1);border-bottom:1px solid #136B7F', items:[new Ext.Toolbar({ height: 62, items: [ { xtype:'tbtext', //style: 'font-weight: bold;text-align: right;color: darkblue;', text: "", },'->', { //text: 'Dashboard', text: '
Dashboard
', id: 'st_dsh', iconCls: 'silk-dash', handler: function() { if (L_MEMBER=='4') { dashboard_rektor(); } else if(L_MEMBER=='2'){ dashboard_mhs(); } } }, '
|
', { text: 'Status Logout', id: 'sts_logout_id', iconCls: 'silk-user' }, '
|
', { text: 'Logout', id: 'id_pengguna_', handler: do_logout }], style: 'padding:0px;background:#eee;font-family:"Lucida Grande";height: 62px;-moz-box-shadow:0px 0px 3px 1px rgba(0,0,0,0.3);-webkit-box-shadow:0px 0px 3px 1px rgba(0,0,0,0.3);box-shadow:0px 0px 3px 1px rgba(0,0,0,0.3);background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#2d9de3),color-stop(100%,#0c52a1));background-image:-webkit-linear-gradient(top,#2d9de3,#0c52a1);background-image:-moz-linear-gradient(top,#2d9de3,#0c52a1);background-image:-o-linear-gradient(top,#2d9de3,#0c52a1); background-image:linear-gradient(top,#2d9de3,#0c52a1);border-bottom:1px solid #136B7F', })] }, tree,{ collapsible: false, region: 'center', layout: 'card', activeItem: 0, items:[tab_center]} ] }); layout_main.show(); Ext.getCmp("sts_logout_id").setText("Pengguna: " + "" + NM_KLP); Ext.getCmp("id_pengguna_").setText("Logout ("+""+USERNAME+""+ ")"); if (L_MEMBER=='4') { dashboard_rektor(); } else if(L_MEMBER=='2'){ dashboard_mhs(); } } } }); function do_logout() { Ext.Ajax.request({ url: BASE_URL + 'user/ext_logout', method: 'POST', success: function(xhr) { localStorage.removeItem('access_token'); window.location = BASE_URL + 'user/login'; } }); } function get_content(objek) { var centerRegion = Ext.getCmp("centerRegion"); centerRegion.removeAll(); centerRegion.add(objek); centerRegion.doLayout(); }