<?php 

require_once('shared/conexionBD.php');

//definimos utf8 encode

mysqli_query($conexion,"SET NAMES utf8");



$queryPannel = " SELECT * FROM ITT_ASW_HTEC WHERE CATE = 'cp' ORDER BY idht ";

$ress = mysqli_query($conexion, $queryPannel ) or die ( "ERROR #002 AL OBTENER LOS PANELES");

$panels = array();

while ($datos = mysqli_fetch_array( $ress) )

{

  $panels[] = $datos;

}



// funcion para extraer el contenido de cada panel

function info_panel($conexion,$id){

  $queryBanner = "SELECT i.id_1,i.titu,i.arch,t.cate FROM ITT_ASW_HINF i,ITT_ASW_HTEC t WHERE i.id_1 = t.idht AND i.id_1 = ".$id." AND t.cate = 'cp' ORDER BY i.titu ";

  $ress = mysqli_query($conexion, $queryBanner ) or die ( "ERROR #003 AL OBTENER LA INFORMACIÓN DE LOS PANELES");

  $info = array();

  while ($datos2 = mysqli_fetch_array( $ress) )

  {

    $info[] = $datos2;

  }



  return $info;

}



?>



<!DOCTYPE html>

<!--[if IE 8 ]>    <html xml:lang="es" lang="es" class="no-js ie8"> <![endif]-->

<!--[if IE 9 ]>    <html xml:lang="es" lang="es" class="no-js ie9"> <![endif]-->

<html xml:lang="es" lang="es">



<meta http-equiv="content-type" content="text/html;charset=UTF-8" />

<head>

<!-- Global site tag (gtag.js) - Google Analytics -->



    <!--Pruebas-->

    <!-- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-125019062-1"></script> -->

    <!--Producción-->

    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-125019062-2"></script>

    <!--Pruebas-->

    <!-- <script>



          window.dataLayer = window.dataLayer || [];



          function gtag(){dataLayer.push(arguments);}



          gtag('js', new Date());



          gtag('config', 'UA-125019062-1');



    </script> -->

    <!--Producción-->

    <script>



        window.dataLayer = window.dataLayer || [];



        function gtag(){dataLayer.push(arguments);}



        gtag('js', new Date());



        gtag('config', 'UA-125019062-2');



    </script>



    <!-- End Global site tag (gtag.js) - Google Analytics -->

  <!-- [if IE]> -->

  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>

  <meta http-equiv="cleartype" content="on"/>

  <!-- <![endif] -->



  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>

  <title>Hojas Técnicas – S&amp;P</title>

  <meta name="description" content="Todo lo que debes saber de la producción, distribución y logística de S&amp;P, sistemas de ventilación residenciales, comerciales e industriales."/>

  <meta name="keywords" content="Magento, Varien, E-commerce"/>

  <meta name="robots" content="INDEX,FOLLOW"/>

  <link rel="icon" href="https://statics.solerpalau.com/skin/frontend/solerpalau/default/favicon.ico" type="image/x-icon"/>

  <link rel="shortcut icon" href="https://statics.solerpalau.com/skin/frontend/solerpalau/default/favicon.ico" type="image/x-icon"/>

  <meta name="theme-color" content="#ffffff">

  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.js"></script>

  <script type="text/javascript">

   var $j = jQuery.noConflict();

 </script>



 <script type="text/javascript" src="js/events.js"></script>



 <!-- estilo princripal -->

 <link rel="stylesheet" type="text/css" href="css/style-css01.css" media="all" />

 </head>

