Skip to content

Instantly share code, notes, and snippets.

Created Jul 5, 2019
What would you like to do?
$granTotal = 0;
<div class="col-xs-12">
<?php if(!empty($this->session->flashdata())): ?>
<div class="alert alert-<?php echo $this->session->flashdata('clase')?>">
<?php echo $this->session->flashdata('mensaje') ?>
<?php endif; ?>
<form method="post" action="<?php echo base_url() ?>index.php/vender/agregar">
<label for="codigo">Código de barras:</label>
<input autocomplete="off" autofocus class="form-control" name="codigo" required type="text" id="codigo" placeholder="Escribe el código">
<table class="table table-bordered">
<th>Precio de venta</th>
<?php foreach($carrito as $indice => $producto){
$granTotal += $producto->total;
<td><?php echo $producto->id ?></td>
<td><?php echo $producto->codigo ?></td>
<td><?php echo $producto->descripcion ?></td>
<td><?php echo $producto->precioVenta ?></td>
<td><?php echo $producto->cantidad ?></td>
<td><?php echo $producto->total ?></td>
<td><a class="btn btn-danger" href="<?php echo base_url() . "index.php/vender/quitarDelCarrito/" . $indice?>"><i class="fa fa-trash"></i></a></td>
<?php } ?>
<h3>Total: <?php echo $granTotal; ?></h3>
<input name="total" type="hidden" value="<?php echo $granTotal;?>">
<a href="<?php echo base_url() ?>index.php/vender/terminarVenta" class="btn btn-success">Terminar venta</a>
<a href="<?php echo base_url() ?>index.php/vender/cancelarVenta" class="btn btn-danger">Cancelar venta</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment