Viewing file: test.php (1.12 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php $this->table->set_heading( 'Nombre','Descripcion', 'Precio','Estado','Cantidad','Ingresado','Agregar Carrito'); //crea la primera fila de la tabla con el encabezado $tmp = array ( 'table_open' => '<table class="table table-bordered table-striped" id="busquedaProductos" width="80%">' ); //modifica el espaciado $i=1; $this->table->set_template($tmp); //aplico los cambios de modificacion anterior foreach($noticias as $dato): $this->table->add_row($dato->nombre,$dato->descripcion,$dato->precio,$dato->estado,'<input type="number" style="width: 70%;" name="cantidadProd_'.$i.'" id="cantidadProd_'.$i.'">','<input type="checkbox" id="ingresado_'.$i.'" name="ingresado_'.$i.'">','<input class="btn btn-success" style="width: 60%;" data-dismiss="modal" name="botonDetalle" id="botonDetalle" value="Agregar Producto" onclick="ingresarCarrito('."'".$dato->nombre."'".','.$i.','.$dato->precio.');">'); //agregamos la celda a la tabla por cada iteracion $i++; endforeach;
echo $this->table->generate(); //cuando termina generamos la tabla a partir del vector ?>
<?= $paginacion?>
|