catalogosearch.php 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <?php
  2. if (isset($_GET['pbusqueda'])) {
  3. $Pbusqueda = $_GET['pbusqueda'];
  4. //echo $Pbusqueda
  5. }else{
  6. header('Location: 404.php');
  7. }
  8. ?>
  9. <!DOCTYPE html>
  10. <!--[if IE 8 ]> <html xml:lang="es" lang="es" class="no-js ie8"> <![endif]-->
  11. <!--[if IE 9 ]> <html xml:lang="es" lang="es" class="no-js ie9"> <![endif]-->
  12. <html xml:lang="es" lang="es">
  13. <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  14. <head>
  15. <!-- Global site tag (gtag.js) - Google Analytics -->
  16. <!--Producción-->
  17. <script async src="https://www.googletagmanager.com/gtag/js?id=UA-125019062-2"></script>
  18. <!--Producción-->
  19. <script>
  20. window.dataLayer = window.dataLayer || [];
  21. function gtag(){dataLayer.push(arguments);}
  22. gtag('js', new Date());
  23. gtag('config', 'UA-125019062-2');
  24. </script>
  25. <!-- End Global site tag (gtag.js) - Google Analytics -->
  26. <!-- [if IE]> -->
  27. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  28. <meta http-equiv="cleartype" content="on"/>
  29. <!-- <![endif] -->
  30. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  31. <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  32. <title>Resultados de búsqueda</title>
  33. <meta name="keywords" content="Magento, Varien, E-commerce"/>
  34. <meta name="robots" content="INDEX,FOLLOW"/>
  35. <link rel="icon" href="https://statics.solerpalau.com/skin/frontend/solerpalau/default/favicon.ico" type="image/x-icon"/>
  36. <link rel="shortcut icon" href="https://statics.solerpalau.com/skin/frontend/solerpalau/default/favicon.ico" type="image/x-icon"/>
  37. <meta name="theme-color" content="#ffffff">
  38. <!-- bootstrap 4 -->
  39. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  40. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.js"></script>
  41. <script type="text/javascript">
  42. var $j = jQuery.noConflict();
  43. </script>
  44. <script type="text/javascript" src="js/events.js"></script>
  45. <!-- estilo princripal -->
  46. <link rel="stylesheet" type="text/css" href="css/style-css01.css" media="all" />
  47. </head>
  48. <body class=" cms-page-view cms-produccion-distribucion-logistica level-2 customer-logged-out">
  49. <!-- aqui va el header -->
  50. <?php include 'header.php' ?>
  51. <script type="text/javascript">
  52. //<![CDATA[
  53. if (typeof HIB.menu == 'object' && typeof HIB.menu.init == 'function') {
  54. HIB.menu.init();
  55. }
  56. //]]>
  57. </script>
  58. <div class="main-container col1-layout">
  59. <div class="breadcrumbs">
  60. <div class="container">
  61. <ul xmlns:v="http://rdf.data-vocabulary.org/#">
  62. <li class="0" typeof="v:Breadcrumb">
  63. <a href="index.php"
  64. title="Inicio"
  65. rel="v:url" property="v:title">
  66. Inicio</a>
  67. <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>
  68. <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;
  69. <li class="2">
  70. <a href="#">Resultados de búsqueda</a>
  71. </li>
  72. </ul>
  73. </div>
  74. </div>
  75. <div class="main">
  76. <div class="col-main">
  77. <main>
  78. <div id="overlaySearch" class="overlay">
  79. <!-- Overlay content -->
  80. <div id="searchResults" class="overlay-content grid"></div>
  81. </div><div class="std">
  82. <div class="page-title category-title dark">
  83. <img src="https://statics.solerpalau.com/media//wysiwyg/post-venta/postventaslider1.png" alt="Search results">
  84. <div class="category-title-container">
  85. <div class="category-title-content container">
  86. <h1 class="h1">Resultados de búsqueda</h1>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="container grid">
  91. <div class="row">
  92. <?php
  93. $minus = strtolower($Pbusqueda); // Se transforma todas las letras a minúsculas
  94. $query =" SELECT ID,LINEA,MODELO,SUBMODELO ";
  95. $query .=" FROM ITT_ALP_GLOBAL ";
  96. $query .=" WHERE MODELO <> 'Refacciones' AND MODELO <> 'MOTORES' AND MODELO <> 'TRANSMISIONES' AND (lower(LINEA) LIKE '%".$minus."%' OR lower(MODELO) LIKE '%".$minus."%' OR lower(SUBMODELO) LIKE '%".$minus."%') ";
  97. $resultadoM = mysqli_query($conexion, $query ) or die ( "Ups!, parece que algo ha ido mal con la búsqueda");
  98. $modeloDatosA = array();
  99. $arrIds = array();
  100. $rutaImagenCompleta = "";
  101. $rutaImagen = 'ALP/';
  102. $ContarItemsdevueltos = 0;
  103. while ($columnaM = mysqli_fetch_array( $resultadoM) )
  104. {
  105. $ContarItemsdevueltos = count($columnaM);
  106. $linea = $columnaM['LINEA'];
  107. $modelo = $columnaM['MODELO'];
  108. //echo $modelo;
  109. $submodelo = $columnaM['SUBMODELO'];
  110. $modeloDatosA[] = $columnaM['SUBMODELO'];
  111. //revisar las imagenes
  112. $imagen = $columnaM['ID'].".jpg";
  113. $fichero = $rutaImagen.$imagen;
  114. if (file_exists($fichero)) {
  115. //comprobar si el archivo existe en la carpeta ALP
  116. $rutaImagenCompleta = "ALP/".$imagen;;
  117. }
  118. else{
  119. //si no existe dejar imagen por default
  120. $rutaImagenCompleta = 'media/noimagen.jpg';
  121. }
  122. if (empty($columnaM['LINEA'])) {
  123. echo "<p>No se han encontrado resultados de búsqueda</p>";
  124. }
  125. $queryGet = 'linea='.urlencode($linea).'&modelo='.urlencode($modelo).'&submodelo='.urlencode($submodelo);
  126. ?>
  127. <div class="col-md-4">
  128. <div class="card hp-100">
  129. <p class="text-center producto">
  130. <a href="producto.php?<?php echo(htmlentities($queryGet)) ?>" title="<?php echo $submodelo ?>" >
  131. <img id="img-producto" src="<?php echo $rutaImagenCompleta ?>"
  132. alt="<?php echo $submodelo ?>" />
  133. </a> </p>
  134. <div class="product-info">
  135. <a href="" title="<?php echo $modelo ?>">
  136. <p class="text-center">
  137. <b><?php echo $submodelo ?> </b>
  138. </p>
  139. </a>
  140. </div>
  141. </div>
  142. </div>
  143. <?php
  144. }
  145. ////////////////////////////////
  146. // Calculadora de atenuadores //
  147. ////////////////////////////////
  148. $string = 'calculadora de atenuadores';
  149. if(!stristr($string, $Pbusqueda) === FALSE) {
  150. echo " <div class='col-md-4'>
  151. <div class='card hp-100'>
  152. <p class='text-center producto'>
  153. <a href='atenuadores.php' title='Calculadora' >";
  154. echo "<svg aria-hidden='true' style='max-width: 150px; max-height: 150px;' 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>
  155. ";
  156. echo " </a> </p>
  157. <div class='product-info'>
  158. <a href=' title='Calculadora'>
  159. <p class='text-center'>
  160. <b>Selecciona tu atenuador</b>
  161. </p>
  162. </a>
  163. </div>
  164. </div>
  165. </div>";
  166. }
  167. if ($ContarItemsdevueltos == 0) {
  168. echo "<p><strong>No se han encontrado coincidencias...</strong></p>";
  169. } ?>
  170. </div>
  171. <br><br>
  172. </div>
  173. <div class="line"></div>
  174. </div>
  175. </div>
  176. </main>
  177. </div>
  178. </div>
  179. </div>
  180. <!-- aqui va el footer -->
  181. <?php include 'footer.php' ?>
  182. </script>
  183. </div>
  184. </div>
  185. </body>
  186. </html>