 <?php 
   require_once("headHotelStaff.php");
   if(isset($_POST['post']))

  {

     if( isset($_POST['hiD']) && isset($_POST['owniD']))
     {

        $hnm=$_POST['hiD'];
        $ownID=$_POST['owniD'];   
      
    }
  }
?> 
 
  
 
   <!--NEW USER REGISTRATION FORM, DISPLAYED BY DEFAULTS IN PAGE LOAD-->
 <center>
  <div>
  <sup>
    <?php 
   echo $con->eAccountId($accountId)."<p/>"; 
    
     ?>
  </sup>
</div>
</center> 

<center><fieldset id="new_sevice_reg_form">
<label id="reg_form_tile_label">Add hotel workers here </label></p/>
<i>Please enter buda account Id number of the new employee here:-</i>
<form name="new_user_registration" id="new_user_registration" action="addEmployeeProStaff.php" method="POST">

<table border="0" id="reg_form_table">

   <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">


   <input class="hi" type="hidden" name="hiD"  value="<?php echo $hnm;?>">

        
    <tr>
  
  <td height="40px" width="35%" valign="top">

        <label id="mini_label">Buda account Id number:<sup>*</sup></label><br>

  </td> 


  <td id="reg_form_table_cell">
     
         <input type="text" name="accountId" id="accountId" class="prof_info"  value="<?php echo $accountId;?>"  /><br/>
         <sup id="si"></sup>
         
  </td>

</tr>

  
 
   
<tr>

  <td colspan="2" align="center">
        <input type="submit"  name="submit" value="Submit" id="submit"/>
  </td>

</tr>


  <tr>
  
  <td colspan="2" height="50px" width="35%" align="right" valign="bottom">

  <form   action="registerToHire.php" method="POST">
 

   <input class="hi" type="hidden" name="ownID"  value="<?php echo $ownID;?>">


   <input class="hi" type="hidden" name="hiD"  value="<?php echo $hnm;?>">


    <label id="reg_form_tile_label">Not registered <input class="pos" type="submit" value="Sign Up" name="post">
    </label> </form>

  
 
     
                              
  </td>

</tr>

</table>
 
</form>
</fieldset> </center>
 
<script>
 
$(document).ready(function(){
  
$("#new_user_registration").on('submit',function(e){
  var accountId =document.getElementById('accountId').value;
$.trim(accountId);
 
var nR =/[A-Za-z0-9]/i;
var nC =/[0-9]/i;
var j=0,k=0, g=0,i=0;

                                                         //ROUTE ID VALIDATION
if(accountId=="")
{
e.preventDefault();

document.getElementById('si').innerHTML="Account Id  required!..";
 } 
 else
 {

      for(i=0;i<accountId.length;i++)
       {
         if(!accountId[i].match(nR))
          {
             j++;

           }
        }
      
       if(j>0){
       e.preventDefault();

       
        document.getElementById('si').innerHTML="You typed account id with error!.."; 


              }
         else{

        document.getElementById('si').innerHTML="";

              }
   }
 
    j=0, i=0;

  
}
);
}
);  
    
 
</script>





