load->model('Test_Model'); $data['sdata'] = $this->Test_Model->name_list(); $this->load->view('home/dashboard'); // just the header file $this->load->view('namelist',$data); $this->load->view('home/master_assets'); $this->load->view('home/footer'); // just the header file } public function addnew() { // $this->load->library('form_validation'); $this->form_validation->set_rules('slot_name', 'Slot Name', 'trim|required|min_length[2]|max_length[100]|xss_clean'); if ($this->form_validation->run() == FALSE) { redirect("master_ethnicity"); } else{ $this->load->model('Test_Model'); $this->Test_Model->save_name($_POST); $this->load->library('session'); $this->session->set_flashdata('added','The name is successfully updated'); redirect("master_ethnicity"); } } public function deleteName() { $id = $_GET['id']; $this->load->model('Test_Model'); $this->Test_Model->delete_name($id); $this->load->library('session'); $this->session->set_flashdata('deleted','The name is successfully updated'); redirect("master_ethnicity"); } public function editName(){ //var_dump($_POST); if(isset($_POST) && $_POST['submit']=='editSlot'){ // echo 7; $id = $_GET['id']; $this->load->model('Test_Model'); $this->Test_Model->edit_name($_POST,$id); $this->load->library('session'); $this->session->set_flashdata('edited','The name is successfully updated'); redirect("master_ethnicity"); } $rwid=$_GET['id']; $data['id'] = $_GET['id']; $this->load->model('Test_Model'); $fldval = $this->Test_Model->getWherevalue($rwid); $data['value'] = $fldval[0]->name; $this->load->view('home/dashboard'); $this->load->view('home/master_assets'); // just the header file $this->load->view('editname',$data); $this->load->view('home/footer'); // just the header file } public function duplicateCheck() { $this->load->model('Test_Model'); $res = $this->Test_Model->duplicate_entry($_POST); echo $res; } public function statusChange(){ $this->load->model('Test_Model'); $res = $this->Test_Model->status_change($_POST); echo $res; } public function getList() { $this->load->model('Test_Model'); $requestData = $_REQUEST; $start = $requestData['start']; $limit = $requestData['length']; $orderColumn=$requestData['order'][0]['column']; $orderType=$requestData['order'][0]['dir']; $search = $this->input->post('search')['value']; if (!empty($search)) { $data['name'] = $this->Test_Model->getNameByLimitBySearch($limit, $start, $search,$orderColumn, $orderType); } else { $data['name'] = $this->Test_Model->getNameByLimit($limit, $start, $orderColumn, $orderType); } $listCount = sizeof($data['name']); foreach ($data['name'] as $data) { static $slno = 1; $statusChk = ''; if($data->status == "0"){ $statusChk = ''; }else{ $statusChk = 'checked'; } $options1 = '' . lang('edit') .' '; $options2 = ' ' . lang('delete') .''; $switch = '
'; $info[] = array( $slno, $data->name, $switch, $options1 . ' ' . $options2 ); $slno++; } if ($listCount > 0) { $output = array( "draw" => intval($requestData['draw']), "recordsTotal" => $listCount, "recordsFiltered" => $listCount, "data" => $info ); } else { $output = array( // "draw" => 1, "recordsTotal" => 0, "recordsFiltered" => 0, "data" => [] ); } echo json_encode($output); } } /* End of file accountant.php */ /* Location: ./application/modules/accountant/controllers/accountant.php */