You are on page 1of 3

<?

php namespace sections;


include 'logica/Carrito.php';
include 'datos/Conexion.php';
include 'datos/Carrito.php';
include 'datos/CarritoDetalle.php';
include 'logica/CarritoDetalle.php';
include 'logica/Producto.php';
$obj = new \logica\Carrito();
$res = $obj->listaProductos();
?>
<fieldset>
<!-- Form Name -->
<legend>Usuarios</legend>
<div class="row">
<div class="col-sm-12">
<div class="col-md-2 col-xs-12 col-md-offset-10 pull-right">

<a href="javascript:void(0)" id="btnEditPerson" name="btnaddPerson"


class="btn btn-success btn-block" onclick="">
<i class="fa fa-plus-circle" aria-hidden="true"></i> Agregar</a>
</div>
</div>
</div>

<div class="">
<!-- Text input-->
<table id="tabla_usuarios" class="table table-striped table-condensed">
<thead>
<tr>
<th>ID</th>
<th>Fecha</th>
<th>Nombre</th>
<th>Telefono</th>
<th>Direccion</th>
<th>E-Mail</th>
<th>Acciones</th>
</tr>
</thead>
<tbody>
<?php foreach ($res as $value): ?>
<tr>
<td><?php echo $value->getId()?></td>
<td><?php echo $value->getFecha() ?></td>
<td><?php echo $value->getNombre()?></td>
<td><?php echo $value->getTelefono()?></td>
<td><?php echo $value->getDireccion() ?></td>
<td><?php echo $value->getEmail() ?></td>
<td><a href="javascript:void(0)" title="Ver Registro" onclick=""><i
class="fa fa-eye" aria-hidden="true" data-toggle="modal" data-target="#ver<?php
echo $value->getId()?>"></i></a>
</td>
<!-- !-->
<div id="ver<?php echo $value->getId()?>" class="modal fade"
role="dialog">
<div class="modal-dialog">

<!-- Modal content-->


<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-
dismiss="modal">&times;</button>
<h4 class="modal-title">Detalle</h4>
</div>
<div class="modal-body">
<?php $carDet = new \logica\CarritoDetalle();
$proDet = new \logica\Producto();
$det = $carDet->verDetalles($value->getId());
?>
<table id="" class="table table-striped table-condensed">
<thead>
<tr>
<th>Cod</th>
<th>Descrip</th>
<th>Cant</th>
<th>Precio</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<?php foreach ($det as $val): ?>
<tr>
<td><?php echo $proDet->getProductoById($val->getIdprod())-
>getCodigo(); ?> </td>
<td><?php echo $proDet->getProductoById($val->getIdprod())-
>getDescripcion() ?></td>
<td><?php echo $val->getCantidad() ?></td>
<td><?php echo $val->getValor() ?></td>
<td><?php echo $val->getValor() * $val->getCantidad()?></td>
<hr>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-
dismiss="modal">Close</button>
</div>
</div>

</div>
</div>
<!-- !-->
<?php endforeach;?>
</tr>
</tbody>
</table>
<script>
$('#tabla_usuarios').DataTable({
"language": {
"lengthMenu": "Mostrar _MENU_ registros por pagina",
//"zeroRecords": "Nothing found - sorry",
"info": "Pagina _PAGE_ de _PAGES_",
"infoEmpty": "No hay registros para mostrar",
"infoFiltered": "(filtrando de _MAX_ registros totales)",
"search": "Buscar:"
}, "scrollX": true,
"autoWidth": false
});
</script>
</div><!--well!-->
<hr>

</fieldset>

You might also like