Langsung ke konten utama

Postingan

Menampilkan postingan dari 2014

ExtJS Grid custom colum

var sm = Ext.create('Ext.selection.CheckboxModel',{ mode : 'multi', showHeaderCheckbox: false, checkOnly:true, enableKeyNav : false, listeners: { select : function ( records, keepExisting, suppressEvent ) { } } }); var grid2 = Ext.create('Ext.grid.Panel', { store: storeContract1, hideHeaders : true, //autoScroll:true, selModel: sm, columns: [ { text: "", flex: 1, xtype: 'templatecolumn',tpl: new Ext.XTemplate( '<br /> <table style="width: 80%px;"><tbody> <tr><td>Contract #</td><td>{CONTRACTNUMBER}</td><td>Disconnect On</td><td><span class="datepicker"></span></td><td>DECODER</td><td><tpl for="DECODER"></tpl><br /> <div> - {.}</div> </td></tr> <tr><td colspan="6"> </td><td></td></tr> <tr...

Extjs html class render

Ext.select('.datepicker').each(function(el){ new Ext.form.DateField({ allowBlank : true, renderTo: el, format:'m-d-Y', editable:false, width:140, fieldCls : 'tanggal x-form-field x-form-text x-trigger-noedit', }); }); Ext.select('.note').each(function(el){ new Ext.form.field.TextArea({ allowBlank : false, renderTo: el, grow : true, hideLabel : true, fieldCls : 'pesan x-form-field x-form-text x-trigger-noedit', }); });

Menambahkan Item Id untuk HTML Attribut

{ border:false, frame:false, width: 225, margin: '5px 0px 10px 9px', items: [{ xtype : 'textfield', fieldLabel : 'Telephone', inputType :'password', id : 'telephone', inputId: 'item_telepon', width: 225, readOnly : true, fieldStyle :'background-image:none;background-color:#BDBDBD', },{ xtype : 'textfield', fieldLabel : 'Office no', inputType :'password', width: 225, id :'office_no', inputId: 'item_office_no', readOnly : true, fieldStyle :'background-image:none;background-color:#BDBDBD', },{ xtype : 'textfield', fieldLabel : 'Mobile no', inputType :'password', width: 225, id:'mobile_no', inputId: 'item_mobile_no', readOnly : true, fieldStyle :'back...

Render tips pada event render

render: function(p) { var theElem = p.getEl(); var theTip = Ext.create('Ext.tip.Tip', { html: 'Tuliskan Sequent Number atau Telephone Number atau Office Number atau Mobile Number atau Customer Number ', margin: '0 0 0 300', shadow: false }); p.getEl().on('mouseover', function(){ theTip.showAt(theElem.getX(), theElem.getY()); }); p.getEl().on('mouseleave', function(){ theTip.hide(); }); }

Form Layout individual margin

var header_form_des = new Ext.FormPanel({ url:'', layout:'column', width:400, border:true, frame:false, items: [{ border:false, margin: '5px 0px 0px 5px', items: [{ xtype : 'fieldcontainer', items: [{ xtype : 'label', width: 50, forId: 'batch_des', text: 'Batch #:', }] }] },{ border:false, margin: '5px 0px 0px 5px', items: [{ xtype : 'fieldcontainer', items: [{ xtype : 'textfield', width: 75, id : 'batch_des', name : 'batch_des', allowBlank : true, readOnly : true, fieldStyle :'background-image:none;background-color:#BDBDBD', }] }] },{ border:false, margin: '5px 0px 0px 5px', items: [{ xtype : 'fieldcontainer', items: [{ xt...

Call Multiple SP

function submit($data) { $vNotes = $data['vNotes']; $vCreated_By = $data['vCreated_By']; $records = $data['records']; $vScript_Id = $data['vScript_Id']; $vBatch_No = ''; $vBatch_Id = ''; try{ $success = true; // Header $sql1 = "CALL sp_Create_SMS_Batch(:vNotes,:vCreated_By,:vBatch_No,:vBatch_Id)"; $stmt1 = oci_parse($this->db->conn_id, $sql1); // Header Bind sql1 the input parameter oci_bind_by_name($stmt1,':vNotes',$vNotes); oci_bind_by_name($stmt1,':vCreated_By',$vCreated_By); // Header Bind sql1 the output parameter oci_bind_by_name($stmt1,':vBatch_No',$Batch_No,32); oci_bind_by_name($stmt1,':vBatch_Id',$vBatch_Id,32); // return sql1 $success = $success && @oci_execute($stmt1); ...

Call Single SP Codeigniter

function insert_out_call($data) { $vPromo_Id = $data['vPromo_Id']; $pCategory_Id = $data['pCategory_Id']; $pMesssage = $data['pMesssage']; $pCreated_By = $data['pCreated_By']; $vCall_Id = ''; try{ $sql = "CALL sp_Insert_Mncshop_Out_Call(:vPromo_Id,:pCategory_Id,:pMesssage,:pCreated_By,:vCall_Id)"; $stmt = oci_parse($this->db->conn_id, $sql); // Bind the input parameter oci_bind_by_name($stmt,':vPromo_Id',$vPromo_Id); oci_bind_by_name($stmt,':pCategory_Id',$pCategory_Id); oci_bind_by_name($stmt,':pMesssage',$pMesssage); oci_bind_by_name($stmt,':pCreated_By',$pCreated_By); // Bind the output parameter oci_bind_by_name($stmt,':vCall_Id',$vCall_Id); if(@!oci_execute($stmt)){ $err = oci_error($stmt); throw new Exceptio...

Fungsi sederhana pada oracle

CREATE OR REPLACE FUNCTION f_get_btp_status(vCustNbr varchar) return number as cnt number; v_Count NUMBER; v_count_rev number; begin select /*+ FIRST_ROWS(1)*/ count(0) INTO v_Count from btp_tbl a, indolive.prospect b, indolive.customer_tbl c where b.prospect_nbr = a.prospect_nbr and c.customer_id = b.ref_cust_id and c.customer_nbr=vCustNbr; select /*+ FIRST_ROWS(1)*/ count(0) INTO v_Count_rev from btp_reverse a, indolive.prospect b, indolive.customer_tbl c where b.prospect_nbr = a.prospect_nbr and c.customer_id = b.ref_cust_id and c.customer_nbr=vCustNbr and a.prospect_pnrk in ('TDK ADA DI PNRK','BELUM DITARIK'); if (v_Count = 0 or v_Count_rev= 1 ) THEN return 0; else select /*+ FIRST_ROWS(1)*/ count(0) INTO cnt from btp_tbl a, indolive.prospect b, indolive.customer_tbl c where b.prospect_nbr = a.prospect_nbr and c.customer_id = b.r...

Call procedure input param

$srv_req_id = $data['srv_req_id'] ; $employee_id = $data['employee_id']; $user_id = $data['user_id']; $result['status'] = TRUE; $result['message'] = 'Sukses assigned Ticket ke employee'; try{ $sql = "CALL SMS_SP_SPKTS_AssignedTo($srv_req_id,$employee_id,$user_id)"; $stmt = oci_parse($this->db->conn_id, $sql); if(@!oci_execute($stmt)){ $err = oci_error($stmt); throw new Exception($err['message']); } } catch (Exception $e) { $result['status'] = FALSE; $result['message'] = $e->getMessage(); } return $result;

Mengambil output cursor dan param oracle dari PHP

$conn = @oci_connect("username", "password", "192.168.177.34/labora") or die; //$sql = 'BEGIN sayHello(:name, :message); END;'; $sql ='BEGIN mnc_subscribe.SMS_S_V_SEARCH_CUSTOMER_2(:IVDGT,:NELWAN,:a,:b,:c,:pPageNo,:d,:pTotalPage,:csrCustomer); END;'; $stmt = oci_parse($conn,$sql); $csrCustomer = oci_new_cursor($conn); // Assign a value to the input $IVDGT = 'IVDGT'; $NELWAN = 'NELWAN'; $pPageNo = 5; $a = ''; $b = ''; $c = ''; $d = 10; $pTotalPage=0; // Bind the input parameter oci_bind_by_name($stmt,':IVDGT',$IVDGT,32); oci_bind_by_name($stmt,':NELWAN',$NELWAN,32); oci_bind_by_name($stmt,':pPageNo',$pPageNo,32); oci_bind_by_name($stmt,':a',$a,32); oci_bind_by_name($stmt,':b',$b,32); oci_bind_by_name($stmt,':c',$c,32); oci_bind_by_name($stmt,':d',$d,32); // Bind the output parameter oci_bind_by_name($stmt,...

Twitter API dengan codeigniter

Twitter.php lokasi file application\controllers : '; $this->load->view('v_twitter',$data); } public function redirect() { /* Set Parameter */ $params = array('consumer_key' => 'API Key', 'consumer_secret' => 'API Secret', 'oauth_token' => NULL, 'oauth_token_secret' => NULL ); /* Load Twitter Oauth Library */ $this->load->library('twitteroauth',$params); /* Build TwitterOAuth object with client credentials. */ $connection = $this->twitteroauth; /* Get temporary credentials. */ $request_token = $connection->getRequestToken(base_url('twitter/callback')); /* Save temporary credentials to session. */ $oauthdata = array( 'oauth_token' => $request_token['oauth_token'], 'oauth_token_secret' => $r...

Setting custum sql pada smsdrc

[gammu] model = dummy connection = none device = C:\gammu\bin #device = com35: #model = AT #connection = at115200 #name = Master Vidya 1 [smsd] Service = sql Driver = native_mysql PIN = 1234 logfile = C:\gammu\bin\smsdlog debuglevel = 2 phoneid = 82394279111 commtimeout = 5 sendtimeout = 30 maxreties = 5 deliveryreport = no checksecurity = 0 statusfrequency = 30 receivefrequency = 0 hardresetfrequency = 3600 resetfrequency = 600 loopsleep =0 user = gammu password = gammu pc = localhost database = kalkun [sql] delete_phone = DELETE FROM phones WHERE ID = %P update_received = UPDATE phones SET Received = Received + 1 WHERE ID = %P update_sent = UPDATE phones SET Sent= Sent + 1 WHERE ID = %P refresh_phone_status = UPDATE phones SET `TimeOut`= (NOW() + INTERVAL 10 SECOND) + 0,`Battery` = %1, `Signal` = %2 WHERE `ID` = %P

Setting multiple modem pada gammurc

[gammu] model = dummy connection = none device = C:\gammu\bin ;model = AT ;connection =at115200 ;name = Master Vidya 1 ;device = com35: [gammu1] model = dummy connection = none device = C:\gammu\bin\sms ;model = AT ;connection =at115200 ;name = Master Vidya 2 ;device = com36: [gammu2] model = dummy connection = none device = C:\gammu\bin\fs ;model = AT ;connection =at115200 ;name = Master Vidya 3 ;device = com37: [gammu3] model = dummy connection = none device = C:\gammu\bin\note ;model = AT ;connection =at115200 ;name = Master Vidya 4 ;device = com38:

Menghilangkan index.php pada codeigniter dengan file htaccess

RewriteEngine On RewriteBase /nama_folder_pada_document_root/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /nama_folder_pada_document_root/index.php/$1 [L] buat file bernama .htaccess dan letakkan di nama_folder_pada_document_root , setelah itu silahkan di restart apache webservernya

Form post submit tanpa ajax request

if(form_berkas.getForm().isValid()){ form_berkas.getForm().submit({ method:'POST', waitTitle:'Connecting', waitMsg:'Sending data...', success:function(form, action){ obj = Ext.JSON.decode(action.response.responseText); Ext.Msg.alert('Information!', obj.errors); dialog_berkas.close(); }, failure:function(form, action){ if(action.failureType == 'server') { obj = Ext.JSON.decode(action.response.responseText); Ext.Msg.alert('Information!', obj.errors); }else { Ext.Msg.alert('Warning!', 'Authentication server is unreachable : ' + action.response.responseText); } } }); }

Menambahkan data pada combo box store

cb = Ext.getCmp('template_sms_tab_back'); cb.store.add( { val:"Productivity Anda masih dibawah "+ productivity +" Masih harus kerja lebih keras!" ,name : "Poor"},{val:"Productivity Anda baru "+ productivity +" Terus tingkatkan angka penjualan!",name : "Achive"},{val:"Productivity Anda sudah lebih "+ productivity +" Awal yang baik, pertahankan kinerja.",name :"Excelent"} );

Fix bugs banyak ajax request pada tree store

// fix bugs to many ajax request Ext.override(Ext.data.TreeStore, { load: function(options) { options = options || {}; options.params = options.params || {}; var me = this, node = options.node || me.tree.getRootNode(), root; // If there is not a node it means the user hasnt defined a rootnode yet. In this case lets just // create one for them. if (!node) { node = me.setRootNode({ expanded: true }); } if (me.clearOnLoad) { node.removeAll(false); } Ext.applyIf(options, { node: node }); options.params[me.nodeParam] = node ? node.getId() : 'root'; if (node) { node.set('loading', true); } return me.callParent([options]); } });

Render Tips pada grid column

Pemakaian Iframe pada Extjs

listeners : { itemcontextmenu : function( grid, record, item, index, event){ event.stopEvent(); var menu = Ext.create('Ext.menu.Menu',{ items: [{ text: 'Export to XLS', iconCls: 'export', disabled : false, handler: function() { var tgl = Ext.getCmp('tgl').rawValue, branch = Ext.getCmp('branch_id').getValue(); status = Ext.getCmp('status').getValue(); Ext.getBody().mask('Creating File, please wait...', 'x-mask-loading'); Ext.getBody().createChild({ tag: 'iframe', cls: 'x-hidden', onload: 'Ext.getBody().unmask(); var t = Ext.get(this); ', src: ' services/sms_monitoring_installasi/export?tgl='+tgl+'&branch='+branch+'&status='+status, }); } }] }); menu.showAt(event.xy); } },

Item context menu pada Extjs

Item context menu var historyView_inbox_back = Ext.create('Ext.grid.Panel', { width:875, height:275, store:log_history_inbox, margin:'0 0 0 0', viewConfig: { emptyText: 'No Data' }, listeners : { itemcontextmenu : function( grid, record, item, index, event){ event.stopEvent(); var menu = Ext.create('Ext.menu.Menu',{ items: [{ text: 'Reply SMS', iconCls: 'sms', disabled : false, handler: function() { var phone_number = Ext.getCmp('phone_number').setValue(record.data['SenderNumber']); dialog_send_sms.show(); } }] }); menu.showAt(event.xy); } }, columns: [{ name:'ReceivingDateTime', header:'ReceivingDateTime', dataIndex:'ReceivingDateTime', width:125, },{ name:'SenderNumber', header:'...

Codeigniter Database Oracle Session

object =& get_instance(); // set config variables $this->object->load->database(); $this->_lifetime = $this->object->config->item('sess_expiration'); $this->_sess_id_ttl = $this->object->config->item('sess_time_to_update'); $this->_match_ip = $this->object->config->item('sess_match_ip'); $this->_match_useragent = $this->object->config->item('sess_match_useragent'); $this->_useDB = $this->object->config->item('sess_use_database'); $this->_sess_table = $this->object->config->item('sess_table_name'); log_message('debug', "Session Class Initialized"); $this->_sess_run(); } /** * Starts up the session system for current request */ function _sess_run() { // Set session table and register this object as the session handler, if using databases if ($this->_useDB == TRUE) { ...

Konfigurasi Multiple Database CodeIgniter

$active_group = 'default'; $active_record = TRUE; /* KONFIGURASI DATABASE SERVER ORACLE*/ $ocihost = '192.168.177.103'; $ocitns = 'tnsoracle'; $ocischema = 'bW5jX3N1YnNjcmliZQ=='; $ocipassword = 'MTIzNDU2'; $db['default']['hostname'] = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST='.$ocihost.')(PORT=1521))'; $db['default']['hostname'] .='(CONNECT_DATA=(SERVICE_NAME = '.$ocitns.')))'; $db['default']['username'] = $ocischema; $db['default']['password'] = $ocipassword; $db['default']['database'] = ''; $db['default']['dbdriver'] = 'oci8'; $db['default']['autoinit'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['pconnect'] = FALSE; /* KONFIGURASI DATABASE MYSQL */ $db['gammu']['hostname'] = "192.168.177.183...