Advertisement
Guest User

Untitled

a guest
Jun 8th, 2013
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <title>RevelioninRomania.ro</title>
  4. <link rel="shortcut icon" type="image/x-icon" href="images/animated_favicon1.gif">
  5. <link rel="stylesheet" type="text/css" href="css/style.css">
  6. </head>
  7. <body>
  8.  
  9. <!--<div class="body">-->
  10. <!-- Meniu -->
  11. <tr><td style="vertical-align:top">
  12. <ul class="menu">
  13.   <li><a href="http://localhost/site/index.php" class="active"><span><b>Cauta oferta</b></span></a></li>
  14.   <li><a href="http://localhost/site/adauga.php"><span><b>Adauga oferta</b></span></a></li>
  15.   <li><a href="http://localhost/site/contact.php"><span><b>Contact</b></span></a></li>
  16. </ul>
  17. </tr></td>
  18.  
  19. </br>
  20. </br>
  21. </br>
  22.  
  23. <span class="right">
  24. </br>
  25.  
  26. <!-- Formular cautare -->
  27. <div id="stylized" class="myform">
  28. <form action="index.php" method="POST">
  29. <h1>Cauta oferta ta de revelion</h1>
  30. <p>Selecteaza unde vrei sa petreci revelionul 2013 - 2014</p>
  31.  
  32. <label>Localitate
  33. <span class="small">Tastati numele orasului.</span>
  34. </label>
  35. <input style="width:170px" type="text" name="termeni" id="termeni" />
  36.  
  37. <label>Judet
  38. <span class="small">Selectati judetul.</span>
  39. </label>
  40. <select style="width:180px" name="judet">
  41.                 <option value="0">Toate judetele</option>
  42.                 <option value="Alba">Alba</option>
  43.                 <option value="Arad">Arad</option>
  44.                 <option value="Arges">Arges</option>
  45.                 <option value="Bacau">Bacau</option>
  46.                 <option value="Bihor">Bihor</option>
  47.                 <option value="Bistrita-Nasaud">Bistrita-Nasaud</option>
  48.                 <option value="Botosani">Botosani</option>
  49.                 <option value="Braila">Braila</option>
  50.                 <option value="Brasov">Brasov</option>
  51.                 <option value="Bucuresti">Bucuresti</option>
  52.                 <option value="Buzau">Buzau</option>
  53.                 <option value="Caras-Severin">Caras-Severin</option>
  54.                 <option value="Cluj">Cluj</option>
  55.                 <option value="Constanta">Constanta</option>
  56.                 <option value="Covasna">Covasna</option>
  57.                 <option value="Dambovita">Dambovita</option>
  58.                 <option value="Dolj">Dolj</option>
  59.                 <option value="Galati">Galati</option>
  60.                 <option value="Gorj">Gorj</option>
  61.                 <option value="Harghita">Harghita</option>
  62.                 <option value="Hunedoara">Hunedoara</option>
  63.                 <option value="Ialomita">Ialomita</option>
  64.                 <option value="Iasi">Iasi</option>
  65.                 <option value="Ilfov">Ilfov</option>
  66.                 <option value="Maramures">Maramures</option>
  67.                 <option value="Mehedinti">Mehedinti</option>
  68.                 <option value="Mures">Mures</option>
  69.                 <option value="Neamt">Neamt</option>
  70.                 <option value="Prahova">Prahova</option>
  71.                 <option value="Salaj">Salaj</option>
  72.                 <option value="Satu Mare">Satu Mare</option>
  73.                 <option value="Sibiu">Sibiu</option>
  74.                 <option value="Suceava">Suceava</option>
  75.                 <option value="Timis">Timis</option>
  76.                 <option value="Tulcea">Tulcea</option>
  77.                 <option value="Valcea">Valcea</option>
  78.                 <option value="Vrancea">Vrancea</option>
  79. </select>
  80. </br>
  81.  
  82. <label>Categorie
  83. <span class="small">Selectati categoria.</span>
  84. </label>
  85. <select style="width:180px" name="tip">
  86.                     <option value="0">Toate categoriile</option>
  87.                     <option value="Restaurant">Restaurant</option>
  88.                     <option value="Pensiune">Pensiune</option>
  89.                     <option value="Club">Club</option>
  90.                     <option value="Hotel">Hotel</option>
  91. </select>
  92. </br>
  93.  
  94. <button type="submit" name="cauta">Vezi oferte</button>
  95. <div class="spacer"></div>
  96. <input type="hidden" name="search" value="true" />
  97. </div>
  98. </form>
  99. </br>
  100. </br>
  101. </br>
  102. </br>
  103. </br>
  104. </br>
  105.  
  106. </span>
  107. <span class="left">
  108. <a href="http://localhost/site/index.php"><img src="images/revelioninromania.png" align="right"/></a>
  109. </span>
  110. <?php
  111. if (isset($_POST['search'])) {
  112.     $termeni = mysql_real_escape_string($_POST['termeni']);
  113.     $tip     = $_POST['tip'];
  114.     $judet   = $_POST['judet'];
  115.    
  116.    
  117.     // Cautare in baza de date
  118.     // Cautare dupa: Localitate, Judet, Categorie
  119.     if ((!empty($termeni)) and (isset($tip)) and (isset($judet))) {
  120.         require_once("mysql_connect.php");
  121.         $query = "SELECT * FROM oferte WHERE localitate LIKE '%$termeni%' AND tip_locatie='$tip' AND judet='$judet'";
  122.        
  123.         $resulta = mysql_query($query) or die(mysql_error());
  124.         if (mysql_num_rows($resulta) > 0) {
  125. ?>
  126.                        </br>
  127.                         </br>
  128.                         </br>
  129.                         <center>
  130.                         <table class="CSSTableGenerator">
  131.                             <tr>
  132.                                 <th>Denumire</th>
  133.                                 <th>Tip</th>
  134.                                 <th>Judet</th>
  135.                                 <th>Localitate</th>
  136.                             </tr>
  137.                     <?php
  138.             while ($result = mysql_fetch_array($resulta)) {
  139.                 echo "<tr>";
  140.                 echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
  141.                 echo "\t\t<td>{$result['tip_locatie']}</td>\n";
  142.                 echo "\t\t<td>{$result['judet']}</td>\n";
  143.                 echo "\t\t<td>{$result['localitate']}</td>\n";
  144.                 echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
  145.                 echo "</tr>";
  146.             }
  147.             echo "</table>";
  148.             echo "</center>";
  149.         }
  150.     }
  151.     // Cautare dupa: Categorie
  152.     elseif (isset($tip)) {
  153.         require_once("mysql_connect.php");
  154.         $query = "SELECT * FROM oferte WHERE tip_locatie='$tip'";
  155.        
  156.         $resulta = mysql_query($query) or die(mysql_error());
  157.         if (mysql_num_rows($resulta) > 0) {
  158. ?>
  159.                        <br />
  160.                         <br />
  161.                         <br />
  162.                         <center>
  163.                         <table class="CSSTableGenerator">
  164.                             <tr>
  165.                                 <th>Denumire</th>
  166.                                 <th>Tip</th>
  167.                                 <th>Judet</th>
  168.                                 <th>Localitate</th>
  169.                             </tr>        
  170.                     <?php
  171.             while ($result = mysql_fetch_array($resulta)) {
  172.                 echo "<tr>";
  173.                 echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
  174.                 echo "\t\t<td>{$result['tip_locatie']}</td>\n";
  175.                 echo "\t\t<td>{$result['judet']}</td>\n";
  176.                 echo "\t\t<td>{$result['localitate']}</td>\n";
  177.                 echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
  178.                 echo "</tr>";
  179.                
  180.             }
  181.             echo "</table>";
  182.             echo "</center>";
  183.         }
  184.     }
  185.     // Cautare dupa: Judet
  186.         elseif (isset($judet)) {
  187.         require_once("mysql_connect.php");
  188.         $query = "SELECT * FROM oferte WHERE judet='$judet'";
  189.        
  190.         $resulta = mysql_query($query) or die(mysql_error());
  191.         if (mysql_num_rows($resulta) > 0) {
  192. ?>
  193.                        <br />
  194.                         <br />
  195.                         <br />
  196.                         <center>
  197.                         <table class="CSSTableGenerator">
  198.                             <tr>
  199.                                 <th>Denumire</th>
  200.                                 <th>Tip</th>
  201.                                 <th>Judet</th>
  202.                                 <th>Localitate</th>
  203.                             </tr>
  204.                        
  205.                        
  206.                    
  207.                     <?php
  208.             while ($result = mysql_fetch_array($resulta)) {
  209.                 echo "<tr>";
  210.                 echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
  211.                 echo "\t\t<td>{$result['tip_locatie']}</td>\n";
  212.                 echo "\t\t<td>{$result['judet']}</td>\n";
  213.                 echo "\t\t<td>{$result['localitate']}</td>\n";
  214.                 echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
  215.                 echo "</tr>";
  216.                
  217.             }
  218.             echo "</table>";
  219.             echo "</center>";
  220.         }
  221.     }
  222.     // Cautare dupa: Localitate
  223.         elseif (!empty($termeni)) {
  224.         require_once("mysql_connect.php");
  225.         $query = "SELECT * FROM oferte WHERE localitate LIKE '%$termeni%'";
  226.        
  227.         $resulta = mysql_query($query) or die(mysql_error());
  228.         if (mysql_num_rows($resulta) > 0) {
  229. ?>
  230.                        <br />
  231.                         <br />
  232.                         <br />
  233.                         <center>
  234.                         <table class="CSSTableGenerator">
  235.                             <tr>
  236.                                 <th>Denumire</th>
  237.                                 <th>Tip</th>
  238.                                 <th>Judet</th>
  239.                                 <th>Localitate</th>
  240.                             </tr>                
  241.                     <?php
  242.             while ($result = mysql_fetch_array($resulta)) {
  243.                 echo "<tr>";
  244.                 echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
  245.                 echo "\t\t<td>{$result['tip_locatie']}</td>\n";
  246.                 echo "\t\t<td>{$result['judet']}</td>\n";
  247.                 echo "\t\t<td>{$result['localitate']}</td>\n";
  248.                 echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
  249.                 echo "</tr>";
  250.                
  251.             }
  252.             echo "</table>";
  253.             echo "</center>";
  254.         }
  255.     }
  256.     // Cautare dupa: Localitate, Judet
  257.         elseif (!empty($termeni) AND (isset($judet))) {
  258.         require_once("mysql_connect.php");
  259.         $query = "SELECT * FROM oferte WHERE localitate LIKE '%$termeni%' AND judet='$judet'";
  260.        
  261.         $resulta = mysql_query($query) or die(mysql_error());
  262.         if (mysql_num_rows($resulta) > 0) {
  263. ?>
  264.                        <br />
  265.                         <br />
  266.                         <br />
  267.                         <center>
  268.                         <table class="CSSTableGenerator">
  269.                             <tr>
  270.                                 <th>Denumire</th>
  271.                                 <th>Tip</th>
  272.                                 <th>Judet</th>
  273.                                 <th>Localitate</th>
  274.                             </tr>
  275.                     <?php
  276.             while ($result = mysql_fetch_array($resulta)) {
  277.                 echo "<tr>";
  278.                 echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
  279.                 echo "\t\t<td>{$result['tip_locatie']}</td>\n";
  280.                 echo "\t\t<td>{$result['judet']}</td>\n";
  281.                 echo "\t\t<td>{$result['localitate']}</td>\n";
  282.                 echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
  283.                 echo "</tr>";
  284.                
  285.             }
  286.             echo "</table>";
  287.             echo "</center>";
  288.         }
  289.     }
  290.     // Cautare dupa: Localitate, Categorie
  291.         elseif (!empty($termeni) AND (isset($tip))) {
  292.         require_once("mysql_connect.php");
  293.         $query = "SELECT * FROM oferte WHERE localitate LIKE '%$termeni%' AND tip_locatie='$tip'";
  294.        
  295.         $resulta = mysql_query($query) or die(mysql_error());
  296.         if (mysql_num_rows($resulta) > 0) {
  297. ?>
  298.                        <br />
  299.                         <br />
  300.                         <br />
  301.                         <center>
  302.                         <table class="CSSTableGenerator">
  303.                             <tr>
  304.                                 <th>Denumire</th>
  305.                                 <th>Tip</th>
  306.                                 <th>Judet</th>
  307.                                 <th>Localitate</th>
  308.                             </tr>
  309.                     <?php
  310.             while ($result = mysql_fetch_array($resulta)) {
  311.                 echo "<tr>";
  312.                 echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
  313.                 echo "\t\t<td>{$result['tip_locatie']}</td>\n";
  314.                 echo "\t\t<td>{$result['judet']}</td>\n";
  315.                 echo "\t\t<td>{$result['localitate']}</td>\n";
  316.                 echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
  317.                 echo "</tr>";
  318.                
  319.             }
  320.             echo "</table>";
  321.             echo "</center>";
  322.         }
  323.     }
  324.     // Cautare dupa: Judet, Categorie
  325.         elseif ((isset($judet)) AND (isset($tip))) {
  326.         require_once("mysql_connect.php");
  327.         $query = "SELECT * FROM oferte WHERE judet='$judet' AND tip_locatie='$tip'";
  328.        
  329.         $resulta = mysql_query($query) or die(mysql_error());
  330.         if (mysql_num_rows($resulta) > 0) {
  331. ?>
  332.                        <br />
  333.                         <br />
  334.                         <br />
  335.                         <center>
  336.                         <table class="CSSTableGenerator">
  337.                             <tr>
  338.                                 <th>Denumire</th>
  339.                                 <th>Tip</th>
  340.                                 <th>Judet</th>
  341.                                 <th>Localitate</th>
  342.                             </tr>
  343.                     <?php
  344.             while ($result = mysql_fetch_array($resulta)) {
  345.                 echo "<tr>";
  346.                 echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
  347.                 echo "\t\t<td>{$result['tip_locatie']}</td>\n";
  348.                 echo "\t\t<td>{$result['judet']}</td>\n";
  349.                 echo "\t\t<td>{$result['localitate']}</td>\n";
  350.                 echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
  351.                 echo "</tr>";
  352.                
  353.             }
  354.             echo "</table>";
  355.             echo "</center>";
  356.         }
  357.     }
  358.     // Cautare dupa: Toate categoriile
  359.         elseif ((!isset($judet)) AND (!isset($tip)) AND (empty($termeni))) {
  360.         require_once("mysql_connect.php");
  361.         $query = "SELECT * FROM oferte";
  362.        
  363.         $resulta = mysql_query($query) or die(mysql_error());
  364.         if (mysql_num_rows($resulta) > 0) {
  365. ?>
  366.                        <br />
  367.                         <br />
  368.                         <br />
  369.                         <center>
  370.                         <table class="CSSTableGenerator">
  371.                             <tr>
  372.                                 <th>Denumire</th>
  373.                                 <th>Tip</th>
  374.                                 <th>Judet</th>
  375.                                 <th>Localitate</th>
  376.                             </tr>
  377.                     <?php
  378.             while ($result = mysql_fetch_array($resulta)) {
  379.                 echo "<tr>";
  380.                 echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
  381.                 echo "\t\t<td>{$result['tip_locatie']}</td>\n";
  382.                 echo "\t\t<td>{$result['judet']}</td>\n";
  383.                 echo "\t\t<td>{$result['localitate']}</td>\n";
  384.                 echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
  385.                 echo "</tr>";
  386.                
  387.             }
  388.             echo "</table>";
  389.             echo "</center>";
  390.         }
  391.     } else {
  392.         echo "</p>Ne pare rau, momentan nu exista oferte in localitatea specificata de dumneavoastra.</p>";
  393.     }
  394. }
  395.  
  396. ?>
  397. </div>
  398. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement