
<?php
require_once ('../include/tc_calendar.php');
$start = strtotime($_SESSION['deliver_date']);
$d = date("d", $start );
$m = date("m", $start );
$y = date("Y", $start );


$cust_id = $_SESSION['cust_id'];    
		

$table_name = $_SESSION['db_prefix']."_list_drivers";
$vehiclesQuery = "SELECT item_id, item_name FROM $table_name  ORDER BY item_name ASC";
	$vehiclesResult = execsql($vehiclesQuery);
	$vehiclesNum = mysql_num_rows($vehiclesResult);
	$w = 0;
	$arrId1 = array ();
	$arrName1 = array ();
	while ($w < $vehiclesNum) {
		$arrId1[$w] = mysql_result($vehiclesResult, $w, "item_name");
		$arrName1[$w] = mysql_result($vehiclesResult, $w, "item_name");
		$w++;
	}

$table_name = $_SESSION['db_prefix']."_list_vehicles";
$vehiclesQuery = "SELECT item_id, item_name FROM $table_name  ORDER BY item_name ASC";
	$vehiclesResult = execsql($vehiclesQuery);
	$vehiclesNum = mysql_num_rows($vehiclesResult);
	$w = 0;
	$arrId2 = array ();
	$arrName2 = array ();
	while ($w < $vehiclesNum) {
		$arrId2[$w] = mysql_result($vehiclesResult, $w, "item_name");
		$arrName2[$w] = mysql_result($vehiclesResult, $w, "item_name");
		$w++;
	}


	
?>


</head>
<?php 
$page_name = "Stores-receive";
include ("../navigation/access.php");

if ($permission_num==1) {
	 
	?>

<?php include('../include/wait.php') ?>

<body onLoad="MM_showHideLayers('wait','','hide')" onFocus="MM_showHideLayers('wait','','hide');"  onBlur="MM_showHideLayers('wait','','hide');">
<div class="wizard_page_middle_frame">
<form id="form1" method="get" action="deliver_tilesWizbase.php">
<div class="wizard_frame">
<img src="../images/info_green.png" width="16" height="16">&nbsp;&nbsp;<b><?php echo $_SESSION['branch'].' branch'?></b>
</div>
<br />
<div class="wizard_frame">
<?php 
	include ('../include/customer_block.php');
?>
</div>
<div class="wizard_frame">
  <table width="672" id="table_display_wizard2">
    <tr>
      <td width="123" height="30" valign="middle"><label class="label_std">Delivery address:</label></td>
      <td colspan="3" valign="middle"><input name="delivery_address_text" type="text" class="text300" id="delivery_address_text" value="<?php echo $_SESSION['delivery_address']?>" onBlur="capitalize(this)" maxlength="50"></td>
    </tr>
    <tr>
      <td height="30" valign="middle"><label class="label_std">Delivered by:</label></td>
      <td width="271" valign="middle"><select name="driver_select" id="driver_select" class="select160">
        <option value="<?php echo $_SESSION['driver']?>" selected="selected" ><selected="selected"><?php echo $_SESSION['driver']?></option>
        <?php 
    	for ($w = 0; $w < count($arrId1); $w++) {
		echo "<option value=\"".$arrId1[$w] . "\"" . ">" . $arrName1[$w] . "</option>";	
	    }
     ?>
      </select></td>
      <td width="86" valign="middle"><label class="label_std">Vehicle reg.:</label></td>
      <td width="172" valign="middle"><select name="vehicle_select" id="vehicle_select" class="select120">
        <option value="<?php echo $_SESSION['vehicle']?>" selected="selected" ><selected="selected"><?php echo $_SESSION['vehicle']?></option>
        <?php 
    	for ($w = 0; $w < count($arrId2); $w++) {
		echo "<option value=\"".$arrId2[$w] . "\"" . ">" . $arrName2[$w] . "</option>";	
	    }
     ?>
      </select></td>
    </tr>
    <tr>
      <td height="30" valign="middle"><label class="label_std">Delivery date:</label></td>
      <td valign="middle"><?php

		$myCalendar = new tc_calendar("receive_date", true);
		$myCalendar->setIcon("../images/iconCalendar.gif");
		$myCalendar->setDate($d, $m, $y);
		$myCalendar->setPath("./");
		$myCalendar->setYearInterval(2010, 2030);
		//$myCalendar->dateAllow('2009-02-20', "", false);
		$myCalendar->writeScript();
?></td>
      <td valign="middle"><label class="label_std">Delivery time:</label></td>
      <td valign="middle"><select name="hour_select" class="select50" id="hour_select">
        <option value="<?php echo $_SESSION['hour']?>" selected="selected" ><selected="selected"><?php echo $_SESSION['hour']?></option>
        <?php 
		$i=0;
		while ($i<24) { ?>
           <option value="<?php if ($i<10) {echo '0'.$i;} else { echo $i; } ?>"><?php if ($i<10) {echo '0'.$i;} else { echo $i; } ?></option>
           <?php 
		   $i++;
		}
		?>
        
        <option> </option>
      </select>
        <label class="label_std">hrs
          <select name="min_select" class="select50" id="min_select">
            <option value="<?php echo $_SESSION['min']?>" selected="selected" ><selected="selected"><?php echo $_SESSION['min']?></option>
            <?php 
		$i=0;
		while ($i<60) { ?>
           <option value="<?php if ($i<10) {echo '0'.$i;} else { echo $i; } ?>"><?php if ($i<10) {echo '0'.$i;} else { echo $i; } ?></option>
           <?php 
		   $i++;
		}
		?>
            <option> </option>
          </select>
          min
        </label></td>
    </tr>
  </table>
</div>
        <br />
    <div class="wizard_spacer_frame" style="height:50
    px;"></div>
        <div class="wizard_frame">
        <table width="590" height="50" align="center" id="table_button_bar">
          <tr>
            <td width="117">&nbsp;</td>
            <td width="115">
              <input name="s" type="hidden" id="s" value="1" />
              <input name="p" type="hidden" id="p" value="1" />
              </td>
            <td width="99">&nbsp;</td>
            <td width="125"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onClick="needToConfirm = false; cancel_confirmation(1, '../store/store_main.php?date=0&branch=&subCatSelect=Tiles');" value="Cancel"  tabindex="-1"/></td>
            <td width="110" align="left"><input type="submit" name="next_button" id="next_button" class="imagebutton" value="Next" onClick="needToConfirm = false; MM_showHideLayers('wait','','show');" /></td>
          </tr>
        </table>
        </div>
</form>
</div>
<script language="JavaScript" type="text/javascript" xml:space="preserve">
  /*var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("supplier_id_select","req","- select a supplier.");
  frmvalidator.addValidation("company_group","selone","- company.");
  frmvalidator.addValidation("del_note_text","req","- delivery note number.");*/
</script>
</body>
<?php } else { ?>
<script> needToConfirm = false; </script>
<?php
    $_SESSION['denied_return'] = "store/store_main.php?date=&branch=&subCatSelect=Tiles";	?>
	<body onLoad="needToConfirm = false; accessdenied(); return false">
</body>
<?php }
?>

<html>