<?php
session_start();
if(!isset($_SESSION['username']) || !isset($_SESSION['password'])){
 header("Location: index.php");
} 
 //include 'logoff.html';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PMS Member's Only</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" rel="stylesheet" type="text/css" />
<link href="default.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript">
  function checkForm(form)
  {
   if(form.NumberOfPorters.value > 420) {
      alert("Max number of portes is 420");
      form.NumberOfPorters.focus();
      return false;
    }  
	 if(form.Waiters.value > 50) {
      alert("Max number of Waiters is set to 50");
      form.Waiters.focus();
      return false;
    }
	 if(form.Tentcrew.value > 50) {
      alert("Max number of Tentcrew is set to 50");
      form.Tentcrew.focus();
      return false;
    }
	 if(form.Toiletboy.value > 50) {
      alert("Max number of Toiletboy is set to 50");
      form.Toiletboy.focus();
      return false;
    }
    
    if(form.NumberOfPorters.value == "") {
      alert("Input can not be Empty");
      form.NumberOfPorters.focus();
      return false;
    }
	if(form.Waiters.value == "") {
      alert("Input can not be Empty!(waiters)");
      form.Waiters.focus();
      return false;
    }
	if(form.Tentcrew.value == "") {
      alert("Input can not be Empty!(Tent Crew)");
      form.Tentcrew.focus();
      return false;
    }
	if(form.Toiletboy.value == "") {
      alert("Input can not be Empty!(Toilet boy)");
      form.Toiletboy.focus();
      return false;
    }
	
	var re = /^[0-9]+$/;
	
    if(!re.test(form.NumberOfPorters.value)) {
      alert("Number Only");
      form.NumberOfPorters.focus();
      return false;
    }
		var rew = /^[0-9]+$/;
	
    if(!rew.test(form.Waiters.value)) {
      alert("Number Only");
      form.Waiters.focus();
      return false;
    }
		var ret = /^[0-9]+$/;
	
    if(!ret.test(form.Tentcrew.value)) {
      alert("Number Only");
      form.Tentcrew.focus();
      return false;
    }
		var reb = /^[0-9]+$/;
	
    if(!reb.test(form.Toiletboy.value)) {
      alert("Number Only");
      form.Toiletboy.focus();
      return false;
    }
	
	var r=confirm("Are You Sure You Want To Proceed?, if YES press OK or Cancel to Edit the form");
    if(!r){
	  return false;
	}
    return true;
  }

</script>

</head>
<body>
<div id="header" class="container">
	<div id="logo">
		<h1><a href="#">PMS - Porter's Management System</a></h1>
	</div>
</div>

<div id="page" class="container">
	<div id="sidebar1">
		<div id="box1"><ul class="style1">
				<li class="first"><a href="select.php" class="link-style">SELECT PORTERS</a></li>
				<li><a href="addporters.php" class="link-style">ADD RECORDS</a></li>
                <li><a href="editall.php" class="link-style">Edit RECORDS</a></li>
				<li><a href="deleteporter.php" class="link-style">DELETE PORTER</a></li>
				<li><a href="#" class="link-style">UPDATE STATUS</a></li>
                               <li><a href="logout.php" class="link-style">Logout</a></li>
			</ul>
            </div>
	</div>
	<div id="content" align="center"><br />
<form action="selected.php" method="POST" name="form"  target="_self" onsubmit="return checkForm(this);">
<div class="select"><h4>Select Porters for the current kilimanjaro trip
</h4>
<div class="row">
  <div class="aleft">Climb Start Date: 
    <input name="datepicker" type="text" id="datepicker" size="25" /></div>
  <div class="aright"> Descend Date: 
    <input name="datepicker2" type="text" id="datepicker2" size="25" /></div></div>
<div class="row">
<div class="aleft">Kili Climb Route: 
    <input name="climbroute" type="text" id="climbroute" value="" size="25" />
</div>
<div class="aright">Meeting Area:    
  <input name="meetingarea" type="text" id="meetingarea" size="25" /> Time: <input name="time" type="text" id="time" size="15" /></div></div>
<div class="row"><div class="aleft">Number of Porters:<select name="NumberOfPorters" >    <option value="0" selected="selected">0</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15" >15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20">20</option>
    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23">23</option>
    <option value="24">24</option>
    <option value="25">25</option>
    <option value="26">26</option>
    <option value="27">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
        <option value="30">30</option>
    <option value="31">31</option>
    <option value="32">32</option>
    <option value="33">33</option>
    <option value="34">34</option>
    <option value="35">35</option>
    <option value="36">36</option>
    <option value="37">37</option>
    <option value="38">38</option>
    <option value="39">39</option>
    <option value="40">40</option>
    <option value="41">41</option>
    <option value="42">42</option>
    <option value="43">43</option>
    <option value="44">44</option>
        <option value="45">45</option>
    <option value="46">46</option>
    <option value="47">47</option>
    <option value="48">48</option>
    <option value="49">49</option>
    <option value="50">50</option>
    <option value="51">51</option>
    <option value="52">52</option>
    <option value="53">53</option>
    <option value="54">54</option>
    <option value="55">55</option>
    <option value="56">56</option>
    <option value="57">57</option>
    <option value="58">58</option>
    <option value="59">59</option>
    <option value="60">60</option>
    
    
    </select></div><div class="aright">Number of Waiters:<select name="Waiters" >    <option value="0" selected="selected">0</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option></select></div></div>
<div class="row">
  <div class="aleft">Tent crew:<select name="Tentcrew" >
    <option value="0" selected="selected">0</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
  </select></div><div class="aright">Toilet boy:<select name="Toiletboy" >
    <option value="0" selected="selected">0</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
  </select></div></div>
<div class="row"><div class="aleft"></div><div class="aright"><input name="submit" type="submit" value="       Select       " /></div></div>
</div>
</form>
<br /><br /><br><br />**Incase you want to select individual porter from the database for special case <a href="specialselect.php">Click Here **</a><br>


	</div>
		
</div>
<div id="footer">
	<p>&copy; Private Kilimanjaro. All rights reserved. Design by <a href="#">Pamoja Web Solutions</a></p>
</div>
</body>
</html>
