Ejemplo n.º 1
0
 public function getTable($pkey = '')
 {
     _has_user_access_permission(TRUE, array('admin', 'location_manager', 'location_user'));
     $params = ($params = unserialize_object($pkey)) && is_array($params) ? $params : array();
     $note_type_id = isset($params[SYS_NOTE_TYPE_ID]) && gtzero_integer($params[SYS_NOTE_TYPE_ID]) ? (int) $params[SYS_NOTE_TYPE_ID] : 0;
     $ref_id = isset($params[SYS_REF_ID]) && gtzero_integer($params[SYS_REF_ID]) ? (int) $params[SYS_REF_ID] : 0;
     $params = array('iDisplayStart' => $this->input->post('iDisplayStart', true), 'iDisplayLength' => $this->input->post('iDisplayLength', true), 'iSortCol_0' => $this->input->post('iSortCol_0', true), 'iSortingCols' => $this->input->post('iSortingCols', true), 'sSearch' => $this->input->post('sSearch', true), 'sEcho' => $this->input->post('sEcho', true), 'note_type_id' => $note_type_id, 'ref_id' => $ref_id);
     $qrows = $this->notes_m->ajax_gets($params);
     foreach ($qrows['aaData'] as &$qrow) {
         $qrow = array($qrow['note_description'], $qrow['created_by_name'], local_time($qrow['created_on'], 'M d, Y'), theme_button_groups(array('view' => array('href' => site_url('notes/show/' . serialize_object(array(SYS_NOTE_ID => $qrow['ID']))), 'title' => 'Note Detail', 'text' => 'View Note', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Note Detail", "modal" : {"buttons" : false, "footer" : false}, "params" : "echo"}\'', 'class' => array()))));
     }
     echo json_encode($qrows);
 }
Ejemplo n.º 2
0
 public function getTable($pkey = '')
 {
     _has_user_access_permission(TRUE, array('admin', 'location_manager', 'user_company'));
     $params = ($params = unserialize_object($pkey)) && is_array($params) ? $params : array();
     $type_id = isset($params[SYS_CONTACT_TYPE_ID]) && gtzero_integer($params[SYS_CONTACT_TYPE_ID]) ? to_int($params[SYS_CONTACT_TYPE_ID]) : 0;
     $ref_id = isset($params[SYS_REF_ID]) && gtzero_integer($params[SYS_REF_ID]) ? to_int($params[SYS_REF_ID]) : 0;
     $params = array('iDisplayStart' => $this->input->post('iDisplayStart', true), 'iDisplayLength' => $this->input->post('iDisplayLength', true), 'iSortCol_0' => $this->input->post('iSortCol_0', true), 'iSortingCols' => $this->input->post('iSortingCols', true), 'sSearch' => $this->input->post('sSearch', true), 'sEcho' => $this->input->post('sEcho', true), 'type_id' => $type_id, 'ref_id' => $ref_id);
     $qrows = $this->contact_m->ajax_gets($params);
     foreach ($qrows['aaData'] as &$qrow) {
         $qrow = array($qrow->full_name, $qrow->email, $qrow->address, $qrow->phone, $qrow->mobile, to_int($qrow->is_default) == 1 ? 'Yes' : 'No', $qrow->created_by_name, local_time($qrow->created_on, 'M d, Y'), theme_button_groups(array('edit' => array('href' => site_url('contacts/edit/' . serialize_object(array(SYS_CONTACT_ID => $qrow->contact_id, SYS_REF_ID => $qrow->ref_id, SYS_CONTACT_TYPE_ID => $qrow->contact_type_id))), 'title' => 'Contact Detail <small>' . $qrow->full_name . '</small>', 'text' => 'Edit Contact', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Contact Detail (<small>' . $qrow->full_name . '</small>)", "modal" : {"buttons" : true, "override" : true, "modal_success_callback" : "gl.contact.listing.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "default"}}\'', 'class' => array()), 'delete' => array('href' => site_url('contacts/delete/' . serialize_object(array(SYS_CONTACT_ID => $qrow->contact_id, SYS_REF_ID => $qrow->ref_id, SYS_CONTACT_TYPE_ID => $qrow->contact_type_id))), 'title' => 'Delete Contact <small>' . $qrow->full_name . '</small>', 'text' => 'Delete Contact', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Contact (<small>' . $qrow->full_name . '</small>)", "modal" : {"buttons" : true, "override" : true, "modal_success_callback" : "gl.contact.listing.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "default"}}\'', 'class' => array()))));
     }
     echo json_encode($qrows);
 }