<?php require_once('Connections/conn_newland.php'); ?>
<?php
// Creates a recordset of all the tour names and IDs from the tbl_tours table in the database. The data is used later to populate the form drop-down menu.
mysql_select_db($database_conn_newland, $conn_newland);
$query_rs_tourprice = "SELECT tourID, tourName FROM tbl_tours ORDER BY tourName ASC";
$rs_tourprice = mysql_query($query_rs_tourprice, $conn_newland) or die(mysql_error());
$row_rs_tourprice = mysql_fetch_assoc($rs_tourprice);
$totalRows_rs_tourprice = mysql_num_rows($rs_tourprice);
?><!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: Tour Price Calculator</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><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>Kalkulator ceny wyjazdu </h1>
    <p>Podaj liczb&#281; doros&#322;ych i dzieci uczestnicz&#261;cych w wyje&#378;dzie, a nast&#281;pnie wybierz nazw&#281; interesuj&#261;cego Ci&#281; wyjazdu. </p>
    <p>Wype&#322;nij wszystkie pola (wpisz 0 je&#380;eli zajdzie taka potrzeba).</p>
    <?php
	if (isset($_GET['error']))
	{
		if ($_GET['error'] == "notnumeric")
		{
			echo "<p class=\"error\">*** Błąd! Jedno lub więcej pól pozostało puste albo nie zawierało liczby.</p>";
		}
	}
	?>

	
    <form id="frm_tourprice" name="frm_tourprice" method="post" action="tourprice_processor.php">
            <table width="60%" border="0" cellspacing="0" cellpadding="3">
              <tr>
                <td>Liczba doros&#322;ych </td>
                <td><input name="numAdults" type="text" id="numAdults" /></td>
              </tr>
              <tr>
                <td>Liczba dzieci </td>
                <td><input name="numChildren" type="text" id="numChildren" /></td>
              </tr>
              <tr>
                <td>Nazwa wyjazdu </td>
                <td><select name="tourName" id="tourName">
                  <?php
do {  
?>
                  <option value="<?php echo $row_rs_tourprice['tourID']?>"><?php echo $row_rs_tourprice['tourName']?></option>
                  <?php
} while ($row_rs_tourprice = mysql_fetch_assoc($rs_tourprice));
  $rows = mysql_num_rows($rs_tourprice);
  if($rows > 0) {
      mysql_data_seek($rs_tourprice, 0);
	  $row_rs_tourprice = mysql_fetch_assoc($rs_tourprice);
  }
?>
                </select>
                </td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><input type="submit" name="Submit" value="Wyślij" /></td>
              </tr>
            </table>
    </form>
    </td>
 </tr>
</table>

<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_tourprice);
?>