From ee237c3c2e0c7853b744e0f74c674b8109c33f05 Mon Sep 17 00:00:00 2001 From: RamkrishnaMondal Date: Thu, 28 Apr 2016 13:22:01 +0530 Subject: [PATCH] Fourth commit --- application/config/database.php.tmpl | 6 ++--- application/controllers/Config.php | 3 ++- application/controllers/Messages.php | 16 +++---------- application/language/en/config_lang.php | 1 + application/libraries/Sms.php | 23 +++++++++++++----- application/views/configs/message_config.php | 25 +++++++++++--------- application/views/messages/sms-sender.php | 6 ++--- database/database.sql | 7 +++--- database/tables.sql | 7 +++--- 9 files changed, 51 insertions(+), 43 deletions(-) diff --git a/application/config/database.php.tmpl b/application/config/database.php.tmpl index 9f1cf6c2e..92454285a 100644 --- a/application/config/database.php.tmpl +++ b/application/config/database.php.tmpl @@ -76,9 +76,9 @@ $query_builder = TRUE; $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', - 'username' => '', - 'password' => '', - 'database' => '', + 'username' => 'root', + 'password' => 'ankit2015', + 'database' => 'tm4', 'dbdriver' => 'mysqli', 'dbprefix' => 'ospos_', 'pconnect' => FALSE, diff --git a/application/controllers/Config.php b/application/controllers/Config.php index 09646daa6..e5f47f2e5 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -102,7 +102,8 @@ class Config extends Secure_area $batch_save_data = array( 'msg_msg'=>$this->input->post('msg_msg'), 'msg_uid'=>$this->input->post('msg_uid'), - 'msg_pwd'=>$this->input->post('msg_pwd') + 'msg_pwd'=>$this->input->post('msg_pwd'), + 'msg_src'=>$this->input->post('msg_src') ); diff --git a/application/controllers/Messages.php b/application/controllers/Messages.php index 425737482..f781dad29 100644 --- a/application/controllers/Messages.php +++ b/application/controllers/Messages.php @@ -19,7 +19,7 @@ class Messages extends Secure_area function view($person_id=-1) { $data['person_info']=$this->Person->get_info($person_id); - $this->load->view('messages/sms-sender',$data); + $this->load->view('messages/sms-sender', $data); } @@ -27,21 +27,11 @@ class Messages extends Secure_area { $uid = $this->config->item('msg_uid'); $pwd = $this->config->item('msg_pwd'); + $src = $this->config->item('msg_src'); $phone = $this->input->post('phone'); $msg = $this->input->post('msg'); - - $response = $this->sms->sendsms($uid,$pwd,$phone,$msg); + $response = $this->sms->sendsms($uid, $pwd, $src, $phone, $msg); $this->load->view('messages/sms'); - - if('send') - { - echo "Message Submitted Successfully"; - } - else - { - echo "Message NOT Submitted Successfully"; - } - } } ?> diff --git a/application/language/en/config_lang.php b/application/language/en/config_lang.php index 0b984c797..490b44fb4 100644 --- a/application/language/en/config_lang.php +++ b/application/language/en/config_lang.php @@ -98,6 +98,7 @@ $lang["config_message_configuration"] = "Message Configuration"; $lang["config_msg_msg"] = "Saved Text Message:"; $lang["config_msg_uid"] = "SMS-API UserName:"; $lang["config_msg_pwd"] = "SMS-API Password:"; +$lang["config_msg_src"] = "SMS-API Sender ID:"; $lang["config_number_format"] = "Number Format"; $lang["config_phone"] = "Company Phone"; $lang["config_phone_required"] = "Company phone is a required field"; diff --git a/application/libraries/Sms.php b/application/libraries/Sms.php index 26cceae7d..23ee0476b 100644 --- a/application/libraries/Sms.php +++ b/application/libraries/Sms.php @@ -1,12 +1,23 @@ diff --git a/application/views/configs/message_config.php b/application/views/configs/message_config.php index 3aa9a89cb..c186aee75 100755 --- a/application/views/configs/message_config.php +++ b/application/views/configs/message_config.php @@ -1,8 +1,8 @@ 'message_config_form', 'enctype'=>'multipart/form-data', 'class'=>'form-horizontal')); ?>
-
+
-
Note : If you wish to use SMS template, save your message here. Otherwise keep the 'Saved Text Message' box blank.
+
Note : If you wish to use SMS template, save your message here. Otherwise keep the 'Saved Text Message' box blank.


@@ -18,14 +18,7 @@ 'class'=>'form-control input-sm', 'value'=>$this->config->item('msg_msg')));?>
- - - - - - -
@@ -35,7 +28,7 @@ 'name'=>'msg_uid', 'id'=>'msg_uid', 'class'=>'form-control input-sm', - 'type'=>'password', + 'type'=>'text', 'value'=>$this->config->item('msg_uid')));?>
@@ -50,8 +43,18 @@ 'type'=>'password', 'value'=>$this->config->item('msg_pwd')));?> + - +
+ lang->line('config_msg_src'), 'msg_src', array('class'=>'control-label col-xs-2')); ?> +
+ 'msg_src', + 'id'=>'msg_src', + 'class'=>'form-control input-sm', + 'type'=>'text', + 'value'=>$this->config->item('msg_src')));?> +
'submit_form', diff --git a/application/views/messages/sms-sender.php b/application/views/messages/sms-sender.php index ab7246b05..4e7400374 100755 --- a/application/views/messages/sms-sender.php +++ b/application/views/messages/sms-sender.php @@ -5,19 +5,19 @@
- 'form-control', 'type'=>'text','name'=>'first_name', 'value'=>$person_info->first_name));?> + 'form-control', 'type'=>'text','name'=>'first_name', 'readonly'=>'true', 'value'=>$person_info->first_name));?>
- 'form-control', 'type'=>'text','name'=>'last_name', 'value'=>$person_info->last_name));?> + 'form-control', 'type'=>'text','name'=>'last_name', 'readonly'=>'true', 'value'=>$person_info->last_name));?>
- 'form-control', 'type'=>'text','name'=>'phone', 'value'=>$person_info->phone_number));?> + 'form-control', 'type'=>'text','name'=>'phone', 'readonly'=>'true', 'value'=>$person_info->phone_number));?>
diff --git a/database/database.sql b/database/database.sql index 91a486795..b6ce81534 100644 --- a/database/database.sql +++ b/database/database.sql @@ -65,9 +65,10 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('currency_decimals', '2'), ('tax_decimals', '2'), ('quantity_decimals', '0'), -('msg_msg',''), -('msg_uid', 'userName'), -('msg_pwd', 'password'); +('msg_msg', ''), +('msg_uid', ''), +('msg_src', ''), +('msg_pwd', ''); -- -------------------------------------------------------- diff --git a/database/tables.sql b/database/tables.sql index 56871e0ab..8de566d84 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -65,9 +65,10 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('currency_decimals', '2'), ('tax_decimals', '2'), ('quantity_decimals', '0'), -('msg_msg',''), -('msg_uid', 'userName'), -('msg_pwd', 'password'); +('msg_msg', ''), +('msg_uid', ''), +('msg_src', ''), +('msg_pwd', ''); -- --------------------------------------------------------