diff --git a/application/config/autoload.php b/application/config/autoload.php index 114114780..1da59fcb7 100644 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -58,7 +58,7 @@ $autoload['packages'] = array(); | | $autoload['libraries'] = array('user_agent' => 'ua'); */ -$autoload['libraries'] = array('database', 'form_validation', 'session', 'user_agent', 'pagination'); +$autoload['libraries'] = array('database', 'form_validation', 'session', 'user_agent', 'pagination', 'sms'); /* | ------------------------------------------------------------------- diff --git a/application/controllers/Config.php b/application/controllers/Config.php index f874233ed..09646daa6 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -97,6 +97,21 @@ class Config extends Secure_area echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } + function save_message() + { + $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') + + ); + + $result = $this->Appconfig->batch_save($batch_save_data); + $success = $result ? true : false; + + echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); + } + function stock_locations() { $stock_locations = $this->Stock_location->get_all()->result_array(); diff --git a/application/controllers/Messages.php b/application/controllers/Messages.php new file mode 100644 index 000000000..425737482 --- /dev/null +++ b/application/controllers/Messages.php @@ -0,0 +1,47 @@ +get_controller_name(); + $this->load->view('messages/sms'); + + } + + + function view($person_id=-1) + { + $data['person_info']=$this->Person->get_info($person_id); + $this->load->view('messages/sms-sender',$data); + } + + + function send() + { + $uid = $this->config->item('msg_uid'); + $pwd = $this->config->item('msg_pwd'); + $phone = $this->input->post('phone'); + $msg = $this->input->post('msg'); + + $response = $this->sms->sendsms($uid,$pwd,$phone,$msg); + $this->load->view('messages/sms'); + + if('send') + { + echo "Message Submitted Successfully"; + } + else + { + echo "Message NOT Submitted Successfully"; + } + + } +} +?> diff --git a/application/helpers/table_helper.php b/application/helpers/table_helper.php index 8511d4b58..663683ad2 100644 --- a/application/helpers/table_helper.php +++ b/application/helpers/table_helper.php @@ -6,26 +6,17 @@ function get_sales_manage_table($sales, $controller) $table='
| '.to_currency( $sale['amount_tendered'] ).' | '; $table_data_row.=''.to_currency( $sale['amount_due'] ).' | '; $table_data_row.=''.to_currency( $sale['change_due'] ).' | '; - if($CI->config->item('invoice_enable') == TRUE) - { - $table_data_row.=''.$sale['payment_type'].' | '; - $table_data_row.=''.$sale['invoice_number'].' | '; - } - else - { - // this size includes the 8% of invoice number and 5% of the invoice gliphicon, pluf of course the 12% for the field itself - $table_data_row.=''.$sale['payment_type'].' | '; - } + $table_data_row.=''.$sale['payment_type'].' | '; + $table_data_row.=''.$sale['invoice_number'].' | '; $table_data_row.=''.anchor($controller_name."/edit/" . $sale['sale_id'], '', array('class'=>'modal-dlg modal-btn-delete modal-btn-submit print_hide', 'title'=>$CI->lang->line($controller_name.'_update'))).' | '; $table_data_row.=''.anchor($controller_name."/receipt/" . $sale['sale_id'], '', array('class'=>'print_hide', 'title'=>$CI->lang->line('sales_show_receipt'))).' | '; - if($CI->config->item('invoice_enable') == TRUE) - { - $table_data_row.=''.anchor($controller_name."/invoice/" . $sale['sale_id'], '', array('class'=>'print_hide', 'title'=>$CI->lang->line('sales_show_invoice'))).' | '; - } + $table_data_row.=''.anchor($controller_name."/invoice/" . $sale['sale_id'], '', array('class'=>'print_hide', 'title'=>$CI->lang->line('sales_show_invoice'))).' | '; $table_data_row.='
| '.character_limiter($person->first_name,13).' | '; $table_data_row.=''.mailto($person->email,character_limiter($person->email,22)).' | '; $table_data_row.=''.character_limiter($person->phone_number,13).' | '; + $table_data_row.=''.anchor('Messages'."/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_send_msg'))).' | '; $table_data_row.=''.anchor($controller_name."/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))).' | '; $table_data_row.='|||||||
| '.character_limiter($supplier->first_name,13).' | '; $table_data_row.=''.mailto($supplier->email,character_limiter($supplier->email,22)).' | '; $table_data_row.=''.character_limiter($supplier->phone_number,13).' | '; + $table_data_row.=''.anchor('Messages'."/view/$supplier->person_id", '', array('class'=>'modal-dlg modal-btn-submit' , 'title'=>$CI->lang->line('messages_send_msg'))).' | '; $table_data_row.=''.character_limiter($supplier->person_id,5).' | '; $table_data_row.=''.anchor($controller_name."/view/$supplier->person_id", '', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).' | '; $table_data_row.='