<?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.Dishwasher.value > 50) {
      alert("Max number of Dishwasher is set to 50");
      form.Dishwasher.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;
    }
	if(form.Dishwasher.value == "") {
      alert("Input can not be Empty!(Dish Washer)");
      form.Dishwasher.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 res = /^[0-9]+$/;
	
    if(!res.test(form.Dishwasher.value)) {
      alert("Number Only");
      form.Dishwasher.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>

<link rel="stylesheet" href="jquery-ui.css" />
    
    <!-- Load jQuery JS -->
    <script src="js/jquery-1.9.1.js"></script>
    <!-- Load jQuery UI Main JS  -->
    <script src="js/jquery-ui.js"></script>
    
    <!-- Load SCRIPT.JS which will create datepicker for input field  -->
    <script src="js/script.js"></script>

	<script type="text/javascript">
	    $(function(){
	        var pickerOpts = {
	            dateFormat:"dd/mm/yy"
	        };  
	        $("#datepicker").datepicker(pickerOpts);
	    });
	</script>
    	<script type="text/javascript">
	    $(function(){
	        var pickerOpts = {
	            dateFormat:"dd/mm/yy"
	        };  
	        $("#datepicker2").datepicker(pickerOpts);
	    });
	</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"  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">No: of Porters:<input name="NumberOfPorters" type="text" size="20" maxlength="20" id="NumberOfPorters" /></div><div class="aright">No: of Waiters:<input name="Waiters" type="text" size="20" maxlength="20" id="Waiters" /></div></div>
<div class="row">
  <div class="aleft">Tent crew:<input name="Tentcrew" type="text" size="20" maxlength="20" id="Tentcrew" /></div><div class="aright">Toilet boy:<input name="Toiletboy" type="text" size="20" maxlength="20" id="Toiletboy" /></div></div>
<div class="row"><div class="aleft">Dishwasher:<input name="Dishwasher" type="text" size="20" maxlength="20" id="Dishwasher" /></div><div class="aright"><input name="Select" 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; Trek DMC kilimanjaro. All rights reserved. Design by <a href="technohosttz.com">Technohost Tanzania</a></p>
</div>
</body>
</html>
