<?php include("parent/callMe.php"); ?>

<?php  include("sessioncheck.php");



$pageName=basename($_SERVER['PHP_SELF']);



    

     $m->where("page_name", $pageName);

     $video = $m->get("eduportal_modules_pages_detail");



     if (isset($_REQUEST['emp'])) {       

     

     $m->where("branch_id", $_SESSION['branch']);

     $m->where("user_id", $_REQUEST['emp']);

     $preExperience = $m->get("eduportal_employee_privious_experience");



     }





$branchID=$_SESSION['branch'];

$sql2 = "SELECT MAX(CAST(registratin_number AS UNSIGNED)) AS registratin_number FROM edu_user_config WHERE branch_id='$branchID'";



//print_r($sql2);

$evt1 =$m->query($sql2);



$prev1= $evt1[0]['registratin_number'];



$RegistrationNo=$prev1+1;







 ?>







<!DOCTYPE html>

<html lang="en">

  <head>

    

    <title>Add Employee | EduPortal</title>

    <?php include('RootMe/css_links.php');?>



<style>



h3{color:#00AFEF;}



</style>

<!-- Validation files -->



<script type = "text/javascript" src="js/jquery.js"> </script>

<script type = "text/javascript" src="js/validate.min.js"> </script>   

  </head>

  

<script type="text/javascript">

  

function getSection1(str)

{



   if(str=="")

      alert("Please select any Class");

  else

     var ajx;  // The variable that makes Ajax possible!

  

  if(window.XMLHttpRequest)

  ajx=new XMLHttpRequest();

  ajx.onreadystatechange = function()

  {



    if(ajx.readyState == 4)

    {

         /*alert(ajx.responseText);*/ 

         document.getElementById("txt_section").innerHTML= ajx.responseText;

    }

  }

  ajx.open("GET", "get_section.php?class_id="+str);

  ajx.send(); 



}







function HideDate(str){

  

  if(str=="Contract"){

    

    document.getElementById("end").style.display="block";

    document.getElementById("col3").style.display="block";

   

  }

  else {

    

    document.getElementById("end").style.display="none";

    document.getElementById("col3").style.display="none";

   

   

  }

}





function HideExp(){

  

     

    document.getElementById("exp").style.display="block";

     



}



</script>



<style>

      input.larger {

        width: 25px;

        height: 25px;

      }

    </style>





  <body class="nav-md">

    <div class="container body">

      <div class="main_container">

        <div class="col-md-3 left_col">

     

            <?php include('RootMe/sidebar.php');?>



              <?php include('RootMe/header.php');?>

     

        <!-- page content -->

          <div class="right_col" role="main">



            <a href="<?php echo $_SESSION['dashboard'];?>">Dashboard </a> &nbsp; <i style="" class="fa fa-angle-double-right"></i>  &nbsp;   

             Add Employee

             <br><br>

             

          <div class="" style="background-color: white;">

           

  

  <section class="">

  <div class="container">

  <div class="inner_banner_bg">

    <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">



<?php 

  if(isset($_REQUEST['emp'])){

?>

  <h4> Update Employee Information</h4>



<?php 

 } else {

?>



  <h3 style="color:gray;"> Add New Employee </h3>   



<?php 

  }

?>



    </div>

    <ul class="inner_menu">



      <div class="clearfix"></div>

    </ul>

    <div class="clearfix"></div>

    </div>

  </div>

</section>

<section class="add_sub_agent" id="table_sub_agent">

  <div class="container">

   <div class="box_visa_form">

    <div class="" style="min-height:320px;">

      

    <?php if ($video[0]['video_url']!=NULL) { ?>

  

  <a href="watch_video.php?videourl=<?php echo $video[0]['video_url'];?>" target="_blank" class="btn btn-success" style="padding: 10px 10px; font-size:14px;color:white;float: right;"><i class="fa fa-play"></i>&nbsp;&nbsp;Watch Demo</a>



<?php } ?>



<br>



<form class="form-style-7" id="add_emp" action="<?php echo DOMAIN.AgentDirectory;?>parent/InsertMe.php" method="post" onSubmit="return student_check11();" enctype="multipart/form-data">



<?php 

  if(isset($_REQUEST['emp'])){

?>



  <input type="hidden" name="action"  value="EditEmployee">



  <input type="hidden" name="emp"  value="<?php echo $_REQUEST['emp']; ?>" />



<?php } else {?>



  <input type="hidden" name="action"  value="AddEmployee">



<?php } ?>



<input type="hidden" value="" class="form-control"  id="validate_status" />



        <div class="col-md-12">



          

           <div id="check_std_msg" style="display:none;" class="alert alert-warning alert-dismissible">

                    <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>

                     <strong>Warning !</strong> Student Record is already exist !!!

            </div>



        </div>





<div class="row">



       <div class="col-md-10"> 



<?php 

   $reg_no;

   if(isset($_REQUEST['emp'])){



     $m->where("status", '0');

     $m->where("user_id", $_REQUEST['emp']);

     $m->where("branch_id", $_SESSION['branch']);

     $user = $m->get("edu_user_config");

     //print_r($user);



     $reg_no=$user[0]['registratin_number'];

   } else {

     $reg_no=$RegistrationNo;

   }







?>



            <h3> Personal Information  </h3>



        <div class="row">

                       

                       

                      <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Employee Name * </label>

                              <input type="text" required value="<?php echo $user[0]['user_fname']; ?>" class="form-control" name="fname" id="fname"  />

                          </div>

                      </div>



                  

                      <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Father / Husband Name  </label>

                              <input type="text"  value="<?php echo $user[0]['user_lname']; ?>"  class="form-control" name="lname" id="lname"/>

                          </div>

                      </div>



                    <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Religion </label>

                              

                       <select id="religion" name="religion" class="dropdown inputfield">

                      <option <?php if($user[0]['user_religion']=="Muslim"){echo "Selected";} ?> value="Muslim">Muslim</option>

                      <option <?php if($user[0]['user_religion']=="Hinduism"){echo "Selected";} ?> value="Hinduism">Hindu</option>                    

                      <option <?php if($user[0]['user_religion']=="Sikhism"){echo "Selected";} ?> value="Sikhism">Sikh</option>

                      <option <?php if($user[0]['user_religion']=="Christian"){echo "Selected";} ?> value="Christian">Christian</option> 

                      <option <?php if($user[0]['user_religion']=="Ahmadi"){echo "Selected";} ?> value="Ahmadi">Ahmadi</option>                                       

                                            

                      </select>



                          </div>

                      </div>





                  <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Gender  </label>

                              <br>

                                      

                          <input required <?php if($user[0]['user_gender']=="Male"){echo "checked";} ?> type="radio" name="gender" value="Male"  /> 

                  Male

                          

                                                                          

                          <input required <?php if($user[0]['user_gender']=="Female"){echo "checked";} ?> type="radio" name="gender" value="Female"  /> 

                  Female

                          

                          </div>

                      </div>

  





    

                   </div>  <!-- ending row-->









        <div class="row">

                       

                       

                      <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Blood Group  </label>

                               <select name="blood" class="form-control" >

                        

                          <option value="">Select </option>                 

                          <option <?php if($user[0]['user_blood']=="A-"){echo "Selected";} ?> value="A-"> A-</option>

                          <option <?php if($user[0]['user_blood']=="A+"){echo "Selected";} ?> value="A+"> A+</option>

                          <option <?php if($user[0]['user_blood']=="B-"){echo "Selected";} ?> value="B-"> B-</option>

                          <option <?php if($user[0]['user_blood']=="B+"){echo "Selected";} ?> value="B+"> B+</option>

                          <option <?php if($user[0]['user_blood']=="O-"){echo "Selected";} ?> value="O-"> O-</option>

                          <option <?php if($user[0]['user_blood']=="O+"){echo "Selected";} ?> value="O+"> O+</option>                                        

                          <option  <?php if($user[0]['user_blood']=="AB-"){echo "Selected";} ?> value="AB-"> AB-</option>

                          <option <?php if($user[0]['user_blood']=="AB+"){echo "Selected";} ?>value="AB+"> AB+</option>                                        



                                                                    

                        </select>



                          </div>

                      </div>



                  

                      <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  CNIC | SSN  </label>

                              <input type="text"  value="<?php echo $user[0]['user_cnic']; ?>" class="form-control" name="cnic"  />

                          </div>

                      </div>







<?php 



       if(!isset($_REQUEST['emp'])){

?>







                    <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                          <label>  Upload CV  </label>

                              

                            <input type="file" class="form-control" name="cv" />





                          </div>

                      </div>



<?php 

    }

?>





                   <div class="col-md-3 col-sm-12 col-xs-12" >

                       

                        <label>  Upload Image  </label>

                              

                        <input type="file" class="form-control" onchange="readURL(this);" name="img_file" />

                        <input type="hidden" name="old_img" value="<?php echo $user[0]['attach_image'];?>" />



             

                      </div>



<div class="col-md-12">                    





<div class="col-md-3 col-sm-12 col-xs-12" >

<div class="form-group" >



<label>  Marital Status </label>



<select id="marital_status" name="marital_status" class="dropdown inputfield">

<option <?php if($user[0]['marital_status']=="Married"){echo "Selected";} ?> value="Married">Married</option>



<option <?php if($user[0]['marital_status']=="Widowed"){echo "Selected";} ?> value="Widowed">Widowed</option>                    

<option <?php if($user[0]['marital_status']=="Separated"){echo "Selected";} ?> value="Separated">Separated</option>

<option <?php if($user[0]['marital_status']=="Divorced"){echo "Selected";} ?> value="Divorced">Divorced</option> 



<option <?php if($user[0]['marital_status']=="Single"){echo "Selected";} ?> value="Single">Single</option>                                       



</select>



</div>

</div>





<div class="col-md-3 col-sm-12 col-xs-12" >

<div class="form-group" >



<label>  Qualification * </label>

<input type="text"  value="<?php echo $user[0]['user_qualification']; ?>"  class="form-control" name="qualification" id="qualification" required />

</div>

</div>



</div>



    

                   </div>  <!-- ending row-->





                    



    </div>   <!--  ending 10 column-->







   <div class="col-md-2 col-sm-12 col-xs-12" > 



   <?php if($user[0]['attach_image']!=NULL){ ?>

      

      <img src="<?php echo DOMAIN;?>Production/staff_pics/<?php echo $user[0]['attach_image'];?>" id="preview" class="img-thumbnail" style="width:180px;height:190px;"   />



   <?php }else { ?>   



       <img src="<?php echo DOMAIN;?>Production/images/upload.png" id="preview" height="170px" class="img-thumbnail" width="180px"  />





   <?php } ?>   



   </div>





</div>



        <div class="row">

                       

                  <div class="col-md-2 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Date of Birth *  </label>

                              <br>

                                      

                          <input type="date" value="<?php echo $user[0]['DOB']; ?>" required class="form-control" name="DOB" />

                          

                          </div>

                      </div>



  

                  <div class="col-md-2 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Date of Joining  </label>

                              <br>

                                      

                          <input type="date" value="<?php echo $user[0]['user_joining']; ?>" class="form-control" name="joining" />

                          

                          </div>

                      </div>



                    <div class="col-md-2 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Date of Confirmation  </label>

                              <br>

                                      

                          <input type="date" value="<?php echo $user[0]['user_confirmation']; ?>" class="form-control" name="confirmation" />

                          

                          </div>

                      </div>

  



                    <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label> Job Type  </label>

                              

                            <select name="jobtype" class="form-control" onChange="HideDate(this.value);" >

                        

                          <option value="">Select </option>                 

                            <option <?php if($user[0]['user_jobtype']=="Permanent"){echo "Selected";} ?> value="Permanent"> Permanent</option>

                            <option <?php if($user[0]['user_jobtype']=="Contract"){echo "Selected";} ?> value="Contract"> Contract</option>

                           </select>

                         

                          </div>

                      </div>





                      <div class="col-md-3 col-sm-12 col-xs-12" id="end" style="display:none;" >

                          <div class="form-group" >

                            

                            <label>  Contract Ending Date  </label>

                              <br>

                                      

                          <input type="date" value="<?php echo $user[0]['contract_ending_date']; ?>" class="form-control" name="contract_ending_date" />

                          

                          </div>

                      </div>

  







                   <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Designation </label>

                              <select name="designation" class="form-control"  >

                                <option value="">Select</option>



                  <?php

                  $query="select * from eduportal_designation_config where designation_id!='14' and designation_id!='15'";

                  $WorkAssignList = $m->query($query);

                  foreach($WorkAssignList as $WorkAssignListVal)

                  { ?>



                         <option <?php if($user[0]['designation_id']==$WorkAssignListVal['designation_id']){echo "selected";} ?>  value="<?php echo $WorkAssignListVal['designation_id']; ?>"><?php echo $WorkAssignListVal['designation_name']; ?></option>





                  <?php } ?>



                            </select>

                          </div>

                      </div>

                  





                   <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Department </label>

                              <select name="department" class="form-control"  >

                                <option value="">Select</option>



                  <?php

                  $query="select * from eduportal_hrm_department_config";

                  $WorkAssignList = $m->query($query);

                  foreach($WorkAssignList as $WorkAssignListVal)

                  { ?>



                         <option <?php if($user[0]['department_id']==$WorkAssignListVal['department_id']){echo "selected";} ?>  value="<?php echo $WorkAssignListVal['department_id']; ?>"><?php echo $WorkAssignListVal['department_name']; ?></option>





                  <?php } ?>



                            </select>

                          </div>

                      </div>

                  



                    <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Basic Salary  </label>

                              <br>

                                      

                          <input type="text" value="<?php echo $user[0]['user_salary']; ?>" class="form-control" name="salary"/>

                          

                          </div>

                      </div>







                      <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Address  </label>

                              <br>

                                      

                          <input type="text" value="<?php echo $user[0]['user_address']; ?>" class="form-control" name="address" />

                          

                          </div>

                      </div>



              <div class="col-md-3 col-sm-12 col-xs-12" style="padding-left:2px;">



              <div class="form-group" >

                

                <label for=""> Incharge Class </label>

          

             <select name="class_id" id="select_add" class="form-control"  onChange="getSection1(this.value)"  >

              <option value="">Select Class</option>



              <?php

              $m->where("branch_id", $_SESSION['branch']);

              $WorkAssignList = $m->get("edu_class_config");

              foreach($WorkAssignList as $WorkAssignListVal)

              { ?>



                 <option <?php if($user[0]['class_id']==$WorkAssignListVal['class_id']){echo "Selected";} ?> value="<?php echo $WorkAssignListVal['class_id']; ?>"><?php echo $WorkAssignListVal['Class_Name']; ?></option>



                  <?php } ?>



          </select>





              </div>

          </div>



           <div class="col-md-3 col-sm-12 col-xs-12" style="padding-left:2px;">



              <div class="form-group" >

                

                <label for=""> Incharge Section </label>

              <select name="section" id="txt_section" class="form-control" >

                 <option value=""> No Section </option>  

                 <?php

              if($_REQUEST['emp']!='')

              { 



              $m->where("class_id", $user[0]['class_id']); 

              $secondLevel = $m->get("edu_adm_section_detail");

             

              foreach($secondLevel as $secondLevel_val)

              {

                                      

               ?>

                <option <?php if($user[0]['section_id']==$secondLevel_val['section_id']){echo "Selected";} ?> value="<?php echo $secondLevel_val['section_id']; ?>"><?php echo $secondLevel_val['section_name']; ?></option>

                <?php  } ?>

                

                <?php } ?> 

              </select>

              

              </div>

          </div>



          <div class="col-md-3 col-sm-12 col-xs-12" >

            <div class="form-group" >

              

              <label>  Incharge  </label>

                <br>

                        

            <input type="text" value="<?php echo $user[0]['incharge']; ?>" class="form-control" name="incharge"/>

            

            </div>

           </div>





            <div class="col-md-3 col-sm-12 col-xs-12" >

              <div class="form-group" >

                

                <label>  Registration Number  </label>

                  <br>

                          

              <input type="text" value="<?php echo $reg_no; ?>" class="form-control" name="registratin_number"/>

              

              </div>

           </div>



            <div class="col-md-3 col-sm-12 col-xs-12" >

                <div class="form-group" >

                  

                  <label>  Driving License number </label>

                    <input type="text" class="form-control" value="<?php echo $user[0]['driving_license']; ?>" name="driving_license"  />

                </div>

            </div>

  

  

        </div> <!-- ending row -->

  

  

      



        <div class="row">





                       <div class="col-md-12" >  <h3> Bank Account Information  </h3>  </div>

                       

                      <div class="col-md-4 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Account Title </label>

                              <input type="text" class="form-control" value="<?php echo $user[0]['account_holder']; ?>" name="account_holder" />

                          </div>

                      </div>



                      <div class="col-md-4 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Bank Name </label>

                              <input type="text" class="form-control" value="<?php echo $user[0]['bank_name']; ?>" name="bank_name"  />

                          </div>

                      </div>



                  

                      <div class="col-md-4 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Account No </label>

                              <input type="text" class="form-control" value="<?php echo $user[0]['account_no']; ?>" name="account_no"  />

                          </div>

                      </div>







                       

                       <div class="col-md-12" >  <h3> Contact Information  </h3>  </div>

                       

                      <div class="col-md-4 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Cell No * </label>

                              <input type="text" class="form-control" value="<?php echo $user[0]['cell_no']; ?>" name="cell_no" onBlur="check_std_duplication1();" required   />

                          </div>

                      </div>



                      <div class="col-md-4 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Emergency Cell No </label>

                              <input type="text" class="form-control" value="<?php echo $user[0]['home_no']; ?>" name="home_no"  />

                          </div>

                      </div>


                      <div class="col-md-4 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Emergency Email </label>

                              <input type="text" class="form-control" value="<?php echo $user[0]['emergency_email']; ?>" name="emergency_email"  />

                          </div>

                      </div>



                  

                      <div class="col-md-4 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Postal Code </label>

                              <input type="text" class="form-control" value="<?php echo $user[0]['user_postalcode']; ?>" name="postal"  />

                          </div>

                      </div>


                     





<?php 



       if(!isset($_REQUEST['emp'])){

?>







<?php 

    }

?>





    

                   </div>  <!-- ending row-->









      



        <div class="row">



          <a class="btn btn-success"  onClick="myExperienceData();" style="padding: 5px 5px; font-size:14px;color:white;margin-left: 12px;"><i class="fa fa-Plus"></i>&nbsp;&nbsp; Add Previous Experience </a>

            

          <div class="col-md-12" id="hideShowExperienceData" style="display:none;">           

               

                <?php for ($i=0; $i < 5 ; $i++) { ?>                  

                                

                      <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Designation </label>

                              <input autocomplete="off"  type="text" class="form-control" value="<?php echo $preExperience[$i]['designation']; ?>" name="prev_desig[]"  />

                          </div>

                      </div>



                  

                      <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>Experience From</label>

                              <input autocomplete="off" type="date" class="form-control" value="<?php echo $preExperience[$i]['experience_from']; ?>" name="prev_exp_from[]" />

                          </div>

                      </div>





                      <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Experience To </label>

                              <input autocomplete="off" type="date" class="form-control" value="<?php echo $preExperience[$i]['experience_to']; ?>" name="prev_exp_to[]" />

                          </div>

                      </div>



                    <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Company/School/College</label>

                              <input autocomplete="off" type="text" class="form-control"  value="<?php echo $preExperience[$i]['organization']; ?>"  name="prev_comp[]"  />



                          </div>

                      </div>



                <?php } ?>



              </div>



    

                   </div>  <!-- ending row-->









                    <div class="row">



        <div class="col-md-12" >  <h3> Allowance  </h3>  </div>







        <div class="col-md-4 col-sm-12 col-xs-12" >



            <div class="form-group" >







                <label>  Traveling </label>



                <input autocomplete="off"  type="text" class="form-control" value="<?php echo $user[0]['emp_trav']; ?>" name="emp_trav"  />



            </div>



        </div>



               



        <div class="col-md-4 col-sm-12 col-xs-12" >



            <div class="form-group" >







                <label>  Reimbersement </label>



                <input autocomplete="off"  type="text" class="form-control" value="<?php echo $user[0]['emp_reimbersement']; ?>" name="emp_reimbersement"  />



            </div>



        </div>



        <div class="col-md-4 col-sm-12 col-xs-12" >



            <div class="form-group" >







                <label>  Others </label>



                <input autocomplete="off"  type="text" class="form-control" value="<?php echo $user[0]['emp_other']; ?>" name="emp_other"  />



            </div>



        </div>



    </div>









        <div class="row">

                       

                       <div class="col-md-12" >  <h3> Software Access  </h3>  </div>

                       

                      <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Email</label>

                              <input type="email" class="form-control"  value="<?php echo $user[0]['user_email']; ?>"  name="email"  />



                          </div>

                      </div>



                  

                      <div class="col-md-3 col-sm-12 col-xs-12" >

                          <div class="form-group" >

                            

                            <label>  Password </label>

                              <input autocomplete="off" type="text" class="form-control" value="<?php echo $user[0]['user_password']; ?>" name="password" />

                          </div>

                      </div>



                      <div class="col-md-3 col-sm-12 col-xs-12" style="margin-top: 18px;" >

                          <div class="form-group" >

                            

                            <label class="">User Access &nbsp;&nbsp;<input type="checkbox" class="larger" name="userAccess" value="1"></label>



                          </div>

                      </div>



                    

    

                   </div>  <!-- ending row-->







      <div class="col-md-12 pull-right">



          <input type="submit" value=" Save Record " class="pull-right btn btn-primary" >



      </div>









    </form>













      <div class="clearfix"></div>





     </div>   <!--  main row -->

















  </div>

  <div class="clearfix"></div>

</section>          

    



           

          </div>

        </div>



            </div>

          </div>

        </div>

        <!-- /page content -->

  



    

  <?php include('RootMe/js_linksscript.php');?>



  <script type="text/javascript">

    // function to set image on thumbnail



function readURL(input) {

  if (input.files && input.files[0]) {

      var reader = new FileReader();



      reader.onload = function (e) {

          $('#preview')

              .attr('src', e.target.result)

              .width(170)

              .height(180);

      };



      reader.readAsDataURL(input.files[0]);

  }

}





function ConvertCnic(value)

{

  

cnic.value = value.substring(0,5) + '-' + value.substring(5,12) + '-' + value.substring(12);  



}











// validations for form









$(function(){

  

  $("#add_emp").validate({

    rules: {

      fname: {

        

        required: true,

        minlength: 3,

        maxlength: 50,

      },

      lname: {

        

        minlength: 3,

        minlength: 3,

        maxlength: 50,

      },

      gender: {        

        required: true,

      },

      cnic: {

        required: true,

        //number: false,

         minlength: 13,

         minlength: 15,

      },

      

      cellno: {

        required: true,

        number: true,

        minlength:11,

        maxlength:13,

      },

      joining: {

        required: true,

      },

      jobtype: {

        required: true,

      },

      designation: {

        required: true,

      },

          

      email: {

        

//        required: true,

        email:true,

        minlength: 12,

        maxlength: 60,

        

      },







      gemail: {

        

  

        email:true,

        minlength: 12,

        maxlength: 25,

        

      },









      cnic: {

        

        required: true,

        minlength: 15,

        maxlength: 15,

      },

            

      

      city: {

        required: true,

      //  number: true,

      //  minlength: 6

      },



    

      gender: {

        required: true,

      //  number: true,

      //  minlength: 6

      },



      gcellno: {

        required: true,

        number: true,

        minlength: 11,

        maxlength:18, 

      },

      

      dob: {

        required: true,

      },





    },

    messages: {

      

      fname: {

        required: 'This field is required.',

        number:'Number not allowed'

      },

      

      cellno: {

        required: 'This field is required.',

        number:'Number not allowed',

        minlength:'Minimum length 11',

        maxlength:'Maximum length 18',        

      },

      

      

      dob: {

        required: 'This field is required.',

      },

      

      gender: {

        required: 'This field is required.',



      },

      

      

      

      postal: {

        required: 'This field is required.',

        number:'Only number allowed',

        maxlength: 'Maximum 15 allowed',

        

        

      },

        

      

    

      

      cellno: {

        number:'Only number allowed',

        required: 'This field is required.',

        maxlength: 'Maximum 15 allowed',

        minlength: 'Minimum length 8',

      },

      

        

      

      

      cnic: {

        required: 'This field is required',

        minlength: 'Minimum length: 13',

        maxlength: 'Maximum length: 13',

        

      },

      

      email: {

//        required: 'This field is required',

        minlength: 'Minimum length: 12',

        maxlength: 'Maximum length: 25',

        email: 'Enter a valid email',

        

      },

      

      gemai: {

//        required: 'This field is required',

        minlength: 'Minimum length: 12',

        maxlength: 'Maximum length: 25',

        email:'Enter a valid email',

        

      },

      

      

      

      

      fname: {

        required: 'This field is required.'

        

      }},

      gname: {

        required: 'This field is required.',

        minlength: 'Minimum length: 3'

      },

      cellno: {

        required: 'This field is required.',

        minlength: 'Minimum length: 8'

      },

      city: {

        required: 'This field is required.',

        minlength: 'Minimum length: 3'

      },

      

      postal: {

        required: 'This field is required.',

        

      },

      

      

      houseNo: {

        required: 'This field is required.',

        

      },

      province: {

        required: 'This field is required.',

        

      },

      streetNo: {

        required: 'This field is required.',

        

      },

      country: {

        required: 'This field is required.',

        

      },

      

      religion: {

        required: 'This field is required.',

        

      },

    

  });

  });







function myExperienceData() {

  var x = document.getElementById("hideShowExperienceData");

  if (x.style.display === "none") {

    x.style.display = "block";

  } else {

    x.style.display = "none";

    

  }

}



  </script>

  </body>

</html>

