<?php require_once('Connections/conn_newland.php'); ?>
<?php
mysql_select_db($database_conn_newland, $conn_newland);
$query_rs_worldregions = "SELECT * FROM tbl_region ORDER BY regionName ASC";
$rs_worldregions = mysql_query($query_rs_worldregions, $conn_newland) or die(mysql_error());
$row_rs_worldregions = mysql_fetch_assoc($rs_worldregions);
$totalRows_rs_worldregions = mysql_num_rows($rs_worldregions);

mysql_select_db($database_conn_newland, $conn_newland);
$query_rs_countries = "SELECT countryName FROM tbl_country WHERE EXISTS( SELECT * FROM tbl_tours WHERE tbl_tours.country = tbl_country.countryID) ORDER BY countryName ASC";
$rs_countries = mysql_query($query_rs_countries, $conn_newland) or die(mysql_error());
$row_rs_countries = mysql_fetch_assoc($rs_countries);
$totalRows_rs_countries = mysql_num_rows($rs_countries);
?>
<!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">
<head>
<title>Newland Tours: Tours</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<link href="css/newland.css" rel="stylesheet" type="text/css" /></head>

<body>
<a href="#top"><img src="images/spacer.gif" alt="Skip to main page content" width="1" height="1" border="0" align="left" /></a>
<table width="750" border="0" cellpadding="3" cellspacing="0">
 <tr>
  <td><a name="top"></a><img src="images/banner_left.gif" width="451" height="68" alt="Newland Tours Banner, Left." /></td>
  <td width="280"><img src="images/banner_right.jpg" width="276" height="68" alt="Newland Tour Banner, Right." /></td>
 </tr>
 <tr>
  <td><img src="images/navbar.gif" name="navbar" width="450" height="20" border="0" usemap="#navbarMap" alt="Navigation Bar." /></td>
  <td><img name="copyright_bar" src="images/copyright_bar.gif" width="272" height="20" border="0" alt="Copyright 2006 Newland Tours." /></td>
 </tr>
 <tr>
  <td colspan="2">	
	
	<h1><br />
	  <a name="top" id="top"></a>Znajd&#378; wyjazd </h1>
    <p>U&#380;yj  tej strony do znalezienia wyjazdu Twoich marze&#324;. Gdy ju&#380; dokonasz wyboru  skorzystaj z <a href="tourprice.php">kalkulatora ceny wyjazdu</a>.</p>
    <p>Newland  Tours oferuje wiele wyjazd&oacute;w do r&oacute;&#380;nych cz&#281;&#347;ci &#347;wiata. Aby znale&#378;&#263; po&#380;&#261;dany cel  podr&oacute;&#380;y, u&#380;yj poni&#380;szej tabeli, kt&oacute;ra umo&#380;liwi Ci przegl&#261;danie ich wed&#322;ug  docelowego rejonu &#347;wiata lub kraju, albo po prostu na wy&#347;wietlenie wszystkich.</p>
    <table width="95%" border="1" cellspacing="0" cellpadding="3">
      <tr>
        <td width="31%">Przegl&#261;daj wed&#322;ug rejonu &#347;wiata</td>
        <td width="69%"><?php do { ?>
            <a href="tours_detail.php?regionID=<?php echo $row_rs_worldregions['regionID']; ?>"><?php echo $row_rs_worldregions['regionName']; ?></a><br />
            <?php } while ($row_rs_worldregions = mysql_fetch_assoc($rs_worldregions)); ?></td>
      </tr>
      <tr>
        <td>Przegl&#261;daj wed&#322;ug  kraju</td>
        <td><form id="frm_bycountry" name="frm_bycountry" method="post" action="tours_detail.php">
          <p>
            <select name="tourCountry" id="tourCountry">
              <?php
do {  
?>
              <option value="<?php echo $row_rs_countries['countryName']?>"><?php echo $row_rs_countries['countryName']?></option>
              <?php
} while ($row_rs_countries = mysql_fetch_assoc($rs_countries));
  $rows = mysql_num_rows($rs_countries);
  if($rows > 0) {
      mysql_data_seek($rs_countries, 0);
	  $row_rs_countries = mysql_fetch_assoc($rs_countries);
  }
?>
            </select>
            </p>
          <p>
            <input type="submit" name="Submit" value="Wyślij" />
          </p>
        </form>
        </td>
      </tr>
      <tr>
        <td><a href="tours_detail.php">Poka&#380; wszystkie wyjazdy</a></td>
        <td>&nbsp;</td>
      </tr>
    </table>    
    <p>&nbsp;</p></td>
 </tr>
</table>

<br />
<br />


<map name="navbarMap" id="navbarMap">
 <area shape="rect" coords="1,0,62,20" href="index.php" alt="Home" />
 <area shape="rect" coords="71,0,117,20" href="about.php" alt="About" />
 <area shape="rect" coords="129,0,196,20" href="tours.php" alt="Find Tours" />
 <area shape="rect" coords="209,0,311,20" href="profiles.php" alt="Country Profiles" />
 <area shape="rect" coords="327,0,434,20" href="contact.php" alt="Contact An Agent" />
</map>
</body>
</html>
<?php
mysql_free_result($rs_worldregions);

mysql_free_result($rs_countries);
?>