Advertisement
Guest User

Untitled

a guest
May 30th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.24 KB | None | 0 0
  1. <div class="div_grande">
  2. <?php
  3. if (!mysqli_set_charset($conn, "utf8")) {
  4. printf("Error loading character set utf8: %sn", mysqli_error($link));
  5. exit();
  6. } else {
  7. $sql = "SELECT idr, nome, video, img1, img2, img3, img4, img5, img6, telefone, morada, descricao, site FROM restaurantes WHERE fk_lingua = $idl AND fk_distrito = 3";
  8. }
  9. $result = $conn->query($sql);
  10.  
  11. if ($result->num_rows > 0) {
  12. // output data of each row
  13. while($row = $result->fetch_assoc()) {
  14. $id = $row['idr']; ?>
  15. <div class="conteudo_cima" id="conteudo_cima">
  16. <iframe class="img_cima" src="<?php echo $row['video']; ?>" allowfullscreen=1 frameBorder=0></iframe>
  17. <div class="texto">
  18. <h1><?php echo $row['nome']."<br>";?></h1>
  19. <?php echo $row['descricao']."<br>";?>
  20. <?php echo $row['morada']."<br>";?>
  21. <?php echo $row['telefone']."<br>";?>
  22. <a href="http://<?php echo $row['site'];?>" target="_blank"><?php echo $row['site'];?></a>
  23. </div>
  24. <div class="seta">
  25. <img id="trigger" src="imagens/expand.png" onclick="abreInfo(event, <?php echo $id; ?>)">
  26. </div>
  27. </div>
  28. <div class="expand" id="<?php echo $id; ?>">
  29. <div class="video">
  30. <iframe src="<?php echo $row['video']; ?>" allowfullscreen=1 frameBorder=0></iframe>
  31. </div>
  32. <div class="galeria">
  33. <div><img src="<?= $row['img1'] ?>" ></div>
  34. <div><img src="<?= $row['img2'] ?>" ></div>
  35. <div><img src="<?= $row['img3'] ?>" ></div>
  36. <div><img src="<?= $row['img4'] ?>" ></div>
  37. <div><img src="<?= $row['img5'] ?>" ></div>
  38. <div><img src="<?= $row['img6'] ?>" ></div>
  39. </div>
  40. <div class="fundo_expand">
  41. <div class="texto_expand">
  42. <h1><?php echo $row['nome']."<br>";?></h1>
  43. <?php echo $row['descricao']."<br>";?>
  44. <?php echo $row['morada']."<br>";?>
  45. <?php echo $row['telefone']."<br>";?>
  46. <a href="http://<?php echo $row['site'];?>" target="_blank"><?php echo $row['site']."<br><br>";?></a>
  47. </div>
  48. <div class="seta_expand">
  49. <img id="trigger_expand" src="imagens/encolher.png" onclick="abreInfo(event, <?php echo $id; ?>)">
  50. </div>
  51. </div>
  52. </div>
  53. <?php }
  54. } else {
  55. echo "Sem resultados disponíveis!";
  56. }
  57. ?>
  58. </div>
  59.  
  60. <script>
  61. function abreInfo(event, id){
  62. event.preventDefault();
  63. $("#"+id).toggle("slow");
  64. }
  65. $(document).ready(function(){
  66. $("#trigger").click(function(){
  67. $("#conteudo_cima").css("display", "none");
  68. });
  69. });
  70. $(document).ready(function(){
  71. $("#trigger_expand").click(function(){
  72. $("#conteudo_cima").css("display", "block");
  73. });
  74. });
  75. </script>
  76. <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
  77. <script type="text/javascript" src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
  78. <script type="text/javascript" src="slick/slick.min.js"></script>
  79. <script type="text/javascript">
  80. $('.galeria').slick({
  81. dots: true,
  82. infinite: true,
  83. speed: 1000,
  84. autoplay:true,
  85. autoplaySpeed: 1200,
  86. arrows:true,
  87. slidesToShow: 1,
  88. slidesToScroll: 1
  89. });
  90. </script>
  91.  
  92. .left_corpo .bottom_left_corpo{
  93. background-color: rgba(0,0,0,0.3);
  94. height: 75%;
  95. width: 100%;
  96. margin-top: 1%;
  97. }
  98. .bottom_left_corpo .div_grande{
  99. position: relative;
  100. height: 100%;
  101. width: 100%;
  102. overflow-y: scroll;
  103. }
  104. .div_grande .conteudo_cima{
  105. text-transform: uppercase;
  106. color: white;
  107. font-size: 1vw;
  108. position: relative;
  109. height: 30%;
  110. width: 98%;
  111. margin-left: 1%;
  112. margin-top: 1%;
  113. white-space: nowrap;
  114. display: block;
  115. }
  116. .conteudo_cima .img_cima{
  117. position: relative;
  118. display: inline-block;
  119. height: 100%;
  120. width: 20%;
  121. }
  122. .conteudo_cima .texto{
  123. /*background-color: red;*/
  124. position: absolute;
  125. display: inline-block;
  126. height: 100%;
  127. width: 70%;
  128. margin-left: 0;
  129. margin-top: 0;
  130. text-shadow: 1px 1px 1px #000;
  131. overflow:hidden;
  132. }
  133. .conteudo_cima h1{
  134. font-size: 1.5vw;
  135. margin-top: 0;
  136. }
  137. .conteudo_cima .seta{
  138. /*background-color: blue;*/
  139. position: absolute;
  140. display: inline-block;
  141. height: 100%;
  142. width: 10%;
  143. margin-left: 70%;
  144. }
  145. .conteudo_cima .seta #trigger{
  146. height: 30%;
  147. width: 50%;
  148. margin-top: 50%;
  149. margin-left: 20%;
  150. cursor: pointer;
  151. }
  152. .expand{
  153. text-transform: uppercase;
  154. color: white;
  155. font-size: 1vw;
  156. position: relative;
  157. width: 98%;
  158. margin-left: 1%;
  159. display: none;
  160. white-space: nowrap;
  161. }
  162. .expand .video{
  163. position: relative;
  164. height: 100%;
  165. width: 40%;
  166. margin-top: 1%;
  167. display: inline-block;
  168. }
  169. .expand .video iframe{
  170. height: 200px;
  171. width: 100%;
  172. }
  173. .expand .galeria{
  174. position: relative;
  175. height: 100%;
  176. width: 40%;
  177. display: inline-block;
  178. margin-left: 15%;
  179. }
  180. .expand .galeria img{
  181. height: 200px;
  182. width: 80%;
  183. margin-left: 10%;
  184. }
  185. .expand .fundo_expand{
  186. position: relative;
  187. width: 100%;
  188. white-space: nowrap;
  189. }
  190. .expand .texto_expand{
  191. position: relative;
  192. height: 100%;
  193. width: 90%;
  194. margin-left: 0;
  195. text-shadow: 2px 2px 2px #000;
  196. overflow:hidden;
  197. display: inline-block;
  198. }
  199. .expand h1{
  200. font-size: 1.5vw;
  201. margin-top: 0;
  202. }
  203. .expand .seta_expand{
  204. position: relative;
  205. display: inline-block;
  206. height: 100%;
  207. width: 10%;
  208. }
  209. .expand .seta_expand #trigger_expand{
  210. height: 30%;
  211. width: 50%;
  212. margin-top: 40%;
  213. margin-left: 11%;
  214. cursor: pointer;
  215. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement