Advertisement
Guest User

Untitled

a guest
May 4th, 2013
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.86 KB | None | 0 0
  1. <?php
  2.  
  3. header('Content-Type: text/html; charset=utf-8');
  4.  
  5. require_once "config.php"; // inclui a conexão a database
  6.  
  7. $produtos = 0;
  8. $produtos_subcategoria = 0;
  9.  
  10. echo "
  11. <html>
  12. <head>
  13.  
  14. <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"favicon.ico\" />
  15.  
  16. ";
  17.  
  18. $sql = mysql_query("SELECT nome_imagem FROM imagem_background");
  19.  
  20. $result = mysql_fetch_row($sql);
  21.  
  22. echo"
  23. <style type=\"text/css\">
  24. body {
  25. background-image:url('./background/$result[0]');
  26. background-size:100% 100%;
  27. background-position: 50% 50%;
  28. background-repeat: no-repeat;
  29. margin-top: 0px;
  30. margin-right: 0;
  31. margin-left: 0;
  32. margin-bottom: 0;
  33. }
  34.  
  35. .text {
  36. font-family: Georgia, serif
  37. font-size: 10px;
  38. color: #33CC33;
  39. opacity:1;
  40. filter:alpha(opacity=100);
  41. -moz-opacity:1;
  42. -khtml-opacity:1;
  43. }
  44.  
  45. p {
  46. font-family: Georgia, serif
  47. }
  48.  
  49. .transparent {
  50. /* Fallback for web browsers that doesn't support RGBa */
  51. background: rgb(246, 246, 246);
  52. /* RGBa with 0.6 opacity */
  53. background: rgba(246, 246, 246, 0.8);
  54. /* For IE 5.5 - 7*/
  55. filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#70000000, endColorstr=#99000000);
  56. /* For IE 8*/
  57. -ms-filter: \"progid:DXImageTransform.Microsoft.gradient(startColorstr=#70000000, endColorstr=#99000000)\";
  58. }
  59. ";
  60.  
  61. // Barra de scroll
  62. echo"
  63. .divId {
  64. width: 280px;
  65. height: 175px;
  66. overflow: auto
  67. }
  68.  
  69. a:link {
  70. color:#FFFFFF; /* unvisited link */
  71. text-decoration:none;
  72. }
  73.  
  74. a:visited {
  75. color:#FFFFFF; /* visited link */
  76. text-decoration:none;
  77. }
  78.  
  79. a:hover /* mouse over link */
  80. {
  81. color:#FFFFFF;
  82. text-decoration:none;
  83. }
  84.  
  85. a:active {
  86. color:#FFFFFF; /* selected link */
  87. text-decoration:none;
  88. }
  89.  
  90. a.menu:link {
  91. color:#8B0000; /* unvisited link */
  92. text-decoration:none;
  93. }
  94.  
  95. a.menu:visited {
  96. color:#8B0000; /* visited link */
  97. text-decoration:none;
  98. }
  99.  
  100. a.menu:hover /* mouse over link */
  101. {
  102. color:#8B0000;
  103. text-decoration:none;
  104. }
  105.  
  106. a.menu:active {
  107. color:#8B0000; /* selected link */
  108. text-decoration:none;
  109. }
  110.  
  111. a.tooltip2:link {
  112. color:#000000; /* unvisited link */
  113. text-decoration:none;
  114. }
  115.  
  116. a.tooltip2:visited {
  117. color:#000000; /* visited link */
  118. text-decoration:none;
  119. }
  120.  
  121. a.tooltip2:hover /* mouse over link */
  122. {
  123. color:#000000;
  124. text-decoration:none;
  125. }
  126.  
  127. a.tooltip2:active {
  128. color:#000000; /* selected link */
  129. text-decoration:none;
  130. }
  131.  
  132.  
  133. div.footer {
  134. bottom:0;
  135. width:100%;
  136. }
  137.  
  138. #NT_copy {
  139. background-color: #333333;
  140. color: #FFFFFF;
  141. font-weight: bold;
  142. font-size: 13px;
  143. font-family: \"Trebuchet MS\";
  144. width: 900px;
  145. left: 0;
  146. top: 0;
  147. padding: 4px;
  148.  
  149. position: fixed;
  150. top: 20%;
  151. left: 50%;
  152. margin-left: -450px;
  153.  
  154. text-align: left;
  155. z-index: 20;
  156. -moz-border-radius: 0 10px 10px 10px;
  157. filter: progid: DXImageTransform.Microsoft.Alpha(opacity=87);
  158. -moz-opacity: .87;
  159. -khtml-opacity:.87;
  160. opacity:.87;
  161. }
  162. </style>
  163.  
  164. <script src=\"js/jquery-1.3.2.min.js\" type=\"text/javascript\"></script>
  165. <script src=\"js/ntip.js\" type=\"text/javascript\"></script>
  166.  
  167. <title>Produtos</title>
  168. </head>
  169.  
  170. <body>
  171.  
  172. <table width=\"100%\" bgcolor=\"#000000\" cellpadding=\"0\" cellspacing=\"0\">
  173. <tr>
  174. <td align=\"center\" height=\"40\">
  175.  
  176. <table width=\"1000\" align=\"center\" bgcolor=\"#000000\" cellpadding=\"0\" cellspacing=\"0\">
  177. <tr>
  178. <td width=\"188\">
  179. <img src=\"./uploads/partial_logo1.jpg\" height=\"80\" width=\"188\">
  180. </td>
  181. <td width=\"812\" align=\"center\">
  182. <font color=\"#FFFFFF\" size=\"+1\"><p><a href=\"empresa_portugues.php\"> Empresa</a> &nbsp; | &nbsp; <a href=\"produtos_portugues.php\" class=\"menu\"> Produtos</a> &nbsp; | &nbsp; <a href=\"processo_produtivo_portugues.php\">Processo Produtivo</a> &nbsp; | &nbsp; <a href=\"qualidade_portugues.php\">Qualidade</a> &nbsp; | &nbsp; <a href=\"parceria_portugues.php\">Parceria</a> &nbsp; | &nbsp; <a href=\"contactos_portugues.php\">Contatos</a></p></font>
  183. </td>
  184. </tr>
  185. </table>
  186. </td>
  187. </tr>
  188. </table>
  189.  
  190. <table width=\"1000\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
  191. <tr>
  192. <td>
  193. <table cellpadding=\"0\" cellspacing=\"0\">
  194. <tr>
  195. <td width=\"188\">
  196. <img src=\"./uploads/partial_logo2.jpg\" height=\"29\" width=\"188\">
  197. </td>
  198. <td width=\"812\"></td>
  199. </tr>
  200. </table>
  201. </td>
  202. </tr>
  203. </table>
  204.  
  205. <table width=\"1000\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"transparent\">
  206. <tr>
  207. <td width=\"188\">
  208. <img src=\"./uploads/partial_logo3.png\" height=\"94\" width=\"188\">
  209. </td>
  210. <td width=\"812\"></td>
  211. </tr>
  212. </table>
  213.  
  214. <table width=\"1000\" align=\"center\" bgcolor=\"#f6f6f6\" class=\"transparent\" cellpadding=\"0\" cellspacing=\"0\">
  215. <tr>
  216. <td width=\"200\"></td>
  217. <td width=\"800\">
  218. <font size=\"+3\"><b><p>Produtos</p></b></font>
  219. </td>
  220. </tr>
  221. </table>
  222.  
  223. <table width=\"1000\" align=\"center\" bgcolor=\"#f6f6f6\" class=\"transparent\" cellpadding=\"0\" cellspacing=\"0\">
  224. <tr>
  225. <td height=\"30\">
  226. </td>
  227. </tr>
  228. </table>
  229. ";
  230.  
  231. // $sql = mysql_query("SELECT nome_imagem FROM imagem_background");
  232.  
  233. // $result = mysql_fetch_row($sql);
  234.  
  235. $sql2 = mysql_query("SELECT nome_categoria FROM categoria_portugues_prod");
  236.  
  237. echo"
  238. <table width=\"1000\" align=\"center\" bgcolor=\"#f6f6f6\" class=\"transparent\" cellpadding=\"10\" cellspacing=\"0\">
  239. ";
  240.  
  241. // De 3 em 3 Produtos criar uma nova linha <tr>
  242. // se $produtos = 0 cria <tr>
  243.  
  244. if($produtos == 0)
  245. {
  246. echo"
  247. <tr>
  248. ";
  249. }
  250.  
  251. while (($result2 = mysql_fetch_array($sql2)) != null) // nome_categoria
  252. {
  253. $produtos = $produtos + 1;
  254.  
  255. echo "<td width=\"33%\" valign=\"top\">";
  256.  
  257. echo "<div align=\"center\"><font size=\"+1\"><p><b>$result2[0]</b></p></font></div></br>"; // nome_categoria
  258.  
  259. $sql3 = mysql_query("SELECT id FROM categoria_portugues_prod WHERE nome_categoria='$result2[0]'");
  260.  
  261. $result3 = mysql_fetch_row($sql3); // id_categoria
  262.  
  263. $sql4 = mysql_query("SELECT nome_imagem FROM subcategoria_portugues_prod WHERE id_categoria='$result3[0]'");
  264.  
  265. $result4 = mysql_fetch_row($sql4); // nome_imagem
  266.  
  267. $sql5 = mysql_query("SELECT descricao FROM categoria_portugues_prod WHERE id='$result3[0]'");
  268.  
  269. $result5 = mysql_fetch_row($sql5); // descricao
  270.  
  271. echo"
  272. <div align=\"center\">
  273. <span class=\"formInfo\">
  274. <img src=\"./produtos/subcategoria_portugues/$result4[0]\" width=\"100\" height=\"180\">"; // imagem
  275.  
  276. // tabela subcategorias deve ter só um <td> como a tabela de categorias
  277.  
  278. echo"
  279. <span style=\"display: none;\" class=\"mycontent\">
  280. ";
  281.  
  282. // Tabela Subcategorias
  283.  
  284. $sql6 = mysql_query("SELECT nome_subcategoria FROM subcategoria_portugues_prod WHERE id_categoria='$result3[0]'");
  285.  
  286. echo "
  287. <table width=\"900\" align=\"center\" bgcolor=\"#f6f6f6\" class=\"transparent\" cellpadding=\"10\" cellspacing=\"10\">
  288. ";
  289.  
  290. if($produtos_subcategoria == 0)
  291. {
  292. echo"
  293. <tr>
  294. ";
  295. }
  296.  
  297. while (($result6 = mysql_fetch_array($sql6)) != null) // nome_subcategoria
  298. {
  299. $produtos_subcategoria = $produtos_subcategoria + 1;
  300.  
  301. echo "<td width=\"25%\" valign=\"top\">";
  302.  
  303. echo "<div align=\"center\"><font size=\"+1\"><p><b>$result6[0]</b></p></font></div></br>"; // nome_subcategoria
  304.  
  305.  
  306. $sql7 = mysql_query("SELECT nome_imagem FROM subcategoria_portugues_prod WHERE id_categoria='$result3[0]'");
  307.  
  308. $result7 = mysql_fetch_row($sql7); // nome_imagem
  309.  
  310. echo"
  311. <div align=\"center\">
  312. <img src=\"./produtos/subcategoria_portugues/$result7[0]\" width=\"100\" height=\"180\">"; // imagem
  313.  
  314. $sql8 = mysql_query("SELECT descricao FROM subcategoria_portugues_prod WHERE id_categoria='$result3[0]'");
  315.  
  316. $result8 = mysql_fetch_row($sql8); // descricao (ficha tecnica)
  317.  
  318. echo"
  319. <div align=\"center\">
  320. <a href=\"./produtos/subcategoria_portugues/$result8[0]\" class=\"tooltip2\">Ficha Técnica</a>"; // ficha tecnica
  321. echo "
  322. </div>
  323. ";
  324.  
  325. /*
  326. // não deve criar quando $produtos_subcategoria = 2
  327. if($produtos_subcategoria < 2)
  328. {
  329. echo"
  330. <td align=\"center\">
  331. <img src=\"./uploads/separator.png\" width=\"10\" height=\"100%\">
  332. </td>
  333. ";
  334. }
  335. */
  336.  
  337. // se $produtos_subcategoria == 2 faz reset
  338. if($produtos_subcategoria == 2)
  339. {
  340. $produtos_subcategoria = 0;
  341. }
  342.  
  343. if($produtos_subcategoria == 0)
  344. {
  345. echo "
  346. </td>
  347. </tr>
  348. ";
  349. }
  350. }
  351.  
  352. echo"
  353. </td>
  354. </tr>
  355. </table>
  356. </span>
  357. </span>
  358. </div>
  359. </br>
  360. <div class=\"divID\">
  361. $result5[0]"; // descricao
  362. echo "
  363. </div>
  364. ";
  365.  
  366. echo"
  367. </br></br>
  368. ";
  369.  
  370. // não deve criar quando $produtos = 3
  371. if($produtos < 3)
  372. {
  373. echo"
  374. <td align=\"center\">
  375. <img src=\"./uploads/separator.png\" width=\"10\" height=\"100%\">
  376. </td>
  377. ";
  378. }
  379.  
  380. // se $produtos == 3 faz reset
  381. if($produtos == 3)
  382. {
  383. $produtos = 0;
  384. }
  385.  
  386. if($produtos == 0)
  387. {
  388. echo "
  389. </td>
  390. </tr>
  391. ";
  392. }
  393. }
  394.  
  395. echo"
  396. </td>
  397. </tr>
  398. </table>
  399.  
  400. <table width=\"1000\" align=\"center\" bgcolor=\"#f6f6f6\" class=\"transparent\" cellpadding=\"0\" cellspacing=\"0\">
  401. <tr>
  402. <td height=\"30\">
  403. </td>
  404. </tr>
  405. </table>
  406.  
  407. <div class=\"footer\">
  408. <table width=\"100%\" height=\"30\" cellpadding=\"10\">
  409. <tr>
  410. <td align=\"right\" valign=\"middle\">
  411. ";
  412. // <img src=\"./uploads/Powered by.png\" alt=\"logo\">
  413. echo"
  414. </td>
  415. </tr>
  416. </table>
  417. </div>
  418.  
  419. <script type=\"text/javascript\">
  420. $(document).ready(function(){
  421. $(\".formInfo\").tooltip(
  422. {
  423. tooltipcontentclass:\"mycontent\"
  424. }
  425. )
  426. });;
  427. </script>
  428.  
  429. <script type=\"text/javascript\">
  430. $(\".formInfo\").tooltip({
  431. events: {
  432. def: 'click, dblclick',
  433. }
  434. });
  435. </script>
  436.  
  437. </body>
  438. </html>
  439. ";
  440. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement