Jump to content

Get element list with a specific id

query database mysql

  • Please log in to reply
No replies to this topic

#1 jospalgal



  • Members
  • Pip
  • 8 posts

Posted 08 May 2017 - 09:54 AM

For example, i have two tables ('intervalosHorarios' and 'entregas' [1_n]) and i want to show 'entregas' list from specific 'intervalosHorarios' id. I tried the following but it didn't work.







public function entregas_lista($idCarga) {

$crud = new grocery_CRUD();

$datos = array(
'title' => "entregas", // En la vista 'header' tendré una variable $title
'username' => "Administrador"

$this->load->view('commons/header', $datos);

//Quitamos los botones de añadir y quitar


$crud->where('idCarga =', $idCarga);

$crud->display_as('idCarga', 'Nº Entrega');
$crud->set_subject('Carga / Descarga');
$crud->set_relation('idCarga', 'intervalosHorarios', 'intervaloHorario');

$crud->columns('fechaCita', 'horaCita', 'numeroEntrega', 'cliente', 'Origen', 'Destino', 'cargaPrevista', 'entregaPrevista', 'accion', 'estado');

$output = $crud->render();


//--------------- Cargo la vista 'commons/footer.php' ------------- /

function _example_output($output = null) {
$this->load->view('example', (array) $output);


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users