modelo.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <?php
  2. require_once('shared/conexionBD.php');
  3. if (isset($_GET['linea']) && isset($_GET['modelo'])) {
  4. $lineaGet = htmlentities($_GET['linea']);
  5. $articulo = htmlentities($_GET['modelo']);
  6. }
  7. if (empty($lineaGet) && empty($articulo)) {
  8. header('Location: 404.php');
  9. }
  10. mysqli_query($conexion,"SET NAMES utf8");
  11. $rutaImagen = 'ALP/';
  12. $query = "SELECT ID,LINEA,SUBMODELO FROM ITT_ALP_GLOBAL WHERE LINEA='".html_entity_decode($lineaGet)."' AND MODELO='".html_entity_decode($articulo)."' ";
  13. $resultado = mysqli_query($conexion, $query);
  14. //Crear un manejo de errores
  15. if($resultado) {
  16. if((mysqli_num_rows($resultado)>0)) {
  17. while ($columna= mysqli_fetch_array($resultado)) {
  18. $modelosLineas[] = ["ID"=>$columna['ID'],"LINEA"=>$columna['LINEA'],"SUBMODELO"=>$columna['SUBMODELO']];
  19. }
  20. } else {
  21. $strMensaje = 'No se encontraron resultados. Intente nuevamente.';
  22. }
  23. }else {
  24. $strMensaje= 'Ha ocurrido un error al consultar las líneas, por favor reporte el problema';
  25. }
  26. //creamos consulta para ver las imagenes de los banners interiores
  27. $qryImagenes = "SELECT LINEA,MODELO,URLBAN from ITT_ASW_IMG WHERE LINEA='".html_entity_decode($lineaGet)."' AND MODELO='".html_entity_decode($articulo)."'";
  28. $qryImg = mysqli_query($conexion, $qryImagenes);
  29. $arrImgs = [];
  30. $arrBannInt = mysqli_fetch_assoc($qryImg);
  31. ?>
  32. <!DOCTYPE html>
  33. <!--[if IE 8 ]> <html xml:lang="es" lang="es" class="no-js ie8"> <![endif]-->
  34. <!--[if IE 9 ]> <html xml:lang="es" lang="es" class="no-js ie9"> <![endif]-->
  35. <html xml:lang="es" lang="es">
  36. <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  37. <head>
  38. <!-- Global site tag (gtag.js) - Google Analytics -->
  39. <!--Producción-->
  40. <script async src="https://www.googletagmanager.com/gtag/js?id=UA-125019062-2"></script>
  41. <!--Producción-->
  42. <script>
  43. window.dataLayer = window.dataLayer || [];
  44. function gtag(){dataLayer.push(arguments);}
  45. gtag('js', new Date());
  46. gtag('config', 'UA-125019062-2');
  47. </script>
  48. <!-- End Global site tag (gtag.js) - Google Analytics -->
  49. <!-- [if IE]> -->
  50. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  51. <meta http-equiv="cleartype" content="on"/>
  52. <!-- <![endif] -->
  53. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  54. <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  55. <title><?php echo ucfirst(strtolower($articulo)); ?> – S&amp;P</title>
  56. <meta name="keywords" content="Magento, Varien, E-commerce"/>
  57. <meta name="robots" content="INDEX,FOLLOW"/>
  58. <link rel="icon" href="https://statics.solerpalau.com/skin/frontend/solerpalau/default/favicon.ico" type="image/x-icon"/>
  59. <link rel="shortcut icon" href="https://statics.solerpalau.com/skin/frontend/solerpalau/default/favicon.ico" type="image/x-icon"/>
  60. <!-- estilo princripal -->
  61. <!-- bootstrap 4 -->
  62. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  63. <link href="css/style-shop.css" rel="stylesheet">
  64. <script type="text/javascript" src="js/events.js"></script>
  65. <!-- estilo princripal -->
  66. <link rel="stylesheet" type="text/css" href="css/style-css01.css" media="all" />
  67. </head>
  68. <body class=" cms-page-view cms-produccion-distribucion-logistica level-2 customer-logged-out">
  69. <!-- aqui va el header -->
  70. <?php include 'header.php' ?>
  71. <script type="text/javascript">
  72. //<![CDATA[
  73. if (typeof HIB.menu == 'object' && typeof HIB.menu.init == 'function') {
  74. HIB.menu.init();
  75. }
  76. //]]>
  77. </script>
  78. <div class="main-container col1-layout">
  79. <div class="breadcrumbs">
  80. <div class="container">
  81. <ul xmlns:v="https://rdf.data-vocabulary.org/#">
  82. <li class="0" typeof="v:Breadcrumb">
  83. <a href="index.php"
  84. title="Inicio"
  85. rel="v:url" property="v:title">
  86. Inicio</a>
  87. <div class="arrow-breadcrumbs-level3"><img height="10" width="8" src="https://statics.solerpalau.com/skin/frontend/solerpalau/default/images/svg/arrow-breadcrumbs.svg"/></div>
  88. <div class="arrow-breadcrumbs-level2"><img height="10" width="8" src="https://statics.solerpalau.com/skin/frontend/solerpalau/default/images/svg/arrow-breadcrumbs-white.svg"/></div> &nbsp;
  89. <li class="2">
  90. <a href="linea.php?linea=<?php echo $lineaGet; ?>">División <?php echo "$lineaGet"; ?></a>
  91. <div class="arrow-breadcrumbs-level3"><img height="10" width="8" src="https://statics.solerpalau.com/skin/frontend/solerpalau/default/images/svg/arrow-breadcrumbs.svg"/></div>
  92. <div class="arrow-breadcrumbs-level2"><img height="10" width="8" src="https://statics.solerpalau.com/skin/frontend/solerpalau/default/images/svg/arrow-breadcrumbs-white.svg"/></div>
  93. </li>
  94. <li class="2">
  95. <a><?php echo ($articulo); ?> </a>
  96. </li>
  97. </ul>
  98. </div>
  99. </div>
  100. <div class="main">
  101. <div class="col-main">
  102. <main>
  103. <div id="overlaySearch" class="overlay">
  104. <!-- Overlay content -->
  105. <div id="searchResults" class="overlay-content grid"></div>
  106. </div>
  107. <main>
  108. <div class="page-title category-title dark">
  109. <?php if (!empty($arrBannInt)) {
  110. $imgExplode = explode('/',$arrBannInt['URLBAN']);
  111. $img = 'ALP/'.$imgExplode[2];
  112. echo "<img src='".$img."' alt='Banner Interior'>";
  113. }else{ ?>
  114. <img src="media/home/categories_home/<?php
  115. if(file_exists("media/home/categories_home/".$lineaGet.".jpg")){
  116. echo($lineaGet);
  117. }else{
  118. echo('Habitat');
  119. }
  120. ?>.jpg" alt="<?php echo($lineaGet); ?>" class="category-image" />
  121. <?php } ?>
  122. <div class="category-title-container">
  123. <div class="category-title-content container">
  124. <h1 class="h1"><?php echo ($articulo); ?></h1>
  125. </div>
  126. </div>
  127. <div class="clearfix"></div>
  128. </div>
  129. <div class="container">
  130. <hr>
  131. <div class="row">
  132. <div class="col-12 col-lg-3">
  133. <div class="list-group">
  134. <!-- inicia busqueda -->
  135. <div class="float-right pad">
  136. <div class="input-group">
  137. <input type="text" name="caja_busqueda" id="search" class="form-control input-lg" placeholder="Buscar" />
  138. </div>
  139. </div>
  140. <!-- termina busqueda -->
  141. <h5 class="breadcrumb-item activen pad"><b>DIVISIONES</b></h5>
  142. <!-- Inicia Menu principal -->
  143. <h6><a href="#" class="list-group-item list-group-item-action active"> <b> División <?php echo $lineaGet; ?> </b></a></h6>
  144. <ul class="links">
  145. <?php
  146. foreach ($arrGeneral as $modelo):
  147. $query = 'linea=' . urlencode($modelo['LINEA']) . '&modelo=' . urlencode($modelo['MODELO']);
  148. //Resaltar el item activo en rojo
  149. if ($modelo['LINEA'] == html_entity_decode($lineaGet)) {
  150. if ($modelo['MODELO'] == html_entity_decode($articulo)) {
  151. echo "<a href='modelo.php?".$query."' class='activelist'>
  152. <li class='group'> ".$modelo['MODELO'];
  153. echo "</li>
  154. </a>
  155. <hr>";
  156. }else{
  157. echo "<a href='modelo.php?".$query."' class='group'><li class='group' > ".$modelo['MODELO'];
  158. echo "</li></a><hr>";
  159. } ?>
  160. <!-- termina sub menus -->
  161. <?php } endforeach; ?>
  162. </ul>
  163. <!-- se imprimen las líneas -->
  164. <?php
  165. //Filtrar las lineas
  166. $arrLineas = array();
  167. foreach ($arrGeneral as $modelo){
  168. $arrL[] = $modelo['LINEA'];
  169. }
  170. $arrLineas = array_unique($arrL);
  171. foreach ($arrLineas as $linea):
  172. if (html_entity_decode($lineaGet) != $linea) {
  173. ?>
  174. <a href="linea.php?linea=<?php echo $linea ?>"
  175. class='list-group-item list-group-item-action'>
  176. División <?php echo $linea; ?> </a>
  177. <?php }
  178. endforeach; ?>
  179. </div>
  180. <!-- /.col-lg-4 -->
  181. </div>
  182. <div class="col-12 col-sm-12 col-lg-9">
  183. <br>
  184. <div id="ac">
  185. <div class="row" id="result">
  186. <?php
  187. //imprimimos las tarjetas
  188. if (!empty($modelosLineas)){
  189. $cont = 0;
  190. foreach ($modelosLineas as $submodelos){
  191. $arrIds[] = $submodelos['ID'];
  192. $nombreSubmodelo = $submodelos['SUBMODELO'];
  193. //revisar las imagenes
  194. $imagen = $submodelos['ID'].".jpg";
  195. $fichero = $rutaImagen.$imagen;
  196. $imagen = (file_exists($fichero)) ? $rutaImagenCompleta = $fichero : $rutaImagenCompleta = 'media/noimagen.jpg' ;
  197. $queryGet = 'linea='.urlencode(html_entity_decode($lineaGet)).'&modelo='.urlencode(html_entity_decode($articulo)).'&submodelo='.urlencode(html_entity_decode($nombreSubmodelo));
  198. ?>
  199. <div class="col-md-4">
  200. <div class="card hp-100">
  201. <p class="text-center producto">
  202. <a class="loader" id="btn-<?php echo($cont) ?>" href="producto.php?<?php echo($queryGet) ?>">
  203. <img id="img-<?php echo($cont) ?>" class="loadImg" src='media/img/loader2.gif' width='50px' style="position: absolute;display:none" />
  204. <img id="img-producto" src="<?php echo $imagen ?>" alt="<?php echo $nombreSubmodelo ?>" />
  205. </p>
  206. <div class="product-info">
  207. <p class="text-center">
  208. <b> <?php echo $nombreSubmodelo ?> </b>
  209. </p>
  210. </div>
  211. </a>
  212. </div>
  213. </div>
  214. <?php
  215. $cont++;
  216. }
  217. ////////////////////////////////
  218. // Calculadora de atenuadores //
  219. ////////////////////////////////
  220. $string = 'calculadora de atenuadores';
  221. if(html_entity_decode($lineaGet) == 'Atenuación Acústica') {
  222. echo "<div class='col-md-4'>
  223. <div class='card hp-100'>
  224. <p class='text-center producto'>
  225. <a class='loader' id='btn-".$cont++."' href='atenuadores.php'>
  226. <img id='img-".$cont++."' class='loadImg' src='media/img/loader2.gif' width='50px' style='position: absolute;display:none' /> ";
  227. echo "<svg aria-hidden='true' style='max-width: 100px; height: 200px;' focusable='false' data-prefix='fas' data-icon='calculator' class='svg-inline--fa fa-calculator fa-w-14' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path fill='currentColor' d='M400 0H48C22.4 0 0 22.4 0 48v416c0 25.6 22.4 48 48 48h352c25.6 0 48-22.4 48-48V48c0-25.6-22.4-48-48-48zM128 435.2c0 6.4-6.4 12.8-12.8 12.8H76.8c-6.4 0-12.8-6.4-12.8-12.8v-38.4c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4zm0-128c0 6.4-6.4 12.8-12.8 12.8H76.8c-6.4 0-12.8-6.4-12.8-12.8v-38.4c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4zm128 128c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4zm0-128c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4zm128 128c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8V268.8c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v166.4zm0-256c0 6.4-6.4 12.8-12.8 12.8H76.8c-6.4 0-12.8-6.4-12.8-12.8V76.8C64 70.4 70.4 64 76.8 64h294.4c6.4 0 12.8 6.4 12.8 12.8v102.4z'></path></svg>";
  228. echo "</p>
  229. <div class='product-info'>
  230. <p class='text-center'>
  231. <b> Selecciona tu atenuador </b>
  232. </p>
  233. </div>
  234. </a>
  235. </div>
  236. </div>";
  237. }
  238. }else{
  239. echo "<h1>".$strMensaje."</h1>";
  240. } ?>
  241. </div>
  242. </div>
  243. <!-- /.row -->
  244. <br><br>
  245. </div> <!-- termina col-8 -->
  246. </div>
  247. </div>
  248. <script type="text/javascript">
  249. //<![CDATA[
  250. if (typeof HIB == 'object' && typeof HIB.infiniteScroll == 'object' && typeof HIB.infiniteScroll.init == 'function') {
  251. HIB.infiniteScroll.init('.products-grid', 1000);
  252. }
  253. //]]>
  254. </script>
  255. </main>
  256. <aside>
  257. </aside>
  258. <script type="text/javascript">
  259. //<![CDATA[
  260. if (typeof HIB == 'object' && typeof HIB.filter == 'object' && typeof HIB.filter.init == 'function') {
  261. HIB.filter.init();
  262. }
  263. //]]>
  264. </script>
  265. </main>
  266. </div>
  267. </div>
  268. </div>
  269. <style>
  270. .bar {
  271. height: 30px!important;
  272. }
  273. </style>
  274. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.js"></script>
  275. <script type="text/javascript">
  276. var $j = jQuery.noConflict();
  277. </script>
  278. <script type="text/javascript" src="js/search.js"></script>
  279. <script>
  280. $j('.loader').on("click",function(e){
  281. e.preventDefault();
  282. var usersid = $j(this).attr("id");
  283. var cont = usersid.split('-');
  284. var href = $j(this).attr('href');
  285. $j('#img-'+cont[1]).show();
  286. setTimeout(function(){
  287. $j('#img-'+cont[1]).hide();
  288. }, 1000);
  289. window.location.href = href;
  290. });
  291. </script>
  292. <!-- aqui va el footer -->
  293. <?php
  294. // cerrar conexión de base de datos
  295. mysqli_close( $conexion );
  296. include 'footer.php' ?>
  297. </div>
  298. </div>
  299. </body>
  300. </html>