 
 <center>
   
   <label id="succ">
    <?php 
    $ch=$con->checkIdForSameEmpExist($accountId);
      
     if ($ch->rowCount()>0) {
        
     
          echo "The user already employee!..";
      
         }
         else{
           echo $con->addRegisterEmployee($jobtitle,$accountId,$salary,$hnm);
   
             }
     ?>
 </label>
 </center> 
  
 
   <!--NEW USER REGISTRATION FORM, DISPLAYED BY DEFAULTS IN PAGE LOAD-->


<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="addEmployeePro.php" method="POST">

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

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


   <input class="hi" type="text" 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"   /><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">

  
    <label id="reg_form_tile_label">Not registered  logout  <a href="home.php">here</a>
    </label>  

  

  
 
     
                              
  </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>





