"", 'thead_open' => '', 'thead_close' => '', 'heading_row_start' => '', 'heading_row_end' => '', 'heading_cell_start' => '', 'tbody_open' => '', 'tbody_close' => '', 'row_start' => '', 'row_end' => '', 'cell_start' => '', 'row_alt_start' => '', 'row_alt_end' => '', 'cell_alt_start' => '', 'table_close' => '
', 'heading_cell_end' => '
', 'cell_end' => '
', 'cell_alt_end' => '
' ); public $data = array(); function __construct() { parent::__construct(); $out = array(); $in = array(); $ret = $this->medtrans_call_api(MEDTRANS_TRANSP_VERIFYSESSION, $in, $out); // print_r($out); if (!isset($_SESSION['agent_sessionid']) or $_SESSION['agent_sessionid'] == '' or $out['internal_return'] != 505 ) { redirect('site'); } } // protected protected function indexPageReal($data) { $data['do_not_script'] = false; $data['pageNumber'] = $this->input->get('pageNumber'); if ($data['pageNumber']=='' || $data['pageNumber']<1) $data['pageNumber'] = 1; $in['agent_id'] = $_SESSION['agent_id']; $in['limit'] = 30; $in["transport_id"] = 0; $in['action'] = MEDTRANS_USER_GET_TRANSLIST; $out = array(); $ret = $this->medtrans_call_api(MEDTRANS_TRANSP_GET_TRANSLIST, $in, $out); $data['result_per_page'] = 10; $data['result_total'] = count($out['result_list']); $data['result_list'] = $out['result_list']; $pages = ceil(1.0*$data['result_total']/$data['result_per_page']); if ($data['pageNumber']>$pages) $data['pageNumber'] = 1; $offset = $data['result_per_page'] * ($data['pageNumber'] - 1); $data['result_list'] = array_slice($out['result_list'],$offset,$data['result_per_page']); return $data; } protected function returnAdminTable($tbq, $pgLink) { $this->load->library('pagination'); $config = array(); $query = $this->db->query($tbq['count_query']); $config["total_rows"] = $query->num_rows(); $config["base_url"] = base_url() . $pgLink; $config["per_page"] = 5; $config["uri_segment"] = 3; $config["num_links"] = 5; $config['full_tag_open'] = ""; $config['num_tag_open'] = '
  • '; $config['num_tag_close'] = '
  • '; $config['cur_tag_open'] = "
  • "; $config['cur_tag_close'] = "
  • "; $config['next_tag_open'] = "
  • "; $config['next_tagl_close'] = "
  • "; $config['prev_tag_open'] = "
  • "; $config['prev_tagl_close'] = "
  • "; $config['first_tag_open'] = "
  • "; $config['first_tagl_close'] = "
  • "; $config['last_tag_open'] = "
  • "; $config['last_tagl_close'] = "
  • "; $this->pagination->initialize($config); $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0; $page = is_numeric($page) ? $page : 0; $mysql = $tbq['query'] . " LIMIT " . $config["per_page"] . " OFFSET " . $page; $this->load->library('table'); $this->table->set_template($this->template); $query = $this->db->query($mysql); // $this->table->set_heading(array('data' => 'Added/ID', 'style' => 'width:100px'), 'Title', 'Client', array('data' => 'Action', 'style' => 'width:70px')); $data['output_table'] = $this->table->generate($query); $data["links"] = $this->pagination->create_links(); return $data; } protected function makeGoogleAddress($rect) { //print_r($rect); $data['directionsStart'] = $rect['to_street'] . "," . $rect['to_city'] . "," . $rect['to_state'] . " " . $rect['to_zipcode'] . ", USA"; $data['directionsEnd'] = $rect['from_street'] . "," . $rect['from_city'] . "," . $rect['from_state'] . " " . $rect['from_zipcode'] . ", USA"; return $data; } }