producto.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. <?php
  2. require_once('shared/conexionBD.php');
  3. // Desactivar toda notificación de error
  4. error_reporting(0);
  5. $title = $_GET["submodelo"];
  6. /*
  7. Se obtienen la linea, el modelo y el submodelo del producto
  8. */
  9. if (isset($_GET['linea']) && isset($_GET['modelo']) && isset($_GET['submodelo'])) {
  10. $lineaGet = htmlentities($_GET['linea']);
  11. $articulo = htmlentities($_GET['modelo']);
  12. $submodelo = htmlentities($_GET['submodelo']);
  13. }
  14. /*
  15. Si no se obtiene ningún dato, entonces mandará a un 404
  16. */
  17. if (empty($lineaGet) || empty($articulo) || empty($submodelo)) {
  18. header('Location: 404.php');
  19. }
  20. /*
  21. Se obtienen datos de a base de datos según su modelo
  22. */
  23. mysqli_query($conexion,"SET NAMES utf8");
  24. $easyventUrl = '';
  25. $queryS = "SELECT DESCRIPCION,ID,EASYVENTURL FROM ITT_ALP_GLOBAL WHERE SUBMODELO='".html_entity_decode($submodelo)."' ";
  26. $resultado = mysqli_query($conexion, $queryS );
  27. if($resultado) {
  28. if(mysqli_num_rows($resultado)>0) {
  29. $descripcion= '';
  30. $rutaImagen = 'ALP/';
  31. $rutaImagenCompleta = '';
  32. //Hacemos la consulta
  33. $rowDatos = mysqli_fetch_assoc($resultado);
  34. $descripcion = $rowDatos['DESCRIPCION'];
  35. $id = $rowDatos['ID'];
  36. $easyventUrl = $rowDatos['EASYVENTURL'];
  37. //revisar las imagenes
  38. $imagen = $rowDatos['ID'].'.jpg';
  39. $fichero = $rutaImagen.$imagen;
  40. //comprobar si el archivo existe en la carpeta ALP
  41. $imagen = (file_exists($fichero)) ? $rutaImagenCompleta = $fichero : $rutaImagenCompleta = 'media/noimagen.jpg' ;
  42. }else{
  43. $strMensaje = 'Este producto aún no tiene información disponible, intente más tarde. :) ';
  44. }
  45. }else{
  46. $strMensaje = 'No se pudo realizar la consulta en la Base de datos, favor de reportar este problema.';
  47. }
  48. $queryArchivos = "SELECT * FROM ITT_ASW_PROD WHERE SUBM=UPPER('".html_entity_decode($submodelo)."') ";
  49. $resultadoArchivos = mysqli_query($conexion, $queryArchivos );
  50. $arrArchivos = array();
  51. if($resultadoArchivos) {
  52. if((mysqli_num_rows($resultadoArchivos)>0)) {
  53. while ($row = mysqli_fetch_array($resultadoArchivos,MYSQLI_ASSOC)) { $arrArchivos[] = $row;}
  54. }
  55. }else{
  56. $strMensaje = 'No se pudo realizar la consulta en la Base de datos, favor de reportar este problema.';
  57. }
  58. ///////////////////////////////////////
  59. // Buscamos imagenes para corrrousel //
  60. ///////////////////////////////////////
  61. // Ruta del directorio donde están los archivos
  62. $path = 'ALP/';
  63. // Arreglo con todos los nombres de los archivos
  64. $files = array_diff(scandir($path), array('.', '..'));
  65. //Filtramos por ID
  66. $searchId = $id.'-';
  67. $arrImgsCarrousel = array_filter($files, function ($obj) use ($searchId) {
  68. return (stripos($obj, $searchId) !== false) ? true: false ;
  69. });
  70. ?>
  71. <!DOCTYPE html>
  72. <html xml:lang="es" lang="es">
  73. <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  74. <head>
  75. <!-- Global site tag (gtag.js) - Google Analytics -->
  76. <!--Producción-->
  77. <script async src="https://www.googletagmanager.com/gtag/js?id=UA-125019062-2"></script>
  78. <!--Producción-->
  79. <script>
  80. window.dataLayer = window.dataLayer || [];
  81. function gtag(){dataLayer.push(arguments);}
  82. gtag('js', new Date());
  83. gtag('config', 'UA-125019062-2');
  84. </script>
  85. <!-- End Global site tag (gtag.js) - Google Analytics -->
  86. <!-- [if IE]> -->
  87. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  88. <meta http-equiv="cleartype" content="on"/>
  89. <!-- <![endif] -->
  90. <meta content="width=device-width, initial-scale=1" name="viewport"/>
  91. <title><?php echo $title;?> – S&amp;P</title>
  92. <meta name="keywords" content="Varien, E-commerce"/>
  93. <meta name="robots" content="INDEX,FOLLOW"/>
  94. <link rel="icon" href="https://statics.solerpalau.com/skin/frontend/solerpalau/default/favicon.ico" type="image/x-icon"/>
  95. <!-- ================================================================================ -->
  96. <script type="text/javascript" src="js/events.js"></script>
  97. <script>
  98. var easyventUrl = '<?php echo html_entity_decode($easyventUrl) ?>';
  99. var modeloGlobal = '<?php echo html_entity_decode($articulo)?>';
  100. var submodelo = '<?php echo html_entity_decode($submodelo)?>';
  101. </script>
  102. <!-- ================================================================================ -->
  103. <link rel="stylesheet" type="text/css" href="css/style-css01.css" media="all" />
  104. <!-- ================================================================================ -->
  105. <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  106. <link href="css/flexslider.css" rel="stylesheet">
  107. <!-- ================================================================================ -->
  108. </head>
  109. <body class=" cms-page-view cms-produccion-distribucion-logistica level-2 customer-logged-out">
  110. <?php include 'header.php' ?>
  111. <script type="text/javascript">
  112. //<![CDATA[
  113. if (typeof HIB.menu == 'object' && typeof HIB.menu.init == 'function') {
  114. HIB.menu.init();
  115. }
  116. //]]>
  117. </script>
  118. <div class="main-container col1-layout">
  119. <div class="breadcrumbs">
  120. <div class="container">
  121. <ul xmlns:v="https://rdf.data-vocabulary.org/#">
  122. <li class="0" typeof="v:Breadcrumb">
  123. <a href="index.php" title="Inicio" rel="v:url" property="v:title">Inicio</a>
  124. <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>
  125. <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>
  126. </li>
  127. <li class="1" typeof="v:Breadcrumb">
  128. <a href="linea.php?linea=<?php echo $lineaGet ?>">División <?php echo $lineaGet; ?></a>
  129. <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>
  130. <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>
  131. </li>
  132. <li class="2">
  133. <a href="modelo.php?linea=<?php echo $lineaGet ?>&modelo=<?php echo $articulo; ?>" title="<?php echo $articulo; ?>"><?php echo $articulo;?></a>
  134. </li>
  135. <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>
  136. <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>
  137. <li class="3">
  138. <a><?php echo $submodelo ?></a>
  139. </li>
  140. </ul>
  141. </div>
  142. </div>
  143. <div class="main">
  144. <div class="col-main">
  145. <main>
  146. <div id="overlaySearch" class="overlay">
  147. <!-- Overlay content -->
  148. <div id="searchResults" class="overlay-content grid"></div>
  149. </div>
  150. <main>
  151. <div class="page-title category-title dark">
  152. <img src="media/home/categories_home/<?php if(file_exists("media/home/categories_home/".$lineaGet.".jpg")) {
  153. echo($lineaGet);
  154. } else {
  155. echo('Habitat');
  156. } ?>.jpg" alt="<?php echo($lineaGet); ?>" class="category-image" />
  157. <div class="category-title-container">
  158. <div class="category-title-content container">
  159. <h2 class="seriesTitle m-top10"><?php echo html_entity_decode($articulo); ?><br>
  160. <b>Serie <?php echo($submodelo); ?></b>
  161. </h2>
  162. </div>
  163. </div>
  164. <div class="clearfix"></div>
  165. </div>
  166. <input type="hidden" id="idProducto" value=" <?php echo $id; ?>">
  167. <?php if (!empty($id)){ ?>
  168. <div class="container grid">
  169. <div class="hcol-4-12 m-hcol-4-12 mobil-hcol-1-12">
  170. <div class="grid">
  171. <center>
  172. <?php if (!empty($arrImgsCarrousel)) { ?>
  173. <div class="flexslider">
  174. <ul class="slides">
  175. <!-- Imprimimos la imagen principal -->
  176. <li data-thumb="<?php echo $imagen ?>">
  177. <img src="<?php echo $imagen ?>" />
  178. </li>
  179. <!-- Imprimimos imagenes secundarias -->
  180. <?php foreach ($arrImgsCarrousel as $imgDir) {
  181. $img = 'ALP/'.$imgDir;
  182. echo "<li data-thumb='".$img."'> <img src='".$img."' /> </li>";
  183. }?>
  184. </ul>
  185. </div>
  186. <?php } else { ?>
  187. <img class="img-producto" src="<?php echo $imagen; ?>" alt="<?php echo $submodelo ?>" />
  188. <?php } ?>
  189. <div class="text-center" style="margin-top: 10px;">
  190. <button type="button" id="ver-3d" class="btn btn-default" style="display:none;">
  191. <i class="fa fa-cube" aria-hidden="true" ></i>
  192. <span>Ver modelo 3D</span>
  193. </button>
  194. </div>
  195. </center>
  196. </div>
  197. </div>
  198. <div class="hcol-8-12 m-hcol-8-12 mobil-hcol-1-12">
  199. <div class="grid just m-bottom50 ">
  200. <div class="tab">
  201. <button class="tablinks active">DESCRIPCIÓN</button>
  202. </div>
  203. <div id="descripcion" class="tabcontent m-bottom10">
  204. <p><?php echo $descripcion; ?></p>
  205. </div>
  206. <?php
  207. // Filtramos los datos para ver solo fichas técnicas
  208. $arrFichaTecnica = array_filter($arrArchivos, function ($obj) use ($search) {
  209. if ($obj['ARCH_FICH'] !== '') {
  210. return true;
  211. }
  212. return false;
  213. });?>
  214. <?php if (!empty($arrFichaTecnica)): ?>
  215. <?php if ($arrFichaTecnica[0]['ARCH_FICH'] != ''){ ?>
  216. <div id="archivos" class="m-bottom10 ">
  217. <a href="<?php echo $arrFichaTecnica[0]['ARCH_FICH'] ?>" target="_blank" type="button" id="ficha" class="btn btn-default a-btn">
  218. <i class="fa fa-envelope" aria-hidden="true" ></i>
  219. <span>DESCARGAR FICHA TÉCNICA</span>
  220. </a>
  221. </div>
  222. <?php } endif; ?>
  223. <?php if ($arrArchivos[0]['ARCH_CAD'] != '' ||
  224. $arrArchivos[0]['ARCH_ZIP'] != '' ||
  225. $arrArchivos[0]['ARCH_OTR'] != ''):
  226. ?>
  227. <div id="dimension" style="padding: 10px;">
  228. <table class="display nowrap table table-hover table-striped dt-responsive no-wrap" style="width:100%">
  229. <thead>
  230. <tr>
  231. <th>VERSIONES</th>
  232. <th>AUTOCAD</th>
  233. <th>ZIP</th>
  234. <th>OTROS FORMATOS</th>
  235. </tr>
  236. </thead>
  237. <tbody>
  238. <?php foreach ($arrArchivos as $key => $dato) {
  239. echo "<tr>";
  240. echo "<td>".$dato['MODELO']."</td>";
  241. echo "<td>";
  242. if (!empty($dato['ARCH_CAD'])) {
  243. echo "<a href='".$dato['ARCH_CAD']."' target='_blank'>";
  244. echo "<i class='fa fa-file-text fa-2x' style='color: #ff5c64;'></i>";
  245. echo "</a>";
  246. }
  247. echo "</td>";
  248. echo "<td>";
  249. if (!empty($dato['ARCH_ZIP'])) {
  250. echo "<a href='".$dato['ARCH_ZIP']."' target='_blank'>";
  251. echo "<i class='fa fa-file-text fa-2x' style='color: #ff5c64;'></i>";
  252. echo "</a>";
  253. }
  254. echo "</td>";
  255. echo "<td>";
  256. if (!empty($dato['ARCH_OTR'])) {
  257. echo "<a href='".$dato['ARCH_OTR']."' target='_blank'>";
  258. echo "<i class='fa fa-file-text fa-2x' style='color: #ff5c64;'></i>";
  259. echo "</a>";
  260. }
  261. echo "</td>";
  262. echo "</tr>";
  263. } ?>
  264. </tbody>
  265. </table>
  266. </div>
  267. <?php endif ?>
  268. </div>
  269. </div>
  270. </div>
  271. <div class="container grid">
  272. <div class="hcol-12-12 m-hcol-12-12 mobil-hcol-1-12">
  273. <div class="grid m-bottom10">
  274. <div id="cerrar3d" align="right" style="display: none">
  275. <button style="background: gainsboro;margin-right:100px" type="button" class="btn btn-default"><i class="fa fa-times"></i> <span>Cerrar</span></button>
  276. </div>
  277. <center>
  278. <div id="modelo3d">
  279. <div id="cargando" style="display: none">
  280. <img src="media/img/loader2.gif" alt="Cargando" width="100px">
  281. <p style="padding: 5px">Cargando modelo ...</p>
  282. </div>
  283. </div>
  284. </center>
  285. </div>
  286. </div>
  287. </div>
  288. <!-- aqui se carga la tabla -->
  289. <div id="tabla" style="margin-bottom: 10px;">
  290. <div id="cargando" style="display: block">
  291. <center>
  292. <img src="media/img/loader2.gif" alt="Cargando" width="100px">
  293. <p style="padding: 5px">Cargando tabla ...</p>
  294. </center>
  295. </div>
  296. </div>
  297. <div class="section grid">
  298. <div class="col-sm-12" id="comparador"></div>
  299. </div>
  300. <!-- URL PRIMER ITEM -->
  301. <input type="hidden" id="urlItem1" value="" />
  302. <!-- validacion si no mandamos nada por url -->
  303. <?php }else{ ?>
  304. <div class="container grid">
  305. <div class="hcol-12-12 m-hcol-12-12 mobil-hcol-1-12">
  306. <h3><?php echo($strMensaje); ?></h3>
  307. </div>
  308. </div>
  309. <?php } ?>
  310. <style>
  311. #dimension {
  312. height:250px;
  313. overflow: auto;
  314. }
  315. #dimension table thead tr th,table tbody tr td {
  316. font-size: 14px;
  317. font-weight: bold;
  318. text-align: center;
  319. }
  320. /* Style the tab */
  321. .tab {
  322. overflow: hidden;
  323. border-bottom: 1px solid #ccc;
  324. padding: 5px;
  325. }
  326. /* Style the buttons inside the tab */
  327. .tab button {
  328. background-color: inherit;
  329. float: left;
  330. border: none;
  331. outline: none;
  332. padding: 14px 16px;
  333. transition: 0.1s;
  334. font-size: 17px;
  335. margin: 7px;
  336. color: #969696;
  337. }
  338. /* Change background color of buttons on hover */
  339. .tab button:hover {
  340. /*background-color: #ddd;*/
  341. border-bottom: 3px solid #4b4b4b;
  342. color:black;
  343. }
  344. /* Create an active/current tablink class */
  345. .tab button.active {
  346. border-bottom: 3px solid #4b4b4b;
  347. color:black;
  348. }
  349. /* Style the tab content */
  350. .tabcontent {
  351. display: none;
  352. padding: 25px;
  353. border: 1px solid #ccc;
  354. border-top: none;
  355. }
  356. .tabcontent p {
  357. font-size: 14px;
  358. }
  359. /*---------------------------------------*/
  360. select.input-sm {
  361. line-height: 0px !important;
  362. font-size: 14px !important;
  363. }
  364. #ficha {
  365. background: cornflowerblue;
  366. height: 37px;
  367. border-radius: 0px!important;
  368. transition: background 0.3s ease 0s;
  369. color:white;
  370. }
  371. #ver-3d {
  372. background: cornflowerblue;
  373. height: 34px;
  374. transition: background 0.3s ease 0s;
  375. }
  376. #ver-3d:hover,#ficha:hover {
  377. background: #4673c5;
  378. color: #fff;
  379. }
  380. #tblSeriesModels_info {
  381. margin-bottom: 20px!important;
  382. }
  383. .a-btn{
  384. font-size: 1.6rem !important;
  385. height: 36px;
  386. background: transparent none repeat scroll 0% 0%;
  387. padding-top: 11px !important;
  388. padding-bottom: 0px !important;
  389. }
  390. </style>
  391. </main>
  392. <aside></aside>
  393. <script type="text/javascript">
  394. //<![CDATA[
  395. if (typeof HIB == 'object' && typeof HIB.filter == 'object' && typeof HIB.filter.init == 'function') {
  396. HIB.filter.init();
  397. }
  398. //]]>
  399. </script>
  400. </main>
  401. </div>
  402. </div>
  403. </div>
  404. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.js"></script>
  405. <script src="https://cdnjs.cloudflare.com/ajax/libs/flexslider/2.7.2/jquery.flexslider.js"></script>
  406. <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css" media="all" />
  407. <link rel="stylesheet" type="text/css" href="css/responsive.dataTables.min.css" media="all" />
  408. <link rel="stylesheet" type="text/css" href="css/style-table.css" media="all" />
  409. <script src="js/jquery.dataTables.min.js"></script>
  410. <script src="js/dataTables.bootstrap.min.js"></script>
  411. <script src="js/dataTables.responsive.min.js"></script>
  412. <script type="text/javascript">
  413. var $j = jQuery.noConflict();
  414. document.getElementById('descripcion').style.display = "block";
  415. // -----------------------TABS---------------
  416. var cargando = document.getElementById('cargando');
  417. var url = easyventUrl;
  418. var idProducto = document.getElementById('idProducto').value;
  419. $j('.flexslider').flexslider({
  420. animation: "slide",
  421. controlNav: "thumbnails"
  422. });
  423. if(url != ""){
  424. getTable(url);
  425. }else{
  426. $j('#tabla').html('<div class="h2-2" style="text-align:center"></div>');
  427. }
  428. // Se obtienen los datos de la tabla
  429. function getTable($url) {
  430. $j.ajax({
  431. url: 'comparador.php',
  432. type: 'POST',
  433. data: {
  434. table: url,
  435. id: idProducto
  436. },
  437. success: function (respuesta) {
  438. $j('#tabla').html(respuesta);
  439. if (respuesta != "") {
  440. cargando.style.display = 'none';
  441. $j('html,body').animate({ scrollTop: $j("#tabla").offset().top }, 'slow');
  442. $j.getScript("js/controlador-js.js");
  443. }
  444. }, error: function () {
  445. cargando.style.display = 'none';
  446. }
  447. });
  448. }
  449. </script>
  450. <?php include 'footer.php' ?>
  451. </div>
  452. </div>
  453. </body>
  454. </html>