Beispiel #1
0
 public function list_approve($type = false)
 {
     $search = '';
     $txt = $this->input->post('text');
     if ($txt) {
         $txt = str_replace(' ', '', trim($this->input->post('text')));
         $search = " and CONCAT(t3.pat_name,t3.pat_lname)  like '%{$txt}%'  ";
         // var_dump($this->input->post('text'));die();
     }
     $search_date = $this->search_date();
     if ($type == false) {
         $check_status = "กำลังจัดทำอุปกรณ์ กรอกข้อมูลแล้ว";
         ##แล้วยืนยันการจัดทำอุปกรณื
     } elseif ($type == 'before') {
         $check_status = "ตรวจก่อนทำสวยงามแล้ว";
     } elseif ($type == 'after') {
         $check_status = "ประเมิณหลังทำสวยงามแล้ว";
     }
     /*         * pagination */
     $this->per_page = 20;
     $row = $this->general_model->QueryAll("\n            select * from order_tools t1 \n            inner join check_pat t2 on t1.check_id = t2.check_id\n            inner join patients t3 on t3.pat_id = t2.pat_id \n            where \n            t1.tech_id={$this->user_id} \n            and t2.check_status = '{$check_status}'\n            {$search} {$search_date}\n            group by t2.check_id\n            order by t2.date\n            ", 'count');
     $url = base_url() . 'admin/list_doctors/';
     parent::pagination($page, $url, count($row), $this->per_page, 3);
     $list = $this->general_model->QueryAll("\n         select * from order_tools t1 \n         inner join check_pat t2 on t1.check_id = t2.check_id\n         inner join patients t3 on t3.pat_id = t2.pat_id \n         where \n         t1.tech_id={$this->user_id} \n         and t2.check_status = '{$check_status}'\n         {$search} {$search_date}\n         group by t2.check_id\n         order by t2.date\n         limit {$this->start_no}, {$this->per_page} \n         ");
     /*         * pagination */
     foreach ($list as $key => $value) {
         $data['list'][] = array('check_id' => $value['check_id'], 'doc_id' => $value['doc_id'], 'name' => $value['pat_name'] . "  " . $value['pat_lname']);
     }
     $data['type_topic'] = "ยืนยันหลังการตรวจ";
     $view = 'core_' . $this->usertype . '_view';
     parent::core_tech_view('tech/list_approve', $data);
 }