Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 17th, 2010 | Syntax: PHP | Size: 1.63 KB | Hits: 84 | Expires: Never
Copy text to clipboard
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <title>PRUEBA</title>
  6. <link rel="stylesheet" type="text/css" href="css/flexigrid/flexigrid.css">
  7. <script type="text/javascript" src="js/jquery.js"></script>
  8. <script type="text/javascript" src="js/flexigrid.js"></script>
  9. </head>
  10. <body>
  11. <table class="prueba">
  12. <thead>
  13.      <tr>
  14.           <th width="100">Producto</th>
  15.           <th width="100">Stock Inicial</th>
  16.            <th width="100">Stock Actual</th>
  17.           <th width="100">Vendidos</th>
  18.           <th width="100">Precio Costo</th>
  19.           <th width="100">Precio Venta</th>
  20.           <th width="100">TOTAL VENDIDO</th>
  21.      </tr>
  22. </thead>
  23. <tbody>
  24.      
  25. <?php
  26.         foreach($productos as $producto)        {
  27.         $stock = $producto['s_inicial'];
  28.         $precio_costo = $producto['p_costo'];
  29.         $producto = $producto['nombre'];
  30.         $precio_venta = $producto['p_venta'];
  31.         $vendidos = $producto['vendidos'];
  32.         $totalstock = $stock - $vendidos;
  33.         $totalventas = $vendidos * $precio_venta;
  34.                 echo "<tr>";
  35.                 echo "<td>".$producto."</td>";
  36.                 echo "<td>".$stock." unidades</td>";
  37.                 echo "<td>".$totalstock." unidades</td>";
  38.                 echo "<td>".$vendidos." unidades</td>";
  39.                 echo "<td>$".$precio_costo."</td>";
  40.         echo "<td>$".$precio_venta."</td>";
  41.                 echo "<td>$".$totalventas."</td>";
  42.                 echo "</tr>";
  43.         }
  44. ?>
  45.          
  46. </tbody>
  47. </table>
  48.  
  49. <script type="text/javascript">
  50. $('.prueba').flexigrid({height:'auto',striped:false,sortable:true});
  51. </script>
  52. </body>
  53. </html>