Sorry my bad english
I am working on a project in CodeIgniter 3.1.11, the project in general is working fine and everything, but there is a problem, in my local I use xampp, and the codeigniter paging system works fine, but when publishing on my server or any server does not work, does not show the page.
It would have to show me something like that but it doesn't: (example)
![[Image: codeigniter-pagination-example-using-bootstrap.png]](https://4.bp.blogspot.com/-sJ2uXPIJW9c/WYlkt39fP0I/AAAAAAAAB30/I9zIOOqar7gRFMOE8zMTK7tOuHBZKCVhwCLcBGAs/w1200-h630-p-k-no-nu/codeigniter-pagination-example-using-bootstrap.png)
I do not know what will be happening so that this is not showing it to me, and for the project it is essential that this is in operation.
here is my controller and model
Controller
Model
Yes, I know that there is a lot of code redundancy and spaghetti code, but for now I am starting in the project and later it will be debugged.
If anyone knows why this error is generated, I would appreciate it very much
I am working on a project in CodeIgniter 3.1.11, the project in general is working fine and everything, but there is a problem, in my local I use xampp, and the codeigniter paging system works fine, but when publishing on my server or any server does not work, does not show the page.
It would have to show me something like that but it doesn't: (example)
![[Image: codeigniter-pagination-example-using-bootstrap.png]](https://4.bp.blogspot.com/-sJ2uXPIJW9c/WYlkt39fP0I/AAAAAAAAB30/I9zIOOqar7gRFMOE8zMTK7tOuHBZKCVhwCLcBGAs/w1200-h630-p-k-no-nu/codeigniter-pagination-example-using-bootstrap.png)
I do not know what will be happening so that this is not showing it to me, and for the project it is essential that this is in operation.
here is my controller and model
Controller
PHP Code:
public function index()
{
$config = array();
$user = 0;
if($this->session->userdata('login')){
if($this->user->TIP == 2){
$user = $this->user->TIP;
$this->list_car = $this->ConModel->get_list_vh();
}else if($this->user->TIP == 3){
$user = $this->user->TIP;
$this->list_car = $this->ConModel->get_list_vh_cli();
}else{
$this->list_car = $this->ConModel->get_list_vh_cli();
}
}else{
$this->list_car = $this->ConModel->get_list_vh_cli();
}
$this->load->library('pagination');
$cont = count($this->list_car);
$config['base_url'] = base_url().'welcome';
$config['total_rows'] = $cont;
$config['per_page'] = 5;
$config["uri_segment"] = 2;
$config['num_links'] = 2;
$config['use_page_numbers'] = true;
$config['reuse_query_string'] = true;
$config['full_tag_open'] = '<ul class="pagination">';
$config['full_tag_close'] = '</ul>';
$config['first_link'] = false;
$config['last_link'] = false;
$config['first_tag_open'] = '<li class="page-item page-link">';
$config['first_tag_close'] = '</li>';
$config['prev_link'] = '«';
$config['prev_tag_open'] = '<li class="prev page-link"> ';
$config['prev_tag_close'] = '</li>';
$config['next_link'] = '»';
$config['next_tag_open'] = '<li class="page-item page-link">';
$config['next_tag_close'] = '</li>';
$config['last_tag_open'] = '<li class="page-item page-link">';
$config['last_tag_close'] = '</li>';
$config['cur_tag_open'] = '<li class="page-item active"><a class="page-link" href="#">';
$config['cur_tag_close'] = '</a></li>';
$config['num_tag_open'] = '<li class="page-item page-link">';
$config['num_tag_close'] = '</li>';
$this->pagination->initialize($config);
$page = ($this->uri->segment(2)) ? $this->uri->segment(2) : 0;
$post = $this->ConModel->get_num_pagina($config['per_page'],$page, $user);
$data = array(
'est' => 0,
'doc' => $this->session->userdata('token'),
'count' => $cont,
'js' => 1,
'script' => 'fil1.js',
'lt' => $post,
't' => $this->session->userdata('token'),
'link' => $this->pagination->create_links()
);
$this->load->view("layout/venta_init/header",$data);
$this->load->view("venta/index");
$this->load->view("layout/venta_init/footer");
}
Model
PHP Code:
public function get_list_vh_cli()
{
$query = "SELECT
vt_venta_vh.id_vh_venta AS ID,
vt_venta_vh.marca AS MAR,
vt_venta_vh.modelo AS MO,
vt_venta_vh.version AS V,
vt_venta_vh.`year` AS A,
vt_venta_vh.kilometraje AS K,
vt_venta_vh.placa AS P,
vt_venta_vh.valor_venta AS VAL,
vt_venta_vh.op_valor AS OP,
vt_venta_vh.activo AS EST,
vt_venta_vh.pintura AS PI,
vt_venta_vh.interior AS IN_T,
vt_venta_vh.mecanico AS ME,
vt_venta_vh.accidente AS ACC,
vt_venta_vh.choque AS CHO,
vt_venta_vh.combustible AS COM,
vt_venta_vh.descripcion AS DES,
(SELECT vt_img.img FROM vt_img WHERE vt_img.id_vh = ID LIMIT 1) AS IMG,
vt_usuario.nombre AS NOM,
vt_usuario.apellido AS APE,
vt_usuario.telefono AS TEL,
vt_venta_vh.`user` AS US
FROM
vt_venta_vh
INNER JOIN vt_usuario ON vt_venta_vh.documento = vt_usuario.documento
WHERE vt_venta_vh.`user` = 1 AND vt_venta_vh.activo = 1";
$dd = $this->db->query($query);
return $dd->result();
}
//---------------------------------------------------------------------------
public function get_num_pagina($limit,$offset, $user)
{
$this->db->select('vt_venta_vh.id_vh_venta AS ID,vt_venta_vh.marca AS MAR,vt_venta_vh.modelo AS MO,vt_venta_vh.version AS V,vt_venta_vh.`year` AS A,vt_venta_vh.kilometraje AS K,vt_venta_vh.placa AS P,vt_venta_vh.valor_venta AS VAL,vt_venta_vh.op_valor AS OP,vt_venta_vh.activo AS EST,vt_venta_vh.pintura AS PI,vt_venta_vh.interior AS IN_T,vt_venta_vh.mecanico AS ME,vt_venta_vh.accidente AS ACC,vt_venta_vh.choque AS CHO,vt_venta_vh.combustible AS COM,vt_venta_vh.descripcion AS DES,(SELECT vt_img.img FROM vt_img WHERE vt_img.id_vh = ID LIMIT 1) AS IMG,vt_usuario.nombre AS NOM,vt_usuario.apellido AS APE,vt_usuario.telefono AS TEL,vt_venta_vh.`user` AS US');
$this->db->join('vt_usuario','vt_venta_vh.documento = vt_usuario.documento');
if($user != 0){
$this->db->where('vt_venta_vh.`user`',$user);
}
$this->db->where('vt_venta_vh.activo',1);
$this->db->limit($limit, $offset);
return $this->db->get('vt_venta_vh')->result();
}
public function get_num_pagina_bus($año, $marca, $modelo,$version,$comb,$k, $user , $check_val_10,$check_val_mx_4,$check_val_m_4)
{
$this->db->select('vt_venta_vh.id_vh_venta AS ID,vt_venta_vh.marca AS MAR,vt_venta_vh.modelo AS MO,vt_venta_vh.version AS V,vt_venta_vh.`year` AS A,vt_venta_vh.kilometraje AS K,vt_venta_vh.placa AS P,vt_venta_vh.valor_venta AS VAL,vt_venta_vh.op_valor AS OP,vt_venta_vh.activo AS EST,vt_venta_vh.pintura AS PI,vt_venta_vh.interior AS IN_T,vt_venta_vh.mecanico AS ME,vt_venta_vh.accidente AS ACC,vt_venta_vh.choque AS CHO,vt_venta_vh.combustible AS COM,vt_venta_vh.descripcion AS DES,(SELECT vt_img.img FROM vt_img WHERE vt_img.id_vh = ID LIMIT 1) AS IMG,vt_usuario.nombre AS NOM,vt_usuario.apellido AS APE,vt_usuario.telefono AS TEL,vt_venta_vh.`user` AS US');
$this->db->from('vt_venta_vh');
$this->db->join('vt_usuario','vt_venta_vh.documento = vt_usuario.documento');
$this->db->where('vt_venta_vh.activo', 1);
if($user != 0){
$this->db->where('vt_venta_vh.`user`',$user);
}
if($año != '0'){
$this->db->where('vt_venta_vh.year',$año);
}
if($marca != '0'){
$this->db->where('vt_venta_vh.marca',$marca);
}
if($modelo != '0'){
$this->db->where('vt_venta_vh.modelo',$modelo);
}
if($version != '0'){
$this->db->where('vt_venta_vh.version',$version);
}
if($comb != '-1'){
$this->db->where('vt_venta_vh.combustible',$comb);
}
if($k != '0'){
if($k == 1){
$this->db->where('vt_venta_vh.kilometraje >=','0');
$this->db->where('vt_venta_vh.kilometraje <=','10000');
}
elseif($k == 2){
$this->db->where('vt_venta_vh.kilometraje >=','10000');
$this->db->where('vt_venta_vh.kilometraje <=','20000');
}elseif($k == 3){
$this->db->where('vt_venta_vh.kilometraje >=','21000');
$this->db->where('vt_venta_vh.kilometraje <=','30000');
}
elseif($k == 4){
$this->db->where('vt_venta_vh.kilometraje >=','31000');
$this->db->where('vt_venta_vh.kilometraje <=','40000');
}elseif($k == 5){
$this->db->where('vt_venta_vh.kilometraje >=','41000');
$this->db->where('vt_venta_vh.kilometraje <=','50000');
}elseif($k == 6){
$this->db->where('vt_venta_vh.kilometraje >=','51000');
$this->db->where('vt_venta_vh.kilometraje <=','60000');
}elseif($k == 7){
$this->db->where('vt_venta_vh.kilometraje >=','61000');
}
}
if($check_val_10 != 0){
$this->db->where('vt_venta_vh.valor_venta >=','0');
$this->db->where('vt_venta_vh.valor_venta <=','10000000');
}
if($check_val_mx_4 != 0){
$this->db->where('vt_venta_vh.valor_venta >=','11000000');
$this->db->where('vt_venta_vh.valor_venta <=','40000000');
}
if($check_val_m_4 != 0){
$this->db->where('vt_venta_vh.valor_venta >=','41000000');
}
return $this->db->get()->result();
}
Yes, I know that there is a lot of code redundancy and spaghetti code, but for now I am starting in the project and later it will be debugged.
If anyone knows why this error is generated, I would appreciate it very much