?
Current Path : /home1/savoy/public_html/savoyglobal.net/rms/application/controllers/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/rms/application/controllers/customer.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Customer extends MY_Controller { public function __construct() { parent::__construct(); $this->load->model('customermodel'); $this->load->model('mastermodel'); } function viewincustomersearch($modelfunction='',$page,$pagenum) { $output=$this->customermodel->$modelfunction($pagenum); $data['viewinfo']=$output['results']; $this->load->view('customer/'.$page.'',$data); } function get_post_values() { $data = array(); foreach ($_POST as $key => $value) { if($key != "submit") { $data[$key] = $this->input->post($key); } } return $data; } function addincustomer($modelfunction,$page) { $postdata=$this->get_post_values(); $data=$this->customermodel->$modelfunction($postdata); $data['msg']=$data['msg']; if($data['res']==1) { $this->viewincustomersearch($data['resfunction'],$page,$_SESSION['pagenum']); $this->load->view('message',$data); } else { $this->viewincustomersearch($data['resfunction'],$page,$_SESSION['pagenum']); $this->load->view('message',$data); } } function edit_page($id,$table,$field,$page) { if($_SESSION['current_mode']!="") { $perm=$this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'],1); } else { $perm=1; } if(!$perm) { $data['msg']="Permission Denied"; $this->load->view('message',$data); } else { $data['viewinfo']=$this->mastermodel->get_data_srow($table,$id,$field); $data['id']=$id; $this->load->view('customer/'.$page,$data); } } function single_page($id,$table,$field,$page,$alert_id='') { if($_SESSION['current_mode']!="") { $perm=$this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'],0); } else { $perm=1; } if(!$perm) { $data['msg']="Permission Denied"; $this->load->view('message',$data); } else { $data['viewinfo']=$this->mastermodel->get_data_srow($table,$id,$field); $data['id']=$id; $data['alert_id']=$alert_id; $this->load->view('customer/'.$page,$data); } } function edit_customer($id,$table,$field,$page) { if($_SESSION['current_mode']!="") { $perm=$this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'],1); } else { $perm=1; } if(!$perm) { $data['msg']="Permission Denied"; $this->load->view('message',$data); } else { $data['viewinfo']=$this->mastermodel->get_data_srow($table,$id,$field); $data['corporate']=$this->mastermodel->get_data_srow('customer_corporate',$id,$field); $data['corporate_details']=$this->mastermodel->get_data('customer_corporate_contacts',$id,$field); $data['personal']=$this->mastermodel->get_data_srow('customer_personal',$id,$field); $data['id']=$id; $this->load->view('customer/'.$page,$data); } } function get_customer_no($customer_type) { echo $this->customermodel->get_customer_no($customer_type); } }