<!--jscript-->
<script language="javascript" src="../jscript/calendar.js"></script>
<?php
$today = date("Y-m-d");	
require_once('../include/tc_calendar.php');
$warning_date = strtotime($_SESSION['warning_date']);
$d1 = date("d", $warning_date ) ;
$m1 = date("m", $warning_date ) ;
$y1 = date("Y", $warning_date ) ;

$table_name = $_SESSION['db_prefix']."_employee";
$drop_down_query = "SELECT emp_id, emp_first_name, emp_last_name FROM $table_name WHERE  end_employ_date > '".$today."' AND premature_end_date > '".$today."' ORDER BY emp_first_name ASC";
$drop_down_result = $con->query($drop_down_query);
	$a = 0;
	$arrId = array ();
	$arrName = array ();
	while($row = $drop_down_result->fetch_assoc()) {
	$arrId[$a] = $row["emp_id"];
	$arrName[$a] = $row["emp_first_name"]." ".$row["emp_last_name"];
	$a++;
	}
   
?>
</head>

<?php
$page_name = "HR-discipline";
include ("../navigation/access.php");

if ($permission_num==1) {
	 include('../include/wait.php') 
?>
<body onLoad="MM_showHideLayers('wait','','hide')" onFocus="MM_showHideLayers('wait','','hide');">


<div class="wizard_page_middle_frame">
  <form id="feedbackform" method="get" action="warningWizbase.php">
    <div class="wizard_frame">
        <table width="613" height="84" id="table_display_wizard">
                <tr>
                  <td height="45" valign="middle">Select employee:&nbsp;&nbsp;<label class="star">*</label></td>
                  <td valign="middle"><select name="employee_select" id="employee_select" class="select200" >
                    <option value="<?php echo $_SESSION['emp_id']?>" ><?php echo $_SESSION['employee_name']?></option>
                    <?php
    	for ($i = 0; $i < count($arrId); $i++) {
		echo "<option value=" . "\"" . $arrId[$i] . "\"" . ">" . $arrName[$i] . "</option>";
		$_SESSION['productName'] = $arrName[$i];
		//foreach($arrId as $key=>$value){
			//echo "<option value=\"delivery.php?store_item_id=".$arrId[$i]."&cat=$cat&formEnabled2=1&date=$date" . "\"" . ">" . $arrName[$i] . "</option>";	
	    }
     ?>
                  </select></td>
                </tr>
                <tr>
                  <td width="253" height="45" valign="middle"><label class="label_std">Date of warning:</label>
&nbsp;&nbsp;
<label class="star">*</label></td>
                  <td width="348" valign="middle"><?php 
				  //instantiate class and set properties
		$myCalendar = new tc_calendar("warning_date", true);
		$myCalendar->setIcon("../images/iconCalendar.gif");
		$myCalendar->setDate($d1, $m1, $y1);
		$myCalendar->setYearInterval(2010, 2020);
		//output the calendar
		$myCalendar->writeScript();
?></td>
                  </tr>
              </table>
            </div>
    <div class="wizard_spacer_frame" style="height:95px;"></div>
            <div class="wizard_frame">
              <table width="640" height="50" align="center" id="table_button_bar">
                <tr>
                  <td width="117"><input type="button" name="lastprev_button" class="imagebutton" value="Prev" onClick="needToConfirm = false; MM_goToURL('parent','warningWizbase.php?s=&p=1');return document.MM_returnValue; MM_showHideLayers('wait','','show');" /></td>
                  <td width="115">&nbsp;</td>
                  <td width="99">
                    <input name="p" type="hidden" id="p" value="1" />
                    <input name="s" type="hidden" id="s" value="1" />
                  </td>
                  <td width="125" align="right"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onClick="needToConfirm = false; cancel_confirmation(1, '../hr_module/hr_main.php?date=0'); MM_showHideLayers('wait','','show');" value="Cancel" /></td>
                  <td width="110" align="right"><input type="submit" name="next_button" class="imagebutton" value="Next" onClick="needToConfirm = false; MM_showHideLayers('wait','','show');" /></td>
                </tr>
              </table>
    </div>
</form>
</div>
<!--form validation-->
  <script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("feedbackform");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("employee_select","req","Please select an employee.");
  
  </script>
<?php } else { 
    $_SESSION['denied_return'] = "hr_module/hr_main.php?date=";	?>
	<body onLoad="accessdenied(); return false">
</body>
<?php }
?>