[eluser]Brain Coder[/eluser]
hello all,
i have some issues with my pagination
i have this controller function
Code:
function department($id){
$data['staff_dept'] = $this->MDepartment->getAllDepartmentsForStaff($this->session->userdata('staff_id'));
$data['test'] = $this->MStaff->getAssigned();
if(!in_multiarray($id,$data['test'])){
redirect('staff/dashboard/noaccess','refresh');
}
$this->load->library('pagination');
$data['title'] = "Staff Control Panel";
$data['main'] = 'staff_department';
$data['tickets'] = $this->MTickets->getAllTicket($id);
$data['tome'] = $this->MTickets->getAllAssignedTickets($id);
$data['noassign'] = $this->MTickets->getAllnoAssignedTickets($id);
$data['toothers'] = $this->MTickets->getAllToOthersAssignedTickets($id);
$this->load->vars($data);
$this->load->view('staff/dashboard',$data);
}
$data['tome'] = $this->MTickets->getAllAssignedTickets($id);
$data['noassign'] = $this->MTickets->getAllnoAssignedTickets($id);
$data['toothers'] = $this->MTickets->getAllToOthersAssignedTickets($id);
these three functions are getting the data from the database using field name ticket_assignto
Code:
<?php $this->load->view("staff/assigntome");?>
<br>
<?php $this->load->view("staff/noassign");?>
<br>
<?php $this->load->view("staff/assigntoothers");?>
this is my view $data['main'] = 'staff_department';
Code:
function getAllnoAssignedTickets($id){
$data = array();
$this->db->select('tickets.*');
$this->db->where(array('ticket_assignto'=>0,'ticket_status'=>0,'department_id'=>id_clean($id)));
$this->db->orderby('ticket_lastreplytime','asc');
$Q = $this->db->get('tickets');
if ($Q->num_rows() > 0){
foreach($Q->result_array() as $row){
$data[]=$row;
}
}
$Q->free_result();
return $data;
}
Model function example
now i need to add three pagination to each view
how can i do that?
thanx for ur help