<div id="sidebar"><br>
  <h2 align="center">
    <a style="color:#0D47A1;"  href=""><img style="width: 15%;" src="ico/history.png">Mi Historial</a>
  </h2>
  <table class="table table-bordered">
    <tr>
      <td>
        <table class="table table-bordered table table-hover">
          <?php 
$pa = mysql_query("SELECT * FROM historial");
while ($row = mysql_fetch_array($pa)) {
    $oProducto = new Consultar_Producto($row['codigo']);
    ?>
              <tr style="font-size:9px">
                <td><?php 
    echo $oProducto->consultar('nombre');
    ?>
</td>
                <td><?php 
    echo $row[2];
    ?>
</td>
              </tr> 
           <?php 
}
?>
 
              <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.js"></script>
              <script type="text/javascript">
}
?>
                <table class="table table-bordered">
                    <tr class="info">
                        <td><strong class="text-info">Articulo</strong></td>
                        <td><div align="right"><strong class="text-info">Valor Unitario</strong></div></td>
                        <td><center><strong class="text-info">Seleccione la Cantidad</strong></center></td>
                        <td><div align="right"><strong class="text-info">Total</strong></div></td>
                        <td></td>
                    </tr>
                    <?php 
$total = 0;
$neto = 0;
$pa = mysql_query("SELECT distinct c.*, e.descuento from carrito c, estado e, producto p where p.id_estado = e.id and p.codigo = c.codigo ");
while ($row = mysql_fetch_array($pa)) {
    $oProducto = new Consultar_Producto($row['codigo']);
    $total = $row['cantidad'] * $oProducto->consultar('valor');
    #cantidad * valor unitario
    $descu = $row['descuento'];
    $a = 1 - $descu;
    $subtotal = $total * $a;
    $desc = $total * $descu;
    $neto = $neto + $subtotal;
    #acumulamos el neto
    ?>
          <tr>
            <td>
              <div align="center">
                     <strong><?php 
    echo $oProducto->consultar('nombre');
    ?>
Example #3
0
}
?>
<div id="sidebar"><br>
  <h2 align="center">
    <a style="color:#0D47A1;"  href="login.php"><img style="width: 15%;" src="ico/pedidos.png">Comprar</a>
  </h2>
  <table class="table table-bordered">
    <tr>
      <td>
        <table class="table table-bordered table table-hover">
          <?php 
$neto = 0;
$tneto = 0;
$pa = mysql_query("SELECT * FROM carrito");
while ($row = mysql_fetch_array($pa)) {
    $oProducto = new Consultar_Producto($row['codigo']);
    $neto = $oProducto->consultar('valor') * $row['cantidad'];
    $tneto = $tneto + $neto;
    ?>
              <tr style="font-size:9px">
                <td><?php 
    echo $oProducto->consultar('nombre');
    ?>
</td>
                <td><?php 
    echo $row['cantidad'];
    ?>
</td>
                <td>$ <?php 
    echo number_format($neto, 2, ",", ".");
    ?>