Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <title>RevelioninRomania.ro</title>
- <link rel="shortcut icon" type="image/x-icon" href="images/animated_favicon1.gif">
- <link rel="stylesheet" type="text/css" href="css/style.css">
- </head>
- <body>
- <!--<div class="body">-->
- <!-- Meniu -->
- <tr><td style="vertical-align:top">
- <ul class="menu">
- <li><a href="http://localhost/site/index.php" class="active"><span><b>Cauta oferta</b></span></a></li>
- <li><a href="http://localhost/site/adauga.php"><span><b>Adauga oferta</b></span></a></li>
- <li><a href="http://localhost/site/contact.php"><span><b>Contact</b></span></a></li>
- </ul>
- </tr></td>
- </br>
- </br>
- </br>
- <span class="right">
- </br>
- <!-- Formular cautare -->
- <div id="stylized" class="myform">
- <form action="index.php" method="POST">
- <h1>Cauta oferta ta de revelion</h1>
- <p>Selecteaza unde vrei sa petreci revelionul 2013 - 2014</p>
- <label>Localitate
- <span class="small">Tastati numele orasului.</span>
- </label>
- <input style="width:170px" type="text" name="termeni" id="termeni" />
- <label>Judet
- <span class="small">Selectati judetul.</span>
- </label>
- <select style="width:180px" name="judet">
- <option value="0">Toate judetele</option>
- <option value="Alba">Alba</option>
- <option value="Arad">Arad</option>
- <option value="Arges">Arges</option>
- <option value="Bacau">Bacau</option>
- <option value="Bihor">Bihor</option>
- <option value="Bistrita-Nasaud">Bistrita-Nasaud</option>
- <option value="Botosani">Botosani</option>
- <option value="Braila">Braila</option>
- <option value="Brasov">Brasov</option>
- <option value="Bucuresti">Bucuresti</option>
- <option value="Buzau">Buzau</option>
- <option value="Caras-Severin">Caras-Severin</option>
- <option value="Cluj">Cluj</option>
- <option value="Constanta">Constanta</option>
- <option value="Covasna">Covasna</option>
- <option value="Dambovita">Dambovita</option>
- <option value="Dolj">Dolj</option>
- <option value="Galati">Galati</option>
- <option value="Gorj">Gorj</option>
- <option value="Harghita">Harghita</option>
- <option value="Hunedoara">Hunedoara</option>
- <option value="Ialomita">Ialomita</option>
- <option value="Iasi">Iasi</option>
- <option value="Ilfov">Ilfov</option>
- <option value="Maramures">Maramures</option>
- <option value="Mehedinti">Mehedinti</option>
- <option value="Mures">Mures</option>
- <option value="Neamt">Neamt</option>
- <option value="Prahova">Prahova</option>
- <option value="Salaj">Salaj</option>
- <option value="Satu Mare">Satu Mare</option>
- <option value="Sibiu">Sibiu</option>
- <option value="Suceava">Suceava</option>
- <option value="Timis">Timis</option>
- <option value="Tulcea">Tulcea</option>
- <option value="Valcea">Valcea</option>
- <option value="Vrancea">Vrancea</option>
- </select>
- </br>
- <label>Categorie
- <span class="small">Selectati categoria.</span>
- </label>
- <select style="width:180px" name="tip">
- <option value="0">Toate categoriile</option>
- <option value="Restaurant">Restaurant</option>
- <option value="Pensiune">Pensiune</option>
- <option value="Club">Club</option>
- <option value="Hotel">Hotel</option>
- </select>
- </br>
- <button type="submit" name="cauta">Vezi oferte</button>
- <div class="spacer"></div>
- <input type="hidden" name="search" value="true" />
- </div>
- </form>
- </br>
- </br>
- </br>
- </br>
- </br>
- </br>
- </span>
- <span class="left">
- <a href="http://localhost/site/index.php"><img src="images/revelioninromania.png" align="right"/></a>
- </span>
- <?php
- if (isset($_POST['search'])) {
- $termeni = mysql_real_escape_string($_POST['termeni']);
- $tip = $_POST['tip'];
- $judet = $_POST['judet'];
- // Cautare in baza de date
- // Cautare dupa: Localitate, Judet, Categorie
- if ((!empty($termeni)) and (isset($tip)) and (isset($judet))) {
- require_once("mysql_connect.php");
- $query = "SELECT * FROM oferte WHERE localitate LIKE '%$termeni%' AND tip_locatie='$tip' AND judet='$judet'";
- $resulta = mysql_query($query) or die(mysql_error());
- if (mysql_num_rows($resulta) > 0) {
- ?>
- </br>
- </br>
- </br>
- <center>
- <table class="CSSTableGenerator">
- <tr>
- <th>Denumire</th>
- <th>Tip</th>
- <th>Judet</th>
- <th>Localitate</th>
- </tr>
- <?php
- while ($result = mysql_fetch_array($resulta)) {
- echo "<tr>";
- echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
- echo "\t\t<td>{$result['tip_locatie']}</td>\n";
- echo "\t\t<td>{$result['judet']}</td>\n";
- echo "\t\t<td>{$result['localitate']}</td>\n";
- echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
- echo "</tr>";
- }
- echo "</table>";
- echo "</center>";
- }
- }
- // Cautare dupa: Categorie
- elseif (isset($tip)) {
- require_once("mysql_connect.php");
- $query = "SELECT * FROM oferte WHERE tip_locatie='$tip'";
- $resulta = mysql_query($query) or die(mysql_error());
- if (mysql_num_rows($resulta) > 0) {
- ?>
- <br />
- <br />
- <br />
- <center>
- <table class="CSSTableGenerator">
- <tr>
- <th>Denumire</th>
- <th>Tip</th>
- <th>Judet</th>
- <th>Localitate</th>
- </tr>
- <?php
- while ($result = mysql_fetch_array($resulta)) {
- echo "<tr>";
- echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
- echo "\t\t<td>{$result['tip_locatie']}</td>\n";
- echo "\t\t<td>{$result['judet']}</td>\n";
- echo "\t\t<td>{$result['localitate']}</td>\n";
- echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
- echo "</tr>";
- }
- echo "</table>";
- echo "</center>";
- }
- }
- // Cautare dupa: Judet
- elseif (isset($judet)) {
- require_once("mysql_connect.php");
- $query = "SELECT * FROM oferte WHERE judet='$judet'";
- $resulta = mysql_query($query) or die(mysql_error());
- if (mysql_num_rows($resulta) > 0) {
- ?>
- <br />
- <br />
- <br />
- <center>
- <table class="CSSTableGenerator">
- <tr>
- <th>Denumire</th>
- <th>Tip</th>
- <th>Judet</th>
- <th>Localitate</th>
- </tr>
- <?php
- while ($result = mysql_fetch_array($resulta)) {
- echo "<tr>";
- echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
- echo "\t\t<td>{$result['tip_locatie']}</td>\n";
- echo "\t\t<td>{$result['judet']}</td>\n";
- echo "\t\t<td>{$result['localitate']}</td>\n";
- echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
- echo "</tr>";
- }
- echo "</table>";
- echo "</center>";
- }
- }
- // Cautare dupa: Localitate
- elseif (!empty($termeni)) {
- require_once("mysql_connect.php");
- $query = "SELECT * FROM oferte WHERE localitate LIKE '%$termeni%'";
- $resulta = mysql_query($query) or die(mysql_error());
- if (mysql_num_rows($resulta) > 0) {
- ?>
- <br />
- <br />
- <br />
- <center>
- <table class="CSSTableGenerator">
- <tr>
- <th>Denumire</th>
- <th>Tip</th>
- <th>Judet</th>
- <th>Localitate</th>
- </tr>
- <?php
- while ($result = mysql_fetch_array($resulta)) {
- echo "<tr>";
- echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
- echo "\t\t<td>{$result['tip_locatie']}</td>\n";
- echo "\t\t<td>{$result['judet']}</td>\n";
- echo "\t\t<td>{$result['localitate']}</td>\n";
- echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
- echo "</tr>";
- }
- echo "</table>";
- echo "</center>";
- }
- }
- // Cautare dupa: Localitate, Judet
- elseif (!empty($termeni) AND (isset($judet))) {
- require_once("mysql_connect.php");
- $query = "SELECT * FROM oferte WHERE localitate LIKE '%$termeni%' AND judet='$judet'";
- $resulta = mysql_query($query) or die(mysql_error());
- if (mysql_num_rows($resulta) > 0) {
- ?>
- <br />
- <br />
- <br />
- <center>
- <table class="CSSTableGenerator">
- <tr>
- <th>Denumire</th>
- <th>Tip</th>
- <th>Judet</th>
- <th>Localitate</th>
- </tr>
- <?php
- while ($result = mysql_fetch_array($resulta)) {
- echo "<tr>";
- echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
- echo "\t\t<td>{$result['tip_locatie']}</td>\n";
- echo "\t\t<td>{$result['judet']}</td>\n";
- echo "\t\t<td>{$result['localitate']}</td>\n";
- echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
- echo "</tr>";
- }
- echo "</table>";
- echo "</center>";
- }
- }
- // Cautare dupa: Localitate, Categorie
- elseif (!empty($termeni) AND (isset($tip))) {
- require_once("mysql_connect.php");
- $query = "SELECT * FROM oferte WHERE localitate LIKE '%$termeni%' AND tip_locatie='$tip'";
- $resulta = mysql_query($query) or die(mysql_error());
- if (mysql_num_rows($resulta) > 0) {
- ?>
- <br />
- <br />
- <br />
- <center>
- <table class="CSSTableGenerator">
- <tr>
- <th>Denumire</th>
- <th>Tip</th>
- <th>Judet</th>
- <th>Localitate</th>
- </tr>
- <?php
- while ($result = mysql_fetch_array($resulta)) {
- echo "<tr>";
- echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
- echo "\t\t<td>{$result['tip_locatie']}</td>\n";
- echo "\t\t<td>{$result['judet']}</td>\n";
- echo "\t\t<td>{$result['localitate']}</td>\n";
- echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
- echo "</tr>";
- }
- echo "</table>";
- echo "</center>";
- }
- }
- // Cautare dupa: Judet, Categorie
- elseif ((isset($judet)) AND (isset($tip))) {
- require_once("mysql_connect.php");
- $query = "SELECT * FROM oferte WHERE judet='$judet' AND tip_locatie='$tip'";
- $resulta = mysql_query($query) or die(mysql_error());
- if (mysql_num_rows($resulta) > 0) {
- ?>
- <br />
- <br />
- <br />
- <center>
- <table class="CSSTableGenerator">
- <tr>
- <th>Denumire</th>
- <th>Tip</th>
- <th>Judet</th>
- <th>Localitate</th>
- </tr>
- <?php
- while ($result = mysql_fetch_array($resulta)) {
- echo "<tr>";
- echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
- echo "\t\t<td>{$result['tip_locatie']}</td>\n";
- echo "\t\t<td>{$result['judet']}</td>\n";
- echo "\t\t<td>{$result['localitate']}</td>\n";
- echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
- echo "</tr>";
- }
- echo "</table>";
- echo "</center>";
- }
- }
- // Cautare dupa: Toate categoriile
- elseif ((!isset($judet)) AND (!isset($tip)) AND (empty($termeni))) {
- require_once("mysql_connect.php");
- $query = "SELECT * FROM oferte";
- $resulta = mysql_query($query) or die(mysql_error());
- if (mysql_num_rows($resulta) > 0) {
- ?>
- <br />
- <br />
- <br />
- <center>
- <table class="CSSTableGenerator">
- <tr>
- <th>Denumire</th>
- <th>Tip</th>
- <th>Judet</th>
- <th>Localitate</th>
- </tr>
- <?php
- while ($result = mysql_fetch_array($resulta)) {
- echo "<tr>";
- echo "\t\t<td>{$result['denumire_locatie']}</td>\n";
- echo "\t\t<td>{$result['tip_locatie']}</td>\n";
- echo "\t\t<td>{$result['judet']}</td>\n";
- echo "\t\t<td>{$result['localitate']}</td>\n";
- echo "\t\t<td><a href='http://localhost/site/oferta.php?id={$result['id_oferta']}'>Detalii</a></td>\n";
- echo "</tr>";
- }
- echo "</table>";
- echo "</center>";
- }
- } else {
- echo "</p>Ne pare rau, momentan nu exista oferte in localitatea specificata de dumneavoastra.</p>";
- }
- }
- ?>
- </div>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement