<?php

defined('BASEPATH') OR exit('No direct script access allowed');

//echo  base_url('index.php/Client/clientGetdata/');

?>  





   	<script src="http://code.jquery.com/jquery-1.10.2.js"></script>

   	<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

    



     

<script type="text/javascript">

function check_if_exists(){ 

    		//alert();

    //var empcode=$("#empcodeid").val();

	 var empcode = $("#empcode").val();

	//alert(empcode);

	

    $.ajax({

        type:"POST",

        url: "<?php echo base_url('index.php/Employee/empcode_Exists');?>",

                    data:{ empcode:empcode},

        success:function(response)

	

         {

            if (response == true) 

            {

                      $('#msg').html('<div style="color:red;">employee code already exist<div>');

            }

            else 

            {       

                

                    $('#msg').html('<div style="color:red;"><div>');

            }  

     }   

    });

}



</script>

<form id="Employee" method="POST" action="<?php echo base_url('index.php/Employee/employeeGetdata/');?>"> 

<h3 class="box-title">EMPLOYEE</h3>



<div class="widget-box widget-color-blue">

	<div class="widget-header"><h4 class="box-title">Add New Employee</h4></div>

    <div class="widget-body">

    	<div class="widget-main">

        

<div class="row">

	<div class="col-sm-3 col-md-3 col-lg-3">

		<div class="form-group">

                        <?php foreach($empcode as $data){}?> 



			<label for="empcode">Employee Code </label> <span style="color:#F00" class="mandatory">*</span>

			<input type="text" name="empcode" onKeyup="check_if_exists()"  id="empcode" placeholder="Enter Employee code"

					class="form-control input-sm"  value="<?php echo $data->employeeCode+1; ?>">

                  

			<font color="#FF0000"><?php echo form_error('empcode'); ?></font>

            <div id="msg" ></div>

		</div>

 	</div>

   	<div class="col-sm-3 col-md-3 col-lg-3">

    	<div class="form-group" >

      		<label for="prefix">Select Prefix</label>

            <span class="mandatory" style="color:#F00">*</span>

            <select name="prefix" width="10" >

                <option value="Mrs" >Mrs.</option>

                <option value="Ms"  >Ms.</option>

                <option value="mr"  >Mr.</option>

            </select>

		</div>

	</div>

	<div class="col-sm-3 col-md-3 col-lg-3">

		<div class="form-group">

			<label for="first name">First Name </label> <span class="mandatory" style="color:#F00">*</span>

			<input type="text" name="fname" id="fnameid" placeholder="Enter first Name"

					class="form-control input-sm"  value="" maxlength="100" onkeyup="check_if_exists()"  required >

			<font color="#FF0000"><?php echo form_error('fname'); ?></font><div id="msg" ></div>

		</div>

   	</div>

	<div class="col-sm-3 col-md-3 col-lg-3">

		<div class="form-group">

			<label for="middlename">Middle Name</label>

			<input type="text" name="mname" id="mnameid" placeholder="  Enter your middle Name "

					class="form-control input-sm" value="" maxlength="100"  >

			<span style="color:#F03" id="msg"></span> 	

			<font color="#FF0000"><?php echo form_error(''); ?></font>	

		</div>

	</div>

</div>



<div class="row">

	<div class="col-sm-3 col-md-3 col-lg-3">

        <div class="form-group">

            <label for="lastName">Last Name</label><span style="color:#F00" class="mandatory">*</span>

            <input type="text" name="lname" id="lnameid" placeholder="Enter Last Name "

                    class="form-control input-sm" value="" required>

            <font color="#FF0000"><?php echo form_error(''); ?></font>

        </div>

    </div>

	<div class="col-sm-3 col-md-3 col-lg-3">

		<div class="form-group">

			<label for=""> Father's Name </label> <span style="color:#F00" class="mandatory">*</span>

			<input type="text" id="fatherid" name="fathername" placeholder="Enter Father's Name  "

					class="form-control input-sm" value="" required >

			<font color="#FF0000"><?php echo form_error(''); ?></font>

		</div>

  	</div>

	<div class="col-sm-3 col-md-3 col-lg-3">

		<div class="form-group">

			<label for="">Grand Father's Name </label> 

			<input type="text" id="dfid" name="gfname" placeholder="Enter Grand Father's Name "

					class="form-control input-sm" value="" required >

			<font color="#FF0000"><?php echo form_error(''); ?></font>

		</div>

  	</div>

	<div class="col-sm-3 col-md-3 col-lg-3">

		<div class="form-group">

			<label for="">Family Name</label> <span class="mandatory" style="color:#F00">*</span>		

			<input type="text" name="familyname" id="familyid" placeholder="  Enter your family Name" 

					class="form-control input-sm" value="" required/>

			<font color="#FF0000"><?php echo form_error(''); ?></font>

		</div>

	</div>

</div>

<div class="row">

	<div class="col-sm-3 col-md-3 col-lg-3">

		<label for="gender">Gender</label> <span style="color:#F00" class="mandatory">*</span>

		<div class="form-group" style="border: 1px solid #999; padding: 5px 0 0 5px !important;">	

			<label>

			<input name="gender" id="genderid" type="radio" class="ace" value="M" required />

			<span class="lbl"> Male</span>

		</label>

        <label>

			<input name="gender" id="genderid" type="radio" class="ace" value="F" required />

			<span class="lbl"> Female</span>

		</label>

        <label>

			<input name="gender" id="genderid" type="radio" class="ace" value="O" required />

			<span class="lbl"> Others</span>

		</label>

		</div>

        

        

	</div>

            

	<div class="col-sm-3 col-md-3 col-lg-3">

		<div class="form-group">

			<label for="Country">Nationality</label> <span style="color:#F00" class="mandatory">*</span>

   			<input type="text" id="Country" name="Country" required="required" class="form-control input-sm"

            		 placeholder="Enter Nationality"  />

   			<input type="hidden" id="Country-hidden" name="Countryhidden"   />

       </div>

  	</div> 

	<div class="col-sm-3 col-md-3 col-lg-3">

		<div class="form-group">			

			<label for="dob">Date of Birth</label> <span style="color:#F00" class="mandatory">*</span>

			<input type="text" name="dob" id="dobid" placeholder="select date"

					class="form-control input-sm datemask" data-mask value="" required />

			<font color="#FF0000"><?php echo form_error(''); ?></font>

		</div>

	</div>

	<div class="col-sm-3 col-md-3 col-lg-3">

		<div class="form-group">

			<label for="doj">Date of Joining</label><span style="color:#F00" class="mandatory">*</span>

			<input type="text" name="doj" id="dojid" placeholder="select date"

					class="form-control input-sm datemask" data-mask value="" required />	

			<span><font color="#FF0000"><?php echo form_error('cp1email'); ?></font></span>

		</div>

	</div>

</div>

 

<div class="row">   

	<div class="col-sm-3 col-md-3 col-lg-3">

		<div class="form-group">

			<label for="passportno">Passport Number</label><span style="color:#F00" class="mandatory">*</span>

			<input type="text" name="passportno" id="pid" placeholder="Enter passport Number"

					class="form-control input-sm" value=""  required />	

			<font color="#FF0000"><?php echo form_error('ph1'); ?></font>

		</div>

	</div>

	<div class="col-sm-3 col-md-3 col-lg-3">

		<div class="form-group">

			<label for="Phone_Number2">Passport Expiry Date</label><span style="color:#F00" class="mandatory">*</span>

			<input type="text" name="pexp" id="pxpid" placeholder="select date"

					class="form-control input-sm datemask" data-mask value="" required   />	

			<font color="#FF0000"><?php echo form_error('ph2'); ?></font>

		</div>

	</div>

	<div class="col-sm-3 col-md-3 col-lg-3">

		<div class="form-group">

			<label for="">Iqama Number</label><span style="color:#F00" class="mandatory">*</span>

			<input type="text" name="iqno" id="iqid" placeholder="  Enter iqama Number"

					class="form-control input-sm" value="" required />	

			<font color="#FF0000"><?php echo form_error('ph1'); ?></font>

		</div>

	</div>

	<div class="col-sm-3 col-md-3 col-lg-3">

		<div class="form-group">

			<label for="Phone_Number2">iqama Expiry Date</label><span style="color:#F00" class="mandatory">*</span>

			<input type="text" name="iqexp" id="iqexid" placeholder="select date" value=""

					class="form-control input-sm datemask" data-mask required />	

			<font color="#FF0000"><?php echo form_error(''); ?></font>

		</div>

	</div>

</div>

		</div>

        <div class="widget-header">

        	<div class="row">

                <div class="col-sm-3 col-md-3 col-lg-3">

                    <div id="contact_submit" class="form-group">

                        <button type="submit" class="btn btn-block btn-success" id="type"> 

                            <i class=""></i> SAVE

                        </button>

                    </div> 

                </div>	

            </div>  

        </div>

    </div>

</div>

</form>       









		