"
",
'thead_open' => '',
'thead_close' => '',
'heading_row_start' => '',
'heading_row_end' => '
',
'heading_cell_start' => '',
'heading_cell_end' => ' | ',
'tbody_open' => '',
'tbody_close' => '',
'row_start' => '',
'row_end' => '
',
'cell_start' => '',
'cell_end' => ' | ',
'row_alt_start' => '',
'row_alt_end' => '
',
'cell_alt_start' => '',
'cell_alt_end' => ' | ',
'table_close' => '
'
);
public $data = array();
function __construct() {
parent::__construct();
if (!isset($_SESSION['username']) or $_SESSION['username'] == '') {
redirect('site');
}
}
// protected
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;
}
}