<body class=" cms-page-view cms-produccion-distribucion-logistica level-2 customer-logged-out">

  <!-- aqui va el header -->

  <?php include 'header.php' ?>



  <script type="text/javascript">

    //<![CDATA[

    if (typeof HIB.menu == 'object' && typeof HIB.menu.init == 'function') {

      HIB.menu.init();

    }

    //]]>

  </script>

  <div class="main-container col1-layout">

    <div class="breadcrumbs">

      <div class="container">

        <ul xmlns:v="http://rdf.data-vocabulary.org/#">

          <li class="">

            <a>Recursos</a>

          </li>

        </ul>

      </div>

    </div>

    <div class="main">

      <div class="col-main">

        <main>

          <div id="overlaySearch" class="overlay">

            <!-- Overlay content -->

            <div id="searchResults" class="overlay-content grid"></div>

          </div>

          <div class="std">

            <div class="page-title dark">

              <img alt="Hojas Técnicas" src="media/home/categories_home/recursos/hojas-tecnicas.jpg" />

              <div class="page-title-container">

                <div class="page-title-content container">

                  <h1 class="h1">Hojas Técnicas</h1>

                </div>

              </div>

              <div class="clearfix">&nbsp;</div> </div>

              <br>



              <div class="container grid container-margin ">

                <div class="listado hcol-10-12 md-hcol-10-12 mobile-hcol-1-1 just">

                  <p class="m-bottom20">En nuestras hojas técnicas encontrarás toda la información que necesitas para resolver cualquier duda sobre <b>ventilación y ventiladores.</b></p> 



                  <p class="m-bottom20">Cada una de estas fichas se acompaña de ilustraciones y tablas con el objetivo de complementar la explicación.</p> 



                  <p class="m-bottom20">Los cálculos realizados para las instalaciones se han llevado a cabo conforme a la legislación Española.</p>

                </div>

                <br>

                <div class="container grid m-bottom40 ">

                  <!-- pruebas de BD -->

                  <?php 





                  $t = 0;

                  foreach ($panels as $panel):

                    $c = count(info_panel($conexion,$panel['IDHT']));



                    ?>

                    <?php if ($panel['TAMN'] == 2):

                      $columna = $panel['COLM'];

                      ?>

                      <!-- paneles de 3 columnas  -->

                      <div class="container grid" style="background: #f5f5f5">

                        <center>

                          <img class="img-htecnicas-b" src="<?php echo $panel['ICON'] ?>" >

                          <p class="h2-2"><b><?php echo $panel['TITU']; ?></b></p>

                        </center>

                        <!-- comienza cuerpo -->



                        <?php if ($columna == 1) {

                         echo "<div class='hcol-12-12 m-hcol-6-12 mobil-hcol-1-1'>";

                         echo " <ul class='links'>";

                         echo "<center>";

                         foreach (info_panel($conexion,$panel['IDHT']) as $key => $value) {

                           // if ($key < floor($c/2)) {

                          echo "<li><a class='caso_practico' href='".$value['arch']."' target='_blank' title='".$value['titu']."'>".$value['titu']."</a></li>";

                          // }

                        }

                        echo "</center>";

                        echo "</ul>";

                        echo "</div>";

                      }

                      if ($columna == 2) {

                       echo "<div class='hcol-6-12 m-hcol-6-12 mobil-hcol-1-1'>";

                       echo " <ul class='links'>";

                       echo "<center>";

                       foreach (info_panel($conexion,$panel['IDHT']) as $key => $value) {

                         if ($key < floor($c/2)) {

                          echo "<li><a class='caso_practico' href='".$value['arch']."' target='_blank' title='".$value['titu']."'>".$value['titu']."</a></li>";

                        }

                      }

                      echo "</center>";

                      echo "</ul>";

                      echo "</div>";

                      //segunda columna

                      echo "<div class='hcol-6-12 m-hcol-6-12 mobil-hcol-1-1'>";

                      echo " <ul class='links'>";

                      echo "<center>";

                      foreach (info_panel($conexion,$panel['IDHT']) as $key => $value) {

                       if ($key >= floor($c/2)) {

                        echo "<li><a class='caso_practico' href='".$value['arch']."' target='_blank' title='".$value['titu']."'>".$value['titu']."</a></li>";

                      }

                    }

                    echo "</center>";

                    echo "</ul>";

                    echo "</div>";

                  }

                  if ($columna == 3) {

                   echo "<div class='hcol-4-12 m-hcol-4-12 mobil-hcol-1-1'>";

                   echo " <ul class='links'>";

                   echo "<center>";

                   foreach (info_panel($conexion,$panel['IDHT']) as $key => $value) {

                     if ($key < ceil($c/3)) {

                      echo "<li><a class='caso_practico' href='".$value['arch']."' target='_blank' title='".$value['titu']."'>".$value['titu']."</a></li>";

                    }

                  }

                  echo "</center>";

                  echo "</ul>";

                  echo "</div>";

                      //segunda columna

                  echo "<div class='hcol-4-12 m-hcol-4-12 mobil-hcol-1-1'>";

                  echo " <ul class='links'>";

                  echo "<center>";

                  foreach (info_panel($conexion,$panel['IDHT']) as $key => $value) {

                    if ($key >= ceil($c/3)  && $key < ceil($c/3)*2) {

                      echo "<li><a class='caso_practico' href='".$value['arch']."' target='_blank' title='".$value['titu']."'>".$value['titu']."</a></li>";

                    }

                  }

                  echo "</center>";

                  echo "</ul>";

                  echo "</div>";

                      //tercera columna

                  echo "<div class='hcol-4-12 m-hcol-4-12 mobil-hcol-1-1'>";

                  echo " <ul class='links'>";

                  echo "<center>";

                  foreach (info_panel($conexion,$panel['IDHT']) as $key => $value) {



                   if ($key >= ceil($c/3)  && $key >= ceil($c/3)*2) {

                    echo "<li><a class='caso_practico' href='".$value['arch']."' target='_blank' title='".$value['titu']."'>".$value['titu']."</a></li>";

                  }

                }

                echo "</center>";

                echo "</ul>";

                echo "</div>";

              }

              if ($columna == 4) {

               echo "<div class='hcol-3-12 m-hcol-3-12 mobil-hcol-1-1'>";

               echo " <ul class='links'>";

               echo "<center>";

               $cont = 0;

               foreach (info_panel($conexion,$panel['IDHT']) as $key => $value) {

                 if ($key < ceil($c/4)) {

                  echo "<li><a class='caso_practico' href='".$value['arch']."' target='_blank' title='".$value['titu']."'>".$value['titu']."</a></li>";

                  $cont++;

                }

              }

              echo "</center>";

              echo "</ul>";

              echo "</div>";

            //segunda columna

              echo "<div class='hcol-3-12 m-hcol-3-12 mobil-hcol-1-1'>";

              echo " <ul class='links'>";

              echo "<center>";

              foreach (info_panel($conexion,$panel['IDHT']) as $key => $value) {

               if ($key >= $cont && $key < ceil($c/4)*2) {

                echo "<li><a class='caso_practico' href='".$value['arch']."' target='_blank' title='".$value['titu']."'>".$value['titu']."</a></li>";

                $cont++;

                

              }

            }

            echo "</center>";

            echo "</ul>";

            echo "</div>";

            //Tercer columna

            echo "<div class='hcol-3-12 m-hcol-3-12 mobil-hcol-1-1'>";

            echo " <ul class='links'>";

            echo "<center>";

            foreach (info_panel($conexion,$panel['IDHT']) as $key => $value) {

             if ($key >= $cont && $key < ceil($c/4)*3) {

              echo "<li><a class='caso_practico' href='".$value['arch']."' target='_blank' title='".$value['titu']."'>".$value['titu']."</a></li>";

              $cont++;

            }

          }

          echo "</center>";

          echo "</ul>";

          echo "</div>";

            //cuarta columna

          echo "<div class='hcol-3-12 m-hcol-3-12 mobil-hcol-1-1'>";

          echo " <ul class='links'>";

          echo "<center>";

          foreach (info_panel($conexion,$panel['IDHT']) as $key => $value) {

           if ($key >= $cont && $key < ceil($c/4)*4) {

            echo "<li><a class='caso_practico' href='".$value['arch']."' target='_blank' title='".$value['titu']."'>".$value['titu']."</a></li>";

          }

        }

        echo "</center>";

        echo "</ul>";

        echo "</div>";

            //unset($cont);



      } ?>





      <!-- </div> -->

      <!-- imprimir contenIDHTo de los paneles -->

      <?php

                      // echo "Contador: <br>".floor($c/2);



                 /*  echo "<div class='hcol-1-4 m-hcol-1-4 mobil-hcol-1-1 '>";

                   echo " <ul class='links'>";

                   foreach (info_panel($conexion,$panel['IDHT']) as $key => $value) {

                    if ($key < floor($c/2)) {

                     echo "<li><a href='".$value['arch']."' target='_blank' title='".$value['titu']."'>".$value['titu']."</a></li>";

                   }

                 }

                 echo "</ul>";

                 echo "</div>";



                 echo "<div class='hcol-1-4 m-hcol-1-4 mobil-hcol-1-1'>";

                 echo " <ul class='links'>";

                 foreach (info_panel($conexion,$panel['IDHT']) as $key => $value) {

                  if ($key >= floor($c/2)) {



                   echo "<li><a href='".$value['arch']."' target='_blank' title='".$value['titu']."'>".$value['titu']."</a></li>";

                 }

               }

               echo "</ul>";

               echo "</div>";*/



               ?>



               <!-- <div class="hcol-1-4 m-hcol-1-4 mobil-hcol-1-1">

               </div> -->

             </div>

             <br>

           <?php endif; ?>

           <?php if ($panel['TAMN'] == 1):

            ?>

            <!-- Paneles de 1 columna -->

            <div class="hcol-1-3 m-hcol-1-3 mobil-hcol-1-1 ">

              <div class="grid-pad hojas-t-panels-2" style="background: #f5f5f5">

                <center><img class="img-htecnicas" src="<?php echo $panel['ICON'] ?>" ></center>

                <p><b class="hojas-t h2-2"><center><?php echo $panel['TITU']; ?></center></b></p>

                <center>

                  <ul class="links hojas-t">

                    <!-- imprimir contenido de los paneles -->

                    <?php 

                    foreach (info_panel($conexion,$panel['IDHT']) as $key => $value) {

                      echo "<li><a class='caso_practico' href='".$value['arch']."' target='_blank' title='".$value['titu']."'>".$value['titu']."</a></li>";

                    }

                    ?>

                  </ul>

                </center>

              </div>

            </div>

          <?php endif; ?>

        <?php endforeach; ?>



      </div>

    </div>

  </div>                  



</main>

</div>

</div>

</div>





<!-- aqui va el footer -->

<?php include 'footer.php' ?>





</div>

</div>

</body>



</html>

