<script language="javascript" src="../jscript/calendar.js"></script>
 
<?php
$table_name = $_SESSION['db_prefix']."_list_names_authorise";
    $position_query = "SELECT item_name FROM $table_name ORDER BY item_name ASC";
  $arrId1 = array ();
  $arrName1 = array ();
  $position_result = execsql($position_query);
  if ($position_result!="") {
  $position_num = mysql_num_rows($position_result);
  $b = 0;
  while ($b < $position_num) {
    $arrId1[$b] = mysql_result($position_result, $b, "item_name");
    $arrName1[$b] = mysql_result($position_result, $b, "item_name");
    $b++;
  }
  }  
  
$table_name = $_SESSION['db_prefix']."_list_names_admin";
    $position_query = "SELECT item_name FROM $table_name ORDER BY item_name ASC";
  $arrId2 = array ();
  $arrName2 = array ();
  $position_result = execsql($position_query);
  if ($position_result!="") {
  $position_num = mysql_num_rows($position_result);
  $b = 0;
  while ($b < $position_num) {
    $arrId2[$b] = mysql_result($position_result, $b, "item_name");
    $arrName2[$b] = mysql_result($position_result, $b, "item_name");
    $b++;
  }
  }  

require_once('../include/tc_calendar.php');
$pay_out_date = strtotime($_SESSION['pay_out_date']);
$d1 = date("d", $pay_out_date ) ;
$m1 = date("m", $pay_out_date ) ;
$y1 = date("Y", $pay_out_date ) ;

$period_from_date = strtotime($_SESSION['period_from_date']);
$d2 = date("d", $period_from_date ) ;
$m2 = date("m", $period_from_date ) ;
$y2 = date("Y", $period_from_date ) ;

$period_to_date = strtotime($_SESSION['period_to_date']);
$d3 = date("d", $period_to_date ) ;
$m3 = date("m", $period_to_date ) ;
$y3 = date("Y", $period_to_date ) ;
   
?>
<?php include('../include/wait.php') ?>
</head>


<body onLoad="MM_showHideLayers('wait','','hide')" onFocus="MM_showHideLayers('wait','','hide');">

   
<form id="feedbackform" method="post" action="severanceWizbase.php?p=3&s=2">
<div class="wizard_page_middle_frame">
<div class="wizard_frame">         
      <table width="680"  id="table_display_wizard">
          <tr>
            <td width="121"  valign="middle">Date of pay out:
&nbsp;&nbsp;
<label class="star">*</label></td>
                  <td colspan="3" valign="middle"><?php 
          //instantiate class and set properties
    $myCalendar = new tc_calendar("pay_out_date", true);
    $myCalendar->setIcon("../images/iconCalendar.gif");
    $myCalendar->setDate($d1, $m1, $y1);
    $myCalendar->setYearInterval(2010, 2099);
    //output the calendar
    $myCalendar->writeScript();
?></td>
                  </tr>
                <tr>
                  <td valign="middle">Amount:&nbsp;&nbsp;<label class="star">*</label></td>
                  <td colspan="3" valign="middle">
                    <input name="amount_text" type="text" class="text100" id="amount_text" value="<?php echo $_SESSION['amount'] ?>" style="text-align:right" onKeyPress="return isNumberKey(event)"  onchange=" this.value = this.value.replace (/(\...).*/, '$1')"/>
                  </td>
                  </tr>
                <tr>
                  <td valign="middle">Pay out period:&nbsp;&nbsp;
                  <label class="star">*</label></td>
                  <td colspan="3" valign="middle"><select name="period_years_select" class="select50" id="period_years_select">
                    <option value="0">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="<?php echo $_SESSION['period_years'] ?>" selected="selected"><?php echo $_SESSION['period_years'] ?></option>
                  </select>
                    years &amp; 
                    <select name="period_months_select" class="select50" id="period_months_select">
                    <option value="0">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="<?php echo $_SESSION['period_months'] ?>" selected="selected"><?php echo $_SESSION['period_months'] ?></option>
                  </select>
                  &nbsp;&nbsp;months</td>
                </tr>
                <tr>
                  <td>Period from:<label class="star"></label></td>
                  <td ><?php 
          //instantiate class and set properties
    $myCalendar = new tc_calendar("period_from_date", true);
    $myCalendar->setIcon("../images/iconCalendar.gif");
    $myCalendar->setDate($d2, $m2, $y2);
    $myCalendar->setYearInterval(1988, 2099);
    //output the calendar
    $myCalendar->writeScript();
?>                    &nbsp;&nbsp;&nbsp;</td>
<td width="26">to:&nbsp;</td>
<td width="262"><?php 
          //instantiate class and set properties
    $myCalendar = new tc_calendar("period_to_date", true);
    $myCalendar->setIcon("../images/iconCalendar.gif");
    $myCalendar->setDate($d3, $m3, $y3);
    $myCalendar->setYearInterval(2010, 2099);
    //output the calendar
    $myCalendar->writeScript();
?></td>
        </tr>
                <tr>
                  <td valign="middle">Authorised  by:&nbsp;
                    <label class="star">*</label></td>
                  <td width="251" valign="middle"><select name="authorised_by_select" class="select120"  >
                    <option value="<?php echo $_SESSION['authorised_by']?>" selected="selected"><?php echo $_SESSION['authorised_by'] ?></option>
                    <?php
          for ($j = 0; $j < count($arrId1); $j++) {
        echo "<option value=" . "\"" . $arrId1[$j] . "\"" . ">" . $arrName1[$j] . "</option>";
  }
?>
                  </select><?php echo $_SESSION['authorised_by'] ?></td>
                  <td colspan="2" valign="middle">Paid out by:&nbsp;
                    <label class="star">*</label>                  <select name="pay_out_by_select" class="select120"  >
                    <option value="<?php echo $_SESSION['pay_out_by'] ?>" selected="selected"><?php echo $_SESSION['pay_out_by'] ?></option>
                    <?php
          for ($j = 0; $j < count($arrId2); $j++) {
        echo "<option value=" . "\"" . $arrId2[$j] . "\"" . ">" . $arrName2[$j] . "</option>";
  }
?>
                  </select></td>
                </tr>
                <tr>
                  <td valign="middle">Notes:</td>
                  <td colspan="3" valign="middle"><textarea name="notes_text" cols="60" rows="3" class="text_box" id="notes_text"><?php echo  $_SESSION['notes'] ?> </textarea></td>
                </tr>
              </table>
            </div>
<div class="wizard_spacer_frame" style="height:8px;"></div>
<div class="wizard_frame">            
              <table width="675" 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_showHideLayers('wait','','show'); MM_goToURL('parent','severanceWizbase.php?s=&p=1');return document.MM_returnValue" /></td>
                  <td width="115">&nbsp;</td>
                  <td width="99">
                    <input name="p" type="hidden" id="p" value="2" />
                    <input name="s" type="hidden" id="s" value="2" />
                  </td>
                  <td width="125" align="right"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onClick="cancel_confirmation(1, '../hr_module/hr_main.php?date=0');" 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>

<!--form validation-->
  <script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("feedbackform");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("amount_text","req","- severance amount.");
  frmvalidator.addValidation("period_years_select","req","- no of years.");
  frmvalidator.addValidation("period_months_select","req","- no of months.");
  frmvalidator.addValidation("authorised_by_select","req","- authorised by.");
  frmvalidator.addValidation("pay_out_by_select","req","- paid out by.");
  </script>
</div>
</div>
</form>
</body>