load->model('Formbuilder_model'); } function index() { $this->load->view('home/dashboard'); // just the header file $this->load->view('namelist'); $this->load->view('home/footer'); // just the header file } function getFromData(){ $formid=$this->input->get('formid'); $output=$this->Formbuilder_model->getFormData($formid); print_r($output); } function Delete(){ $id = $_GET['id']; $this->Formbuilder_model->delete($id); $this->session->set_flashdata('deleted','The template is successfully updated'); redirect("formbuilder"); } public function getList() { $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->Formbuilder_model->getNameByLimitBySearch($limit, $start, $search,$orderColumn, $orderType); } else { $data['name'] = $this->Formbuilder_model->getNameByLimit($limit, $start, $orderColumn, $orderType); } $listCount = sizeof($data['name']); foreach ($data['name'] as $data) { static $slno = 1; //$options1 = '' . lang('Edit') .' '; $options1 = '' . lang('Edit') .' '; $options2 = '' . lang('Preview') .' '; $options3 = '' . lang('Delete') .' '; $hiddenData='
'; $info[] = array( $slno, $data->form_name, //$switch, $options1.' '.$options2.' '.$options3.' '.$hiddenData, ); $slno++; } $csrf_name = $this->security->get_csrf_token_name(); $csrf_hash = $this->security->get_csrf_hash(); if ($listCount > 0) { $output = array( "draw" => intval($requestData['draw']), "recordsTotal" => $this->Formbuilder_model->total_list(), "recordsFiltered" => $listCount, "data" => $info ); } else { $output = array( // "draw" => 1, "recordsTotal" => 0, "recordsFiltered" => 0, "data" => [] ); $output[$csrf_name] = $csrf_hash; } echo json_encode($output); } } /* End of file accountant.php */ /* Location: ./application/modules/accountant/controllers/accountant.php */