PageRenderTime 47ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/lista_de_producto/index.php

https://gitlab.com/gustCL/syscar
PHP | 188 lines | 153 code | 30 blank | 5 comment | 1 complexity | ddc1575d6153fc168145e3ee46449862 MD5 | raw file
  1. <?php
  2. require_once ('head.php');
  3. $row_number = 1;
  4. $registro = "SELECT p.codigoProducto, p.codigoBarras,p.codigo, li.nombreLinea, p.nombreComercial, ps.precioVenta, SUM(e.stock) AS totalStock
  5. FROM Producto p, Linea li, PrecioSucursal ps, Ubicacion u, Existencias e, Lote lo
  6. WHERE p.idLinea = li.idLinea AND p.estado = 1 AND li.estado = 1 AND p.codigoProducto = lo.codigoProducto
  7. AND lo.idLote = e.idLote AND p.codigoProducto = ps.codigoProducto AND p.codigoProducto = u.codigoProducto
  8. AND e.idUbicacion = u.idUbicacion GROUP BY lo.codigoProducto ORDER BY p.nombreComercial ASC";
  9. $comando = Database::getInstance()->getDb()->prepare($registro);
  10. $comando->execute();
  11. ///PRODUCTOS REPETIDO POR LOTE
  12. /*SELECT p.codigoProducto,p.codigoBarras,p.nombreComercial,p.precioVenta,ex.stock
  13. FROM Producto p, Lote lo, Existencias ex, Ubicacion ub, PrecioSucursal ps
  14. WHERE p.codigoProducto = lo.codigoProducto AND lo.idLote = ex.idLote
  15. AND ub.codigoProducto = p.codigoProducto AND ps.codigoProducto = p.codigoProducto AND p.estado = 1 ORDER BY p.codigoProducto DESC */
  16. ?>
  17. <div class="page-content">
  18. <!-- subtTitulo -->
  19. <div class="page-header position-relative">
  20. <div class="header-title">
  21. <h1>
  22. <strong> LISTA DE PRODUCTOS</strong>
  23. </h1>
  24. </div>
  25. <!--Header Buttons-->
  26. <div class="header-buttons">
  27. <a class="sidebar-toggler" href="#">
  28. <i class="fa fa-arrows-h"></i>
  29. </a>
  30. <a class="refresh" id="refresh-toggler" href="#">
  31. <i class="glyphicon glyphicon-refresh"></i>
  32. </a>
  33. <a class="fullscreen" id="fullscreen-toggler" href="#">
  34. <i class="glyphicon glyphicon-fullscreen"></i>
  35. </a>
  36. </div>
  37. <!--Header Buttons End-->
  38. </div>
  39. <div class="main-container container-fluid">
  40. <!-- Page Body -->
  41. <div class="page-body">
  42. <div class="row">
  43. <div class="col-lg-12 col-sm-12 col-xs-12">
  44. <div class="row">
  45. <div class="col-lg-12 col-sm-12 col-xs-12">
  46. <div class="widget">
  47. <form method="post" class="form-horizontal">
  48. <div class="widget-body">
  49. <br>
  50. <center>
  51. <table align="center">
  52. <tr>
  53. <td>
  54. <span class="input-icon">
  55. <input type="text" size="40" class="form-control" placeholder="Buscar Producto por : Codigo , Descripcion " id="bus-producto"/>
  56. <i class="glyphicon glyphicon-search circular blue"></i>
  57. </span>
  58. </td>
  59. <td>&nbsp;&nbsp;</td>
  60. <td>
  61. <a class="btn btn-warning shiny" href="nuevo_producto.php" >
  62. <i class="fa fa-plus">
  63. </i> Nuevo Producto
  64. </a>
  65. </td>
  66. </tr>
  67. </table>
  68. </center>
  69. <br>
  70. </div>
  71. <br>
  72. <div class="widget-body">
  73. <br>
  74. <!-- TABLA DE USUARIOS-->
  75. <div class="table-responsive" id="agrega-registros">
  76. <table class="table table-striped" >
  77. <thead>
  78. <tr>
  79. <th>
  80. <strong>NRO.</strong>
  81. </th>
  82. <th>
  83. <strong>CODIGO</strong>
  84. </th>
  85. <th>
  86. <strong>DESCRIPCION</strong>
  87. </th>
  88. <th>
  89. <strong>STOCK</strong>
  90. </th>
  91. <th>
  92. <strong>PRECIO VENTA</strong>
  93. </th>
  94. <!--Botones-->
  95. <th>
  96. </th>
  97. </tr>
  98. </thead>
  99. <tbody>
  100. <?php
  101. try {
  102. while ($row = $comando->fetch()) {
  103. $idP = $row['codigoProducto'];
  104. ?>
  105. <tr>
  106. <td id = "codigo" name="codigo" >
  107. <?= $row_number ?>
  108. </td>
  109. <td>
  110. <?= $row['codigoBarras'] ?>
  111. </td>
  112. <td>
  113. <?= $row['nombreComercial'] ?>
  114. </td>
  115. <td>
  116. <?= $row['totalStock'] ?>
  117. </td>
  118. <td>
  119. <?= $row['precioVenta'] ?>
  120. </td>
  121. <!--aqui estan los botones que hacen activar las vnetanas del modal-->
  122. <td>
  123. <a href="ver_producto.php?id=<?= $idP ?>" class="btn btn-default btn-xs blue" ><i class="fa fa-eye"></i> Ver</a>
  124. <a href="mod_producto.php?id=<?= $idP ?>" class="btn btn-default btn-xs purple" ><i class="fa fa-edit"></i> Editar</a>
  125. <a href="javascript:eliminarProd('<?= $idP ?>');" class="btn btn-default btn-xs black" ><i class="fa fa-trash-o"></i> Eliminar</a>
  126. </td>
  127. </tr>
  128. <?php
  129. $row_number = $row_number + 1;
  130. }//terminacion del while
  131. } catch (PDOException $e) {
  132. echo 'Error: ' . $e;
  133. }
  134. ?>
  135. </tbody>
  136. </table>
  137. </div>
  138. <br>
  139. <!--finnn de tablaa-->
  140. </div>
  141. </form>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. <!------- otroooooo----->
  147. <!-- /Page Body -->
  148. </div>
  149. <!-- /Page Content -->
  150. </div>
  151. <!-- /Page Container -->
  152. <!-- Main Container -->
  153. </div>
  154. <!-- finnn -->
  155. </div>
  156. <?php
  157. require_once ('../header_footer/footer.php');
  158. ?>