Langsung ke konten utama

Postingan

Menampilkan postingan dari Februari, 2014

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...