예제 #1
0
파일: Inbox.php 프로젝트: Gincusoft/aksi
 public function get_list()
 {
     if ($this->input->is_ajax_request() && $this->input->get()) {
         $data_post = $this->input->get();
         $search = $data_post['search'];
         $limit = $data_post['length'];
         $offset = $data_post['start'];
         $columns = $data_post['columns'];
         $order_arr = $data_post['order'];
         $order_direction = strtoupper($order_arr[0]['dir']);
         $order_column = $order_arr[0]['column'];
         $order_column = $columns[$order_column]['data'];
         $data = $this->inbox_model->get_list($search, $order_column, $order_direction, $limit, $offset);
         $json['data'] = array();
         $i = $offset + 1;
         $this->load->helper('text_helper');
         foreach ($data['rows'] as $row) {
             $inbox_id = encode($row->sms_sender);
             $row->no = $i++;
             $url_edit = base_url("messaging/inbox/detail/{$inbox_id}");
             $row->sms_sender = "<a class='text-black' onclick='doDetail(\"{$url_edit}\", this); return false;' href=''>{$row->sms_sender}</a>";
             $row->sms_text_short = word_limiter($row->sms_text, 5);
             $row->sms_text = "<a class='text-black' onclick='doDetail(\"{$url_edit}\", this); return false;'  href=''>" . word_limiter($row->sms_text, 15) . "</a>";
             $row->sms_date = timestamp_to_human($row->sms_date);
             $row->action = "<button title='Hapus' class='btn btn-xs btn-default' onclick='doDelete(\"{$inbox_id}\")'><i class='fa fa-remove'></i></button>";
             array_push($json['data'], $row);
         }
         $json['recordsTotal'] = $data['total'];
         $json['recordsFiltered'] = $data['total'];
         $json['draw'] = $data_post['draw'];
         echo json_encode($json);
     } else {
         echo '{^_^) Gincusoft.';
     }
 }
예제 #2
0
파일: Outbox.php 프로젝트: Gincusoft/aksi
 public function get_list()
 {
     if ($this->input->is_ajax_request() && $this->input->get()) {
         $data_post = $this->input->get();
         $search = $data_post['search'];
         $limit = $data_post['length'];
         $offset = $data_post['start'];
         $columns = $data_post['columns'];
         $order_arr = $data_post['order'];
         $order_direction = strtoupper($order_arr[0]['dir']);
         $order_column = $order_arr[0]['column'];
         $order_column = $columns[$order_column]['data'];
         $data = $this->outbox_model->get_list($search, $order_column, $order_direction, $limit, $offset);
         $json['data'] = array();
         $i = $offset + 1;
         $this->load->helper('text_helper');
         foreach ($data['rows'] as $row) {
             $outbox_id = encode($row->dest_no);
             $row->no = $i++;
             $url_edit = base_url("messaging/outbox/detail/{$outbox_id}");
             $row->dest_no = "<a class='text-black' onclick='doDetail(\"{$url_edit}\", this); return false;' href=''>{$row->dest_no}</a>";
             $row->sms_text_short = word_limiter($row->sms_text, 5);
             $row->sms_text = "<a class='text-black' onclick='doDetail(\"{$url_edit}\", this); return false;'  href=''>" . word_limiter($row->sms_text, 15) . "</a>";
             $row->sms_date = timestamp_to_human($row->sms_date);
             if (strripos($row->status, 'SendingOK') !== FALSE) {
                 $status = 'fa fa-check-circle';
                 $label = 'success';
             } else {
                 if (strripos($row->status, 'SendingError') !== FALSE) {
                     $status = 'fa fa-exclamation-circle';
                     $label = 'danger';
                 } else {
                     $status = 'fa fa-clock-o';
                     $label = 'default';
                 }
             }
             $row->status_label = "<span class='label label-{$label}' title='{$row->status}'><i class='{$status}'></i></span>";
             $row->sms_date = $row->status_label . ' &nbsp; ' . $row->sms_date;
             $row->action = "<button title='Hapus' class='btn btn-xs btn-default' onclick='doDelete(\"{$outbox_id}\")'><i class='fa fa-remove'></i></button>";
             array_push($json['data'], $row);
         }
         $json['recordsTotal'] = $data['total'];
         $json['recordsFiltered'] = $data['total'];
         $json['draw'] = $data_post['draw'];
         echo json_encode($json);
     } else {
         echo '{^_^) Gincusoft.';
     }
 }