
    <script type="text/javascript">
  //
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
        });
		$(document).on("click", "#updatebtn", function()
        {
		 var mycategoryid = $(this).data('id');
		  $("#mycategoryid1").val(mycategoryid); 
		  
		   var statutory = $(this).data('statutory');
		  $("#statutory").val(statutory); 
		   
			var qtymode = $(this).data('qtymode');
		   $("#qtymode1").val(qtymode);
 
		    var code = $(this).data('code');
		   $("#code1").val(code); 
		   
		     var amount = $(this).data('amount');
		   $("#amount1").val(amount); 
		    var amountmode = $(this).data('amountmode');
		   $("#amountmode1").val(amountmode);
 
 
		   		   
   var status = $(this).data('status');
		   $("#status1").val(status);
 
		    var name = $(this).data('name');
		   $("#name1").val(name); 
		   
		     var category = $(this).data('category');
		   $("#category1").val(category); 
		    var unit = $(this).data('unit');
		   $("#unit1").val(unit);
 
		    var name = $(this).data('name');
		   $("#name1").val(name); 
		   
		     var quantity = $(this).data('quantity');
		   $("#quantity1").val(quantity); 
		 
		  
		  
		   
        });
		$(document).on("click", "#editbtn", function()
        {
		 var mycategoryid = $(this).data('id');
		  $("#mycategoryid").val(mycategoryid); 
		   
			var qtymode = $(this).data('qtymode');
		   $("#qtymode").val(qtymode);
 
		    var code = $(this).data('code');
		   $("#code").val(code); 
		   
		     var amount = $(this).data('amount');
		   $("#amount").val(amount); 
		    var amountmode = $(this).data('amountmode');
		   $("#amountmode").val(amountmode);
 
 
		   		   
   var status = $(this).data('status');
		   $("#status").val(status);
 
		    var name = $(this).data('name');
		   $("#name").val(name); 
		   
		     var category = $(this).data('category');
		   $("#category").val(category); 
		    var unit = $(this).data('unit');
		   $("#unit").val(unit);
 
		    var name = $(this).data('name');
		   $("#name").val(name); 
		   
		     var quantity = $(this).data('quantity');
		   $("#quantity").val(quantity); 
		 
		  
		  
		   
        });
		
		
		
		
    </script>   
 
 <div class="row">
  
   	 	<div class="col-md-4">
				<div class="panel-body">

				<div class="widget-content nopadding table_holder table-responsive" >
			
	<a class="btn btn-default" href="<?php echo base_url(); ?>user/viewemployee"> Back?</a>
	<a class="btn btn-default" href="<?php echo base_url(); ?>user/payrollsetup"> Pay/Deduction Setup</a>
	<a class="btn btn-default" href="<?php echo base_url(); ?>user/salaryhistory"> Salary History</a>
<div>
<?php

$image_id=   $member[0]['image_id'];


?>
<center>
					<div class="btn-group"  >
					
                                    <button type="button" class="btn btn-info btn-sm dropdown-toggle" data-toggle="dropdown">
                                     Click to view   More <span class="caret"></span>
                                    </button>
									
                                    <ul class="dropdown-menu dropdown-primary pull-right" role="menu">
	  <li> 

	 <a class="btn btn-primary editbtn" id="editbtn"  data-customerid1='<?php echo  $c->id;?>' data-toggle='modal' data-target='#editProductModel'> 	 

                                                <i class="glyphicon glyphicon-pencil"></i>
																Opening Balance
                                                </a>
                                                        </li>
										
										
												</br>
 <li>
											   <a  id="more" target="_blank" class="btn btn-default" href="<?php echo base_url();?>user/viewfollowups?randomitemidentifier=<?php   {echo  $id;}  ?>&currentid=<?php   {echo  $id;}  ?>&type=Customer">Follow Ups  </a>
												</li>
																								</br>





										
										  <li> 
										                              <a  id="more" class="btn btn-primary" href="<?php echo base_url();?>user/viewmygrouping?randomitemidentifier=<?php   {echo  $id;}  ?>">Group  </a>

                                                        </li>
														
														
</br>

																<li> 
										                              <a target="_blank" id="more" class="btn btn-primary" href="<?php echo base_url();?>user/viewmydocuments?randomitemidentifier=<?php   {echo  $id;}  ?>&image_id=<?php   {echo  $image_id;}  ?>">Documents  </a>

                                                        </li>
												
</br>                                
												<li>											  
 	</br>
											   <a  id="more" target="_blank" class="btn btn-default" href="<?php echo base_url();?>user/employeenote?randomitemidentifier=<?php   {echo  $id;}  ?>&currentid=<?php   {echo  $id;}  ?>&type=Customer">Employee Notes   </a>
												</li>
</br>

												  <li> 
                     <a  id="more" target="_blank" class="btn btn-primary" href="<?php echo base_url();?>user/getinvoivebysupplier?randomitemidentifier=<?php   {echo  $id;}  ?>">All Invoices  </a>

                                                        </li>
														</br>
   
									        

											
                                    </ul>
										
                                </div>
	  	</center>

</div>
				
	<?PHP
	
   echo $this->session->flashdata('msg'); 


   echo $this->session->flashdata('deletemsg'); 

 
                  echo form_open('user/addmypayrollsetup' , array('class' => 'form-horizontal form-groups-bordered validate',  'id' => 'signup','enctype' => 'multipart/form-data'));

		 if(validation_errors()):?>

<?php endif;?>



  
    <div class="form-group">
    <label for="inputfirstname" class="col-sm-2 control-label">First Name</label>
    <div class="col-sm-10">
		<input type="text"  name="firstname" value="<?php echo set_value('firstname',$member[0]['firstname']) ;?>" id="firstname" class="form-control" required placeholder="Enter your Other Names">
       <span class="text-danger"><?php echo form_error('firstname'); ?></span>
   </div>
  </div>
  <div class="form-group">

    <label for="inputlastname" class="col-sm-2 control-label">Last Name</label>
    <div class="col-sm-10">
			  		<input type="hidden" readonly name="myid" value="<?php echo set_value('myid',$member[0]['id']); ?>"id="myid" class="form-control" required placeholder="Enter itemid">

		  		<input type="text"  name="lastname" value="<?php echo set_value('surname',$member[0]['surname']); ?>"id="lastname" class="form-control"  placeholder="Enter your lastname">
     <span class="text-danger"><?php echo form_error('lastname'); ?></span>
   </div>
  </div>
   <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label"> ID Number</label>
    <div class="col-sm-10">
		<input type="text"  name="idno" value="<?php echo set_value('idno',$member[0]['idno']) ;?>" id="idnumber" class="form-control"  placeholder="Enter employee ID.No">
       <span class="text-danger"><?php echo form_error('idno'); ?></span>
   </div>
  </div>
     <div class="form-group">
    <label for="inputidnumber" class="col-sm-2 control-label">Employee PIN</label>
    <div class="col-sm-10">
		<input type="text"  name="idnumber" value="<?php echo set_value('idnumber',$member[0]['idnumber']) ;?>" id="idnumber" class="form-control"  placeholder="Enter PIN">
       <span class="text-danger"><?php echo form_error('idnumber'); ?></span>
   </div>
  </div>
   <div class="form-group">
    <label for="inputnumber" class="col-sm-2 control-label">Employee Number</label>
    <div class="col-sm-10">
		<input type="text"  name="number" value="<?php echo set_value('number',$member[0]['number']) ;?>" id="number" class="form-control"  placeholder="Enter employee number">
       <span class="text-danger"><?php echo form_error('number'); ?></span>
   </div>
  </div>
  
  
    <div class="form-group">
    <label for="inputemail" class="col-sm-2 control-label">Email</label>
    <div class="col-sm-10">
				<input type="email"   name="email" value="<?php echo set_value('email',$member[0]['email']) ;?>" id="email" class="form-control"  placeholder="Enter Your email">
    <span class="text-danger"><?php echo form_error('email'); ?></span>
	</div>
  </div>

  <div class="form-group">
    <label for="inputphone" class="col-sm-2 control-label"> Phone </label>
    <div class="col-sm-10">
				<input type="text" name="phone"  value="<?php echo set_value('phone',$member[0]['phone']); ?>"id="phone" class="form-control" required placeholder="Create your own phone">
    <span class="text-danger"><?php echo form_error('phone'); ?></span>
   </div>
  </div>
  
  
 
   <div class="form-group">
    <label for="inputentrydate" class="col-sm-2 control-label"> Date Joined </label>
    <div class="col-sm-10">
				<input type="date" name="entrydate"  value="<?php echo set_value('entrydate',$member[0]['entrydate']); ?>"id="phone" class="form-control"  placeholder="Enter Date Joined " >
    <span class="text-danger"><?php echo form_error('entrydate'); ?></span>
   </div>
  </div>
  <div class="form-group">
    <label for="inputprobationdate" class="col-sm-2 control-label"> End of Probation  </label>
    <div class="col-sm-10">
				<input type="date" name="probationdate"  value="<?php echo set_value('probationdate',$member[0]['probationdate']); ?>"id="phone" class="form-control"  placeholder="Enter end of probation date " >
    <span class="text-danger"><?php echo form_error('probationdate'); ?></span>
   </div>
  </div>
  
   <div class="form-group">
    <label for="inputsalary" class="col-sm-2 control-label"> Basic static Salary </label>
    <div class="col-sm-10">
				<input type="text" name="salary"  value="<?php echo set_value('salary',$member[0]['salary']); ?>"id="phone" class="form-control" required placeholder="Enter salary " >
    <span class="text-danger"><?php echo form_error('salary'); ?></span>
   </div>
  </div>
  
    <div class="form-group">
    <label for="inputdob" class="col-sm-2 control-label"> 	  Birth Date </label>
    <div class="col-sm-10">
		
				<input type="date" name="dob" value="<?php echo set_value('dob',$member[0]['dob']) ;?>" id="dob" class="form-control"  placeholder="Enter date of birth">
	
		<span class="text-danger">Date of Birth (YYY-M-D)<?php echo form_error('dob'); ?>
		
		</span>
	</div>
  </div>
  
  <div class="form-group">
    <label for="inputmarital" class="col-sm-2 control-label">Marital Statu</label>
    <div class="col-sm-10">
		
	
		
			<select  class="form-control" name="marital">
											<option value="<?php echo $member[0]['marital']; ?>" selected="selected" > <?php  echo $member[0]['marital'];?> </option>

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

				<option value="Single">Single</option>
				<option value="Married" > Married </option>

								
				
				</select>		
		  		
				
		<span class="text-danger"> 	<?php echo form_error('marital'); ?>
		
		</span>
	</div>
  </div>	
  
  
  
  <div class="form-group">
    <label for="inputdleavegroup" class="col-sm-2 control-label">Leave	Group</label>
    <div class="col-sm-10">
	<select class="form-control" name="leavegroup" >


	
	<?php 			 $myleavegroup=$member[0]['leavegroup'];

					 $leavegroup= $this->usermodel->populateall('leavegroup','id',$myleavegroup);



if(is_array($leavegroup)) {

   foreach($leavegroup as $leavegrouprow){

  // echo $leavegrouprow->name;
   
    ?>
										<option value="<?php echo $myleavegroup; ?>" selected="selected" > <?php  echo $leavegrouprow->name;?> </option>



	<?php
 
 
}} else {
   }
 ?>
<option value="">---Select Leave Group----</option>



	<?php
	

					 
			$leavegroup = $this->usermodel->populatealldata('leavegroup','id','DESC');

	


if(is_array($leavegroup)) {

   foreach($leavegroup as $leavegrouprow){

   //echo $courserow->coursename;
    ?>

					<option value="<?=  $leavegrouprow->id;   ?>"><?=  $leavegrouprow->name; ?></option>



	<?php

}} else {
    echo 'No leaveg roup   available.';
}
	
   


?>
			 
			
				
				</select>
		
						<span class="text-danger"><?php echo form_error('department'); ?>

	</div>
  </div>
  
  
  
  		<div class="form-group">
    <label for="inputdepartment" class="col-sm-2 control-label">	Dep.</label>
    <div class="col-sm-10">
	<select class="form-control" name="department" >
	<?php 			 $mydepartment=$member[0]['department'];

					 $department= $this->usermodel->populateall('department','id',$mydepartment);



if(is_array($department)) {

   foreach($department as $departmentrow){

  // echo $leavegrouprow->name;
   
    ?>
										<option value="<?php echo $mydepartment; ?>" selected="selected" > <?php  echo $departmentrow->name;?> </option>



	<?php
 
 
}} else {
   }
 ?>
								<option value="">---Select your Department----</option>

	
	<?php 
					 
			$department = $this->usermodel->populatealldata('department','id','DESC');

	


if(is_array($department)) {

   foreach($department as $departmentrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $departmentrow->id;   ?>"><?=  $departmentrow->name; ?></option>



	<?php

}} else {
    echo 'No department  available.';
}
	
   


?>
			 
			
				
				</select>
		
						<span class="text-danger">Department<?php echo form_error('department'); ?>

	</div>
  </div>
  
  
  	
	
  		<div class="form-group">
    <label for="inputdmanager" class="col-sm-2 control-label">HOD</label>
    <div class="col-sm-10">
	<select class="form-control" name="manager" >
	<?php 			 $mymanager=$member[0]['manager'];

					 $membership= $this->usermodel->populateall('people','id',$mymanager);



if(is_array($membership)) {

   foreach($membership as $membershiprow){

  // echo $leavegrouprow->name;
   
    ?>
					<option value="<?=  $mymanager;   ?>"><?=  $membershiprow->lastname." ".$membershiprow->firstname."(".$membershiprow->number.")"; ?></option>



	<?php
 
 
}} else {
   }
 ?>
								<option value="">---Please select the supervisor----    </option>

	
	<?php 
					 
								$supervisor = $this->usermodel->populatealldata('supervisor','id','DESC');
 
					 

	


if(is_array($supervisor)) {

   foreach($supervisor as $supervisorrow){

  $employeeno= $supervisorrow->employeeno;
  
  $mymyenployee= $this->usermodel->populateall('people','id',$employeeno);



if(is_array($mymyenployee)) {

   foreach($mymyenployee as $myenployeerow){

 
   ?>
					<option value="<?=  $myenployeerow->id;   ?>"><?=  $myenployeerow->lastname." ".$myenployeerow->firstname."(".$myenployeerow->number.")"; ?></option>



	<?php
}} else {
    echo 'No Employee';
}
	
  

}} else {
    echo 'No supervisor  available.';
}
	
   


?>
			 
			
				
				</select>
		
						<span class="text-danger">Supervisor/Manager<?php echo form_error('manager'); ?>

	</div>
  </div>
  
  		  
  
  
    <div class="form-group">
    <label for="inputjobstatus" class="col-sm-2 control-label">	Job status</label>
    <div class="col-sm-10">
	<select class="form-control" name="jobstatus" required>
						<option value=""  > -- select Payment--</option>

	<option value="<?php echo $member[0]['jobstatus']; ?>"  selected="selected"><?php echo $member[0]['jobstatus']; ?></option>

				<option value="Permanent"> Permanent</option>
<option value="Contract"> Contract</option>
		<option value="Part Time">  Part Time</option>
		<option value="Internship">  Internship</option>
		<option value="Attachment">  Attachment</option>

		
	
	</select>
						<span class="text-danger"><?php echo form_error('jobstatus'); ?></span>

	</div>
  </div>
  
  
  
  
  
  
  
    <div class="form-group">
    <label for="inputpaymentmode" class="col-sm-2 control-label">	Payment</label>
    <div class="col-sm-10">
	<select class="form-control" name="paymentmode" required>
						<option value=""  > -- select Payment--</option>

		<option value="<?php echo $member[0]['paymentmode']; ?>"  selected="selected"><?php echo $member[0]['paymentmode']; ?></option>


				<option value="Daily"> Daily</option>
<option value="Weekly"> Weekly</option>
		<option value="Monthly">  Monthly</option>
		<option value="Yearly">  Yearly</option>

		
		<option value="Semi-Monthly"> Semi-Monthly</option>
				<option value="Semi-Weekly"> Semi-Weekly</option>

	</select>
						<span class="text-danger"><?php echo form_error('paymentmode'); ?></span>

	</div>
  </div>
  
  <div class="form-group">
    <label for="inputpaid" class="col-sm-2 control-label">Is Paid?</label>
    <div class="col-sm-10">
	<select class="form-control" name="paid" required>
			<option value="<?php echo $member[0]['paid']; ?>"  selected="selected"><?php echo $member[0]['paid']; ?></option>

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


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


		
	
	</select>

	</div>
  </div>
  
  
  <div class="form-group">
    <label for="inputsalarystartdate" class="col-sm-2 control-label"> Effective Date </label>
    <div class="col-sm-10">
				<input type="date" name="salarystartdate"  value="<?php echo set_value('salarystartdate',$member[0]['salarystartdate']); ?>"id="salarystartdate" class="form-control"  placeholder="Enter salary start date " >
    <span class="text-danger"><?php echo form_error('salarystartdate'); ?></span>
   </div>
  </div>
    <div class="form-group">
    <label for="inputsalaryreviewdate" class="col-sm-2 control-label"> Next Review Date </label>
    <div class="col-sm-10">
				<input type="date" name="salaryreviewdate"  value="<?php echo set_value('salaryreviewdate',$member[0]['salaryreviewdate']); ?>"id="salaryreviewdate" class="form-control"  placeholder="Enter next review  date " >
    <span class="text-danger"><?php echo form_error('salaryreviewdate'); ?></span>
   </div>
  </div>
   <div class="form-group">
    <label for="inputbankname" class="col-sm-2 control-label"> Bank Name </label>
    <div class="col-sm-10">
	
	
	<select class="form-control" name="bankname" >


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

	<?php 		$mybak="";	
$mybankcodes = $this->usermodel->populateall('glaccounts','number',$member[0]['bankname']);
//$mybankcodes= $this->usermodel->populatealldatanoarray('glaccounts','companyid',$companyid,'accounttype','1');



if(is_array($mybankcodes)) {

   foreach($mybankcodes as $mybankcodesrow){
$mybak="";
  // echo $leavegrouprow->name;
   
    ?>
					<option selected value="<?=  $mybankcodesrow->number;   ?>"><?=  $mybankcodesrow->accountname ."(Acc No:". $mybankcodesrow->number .")"; ?></option>



	<?php
 
 
}} else {
	$mybak=$member[0]['bankname'];
   }
 ?>
	

	<?php
	

					 

	$bankcodes= $this->usermodel->populatealldatanoarray('glaccounts','companyid',$companyid,'accounttype','1');



if(is_array($bankcodes)) {

   foreach($bankcodes as $bankcodesrow){

   //echo $courserow->coursename;
    ?>

					<option value="<?=  $bankcodesrow->number;   ?>"><?=  $bankcodesrow->accountname ."(Acc No:". $bankcodesrow->number .")"; ?></option>



	<?php

}} else {
    echo 'No Bank   available.';
}
	
   


?>
			 
			
				
				</select>
		
	
	
	
	
	
	
	
	
	
	
    <span class="text-danger"><?php echo form_error('bankname'); 
	if($mybak !=""){
		echo"Error! Update this bank to correct name from ". $member[0]['bankname'];	
	}


	?>
	
	
	</span>
   </div>
  </div>
     <div class="form-group">
    <label for="inputbankcode" class="col-sm-2 control-label"> Bank/Swift Code </label>
    <div class="col-sm-10">
				<input type="text" name="bankcode"  value="<?php echo set_value('bankcode',$member[0]['bankcode']); ?>"id="bankcode" class="form-control"  placeholder="Enter bank  code " >
    <span class="text-danger"><?php echo form_error('bankcode'); ?></span>
   </div>
  </div>
      <div class="form-group">
    <label for="inputbranchcode" class="col-sm-2 control-label"> Branch Code </label>
    <div class="col-sm-10">
				<input type="text" name="branchcode"  value="<?php echo set_value('branchcode',$member[0]['branchcode']); ?>"id="branchcode" class="form-control"  placeholder="Enter bank branch code " >
    <span class="text-danger"><?php echo form_error('branchcode'); ?></span>
   </div>
  </div>
  
  
   <div class="form-group">
    <label for="inputbankaccount" class="col-sm-2 control-label"> Bank Account No</label>
    <div class="col-sm-10">
				<input type="text" name="bankaccount"  value="<?php echo set_value('bankaccount',$member[0]['bankaccount']); ?>"id="bankaccount" class="form-control"  placeholder="Enter account number" >
    <span class="text-danger"><?php echo form_error('bankaccount'); ?></span>
   </div>
  </div>
  <div class="form-group">
    <label for="inputkra" class="col-sm-2 control-label"> KRA</label>
    <div class="col-sm-10">
				<input type="text" name="kra"  value="<?php echo set_value('kra',$member[0]['kra']); ?>"id="kra" class="form-control"  placeholder="Enter KRA number" >
    <span class="text-danger"><?php echo form_error('kra'); ?></span>
   </div>
  </div>
  
     <div class="form-group">
    <label for="inputnhif" class="col-sm-2 control-label"> SHA</label>
    <div class="col-sm-10">
				<input type="text" name="nhif"  value="<?php echo set_value('nhif',$member[0]['nhif']); ?>"id="nhif" class="form-control"  placeholder="Enter Bank Account No number" >
    <span class="text-danger"><?php echo form_error('nhif'); ?></span>
   </div>
  </div>
  
     <div class="form-group">
    <label for="inputnssf" class="col-sm-2 control-label"> NSSF</label>
    <div class="col-sm-10">
				<input type="text" name="nssf"  value="<?php echo set_value('nssf',$member[0]['nssf']); ?>"id="nhif" class="form-control"  placeholder="Enter NSSF number" >
    <span class="text-danger"><?php echo form_error('nssf'); ?></span>
   </div>
  </div>
  
  
    <div class="form-group">
    <label for="inputmethod" class="col-sm-2 control-label">Method</label>
    <div class="col-sm-10">
	<select class="form-control" name="method" required>
			<option value=""  >---Select payment Method---</option>

	<?php 
					 $mythod=$member[0]['method'];
					$paymentmode = $this->usermodel->populateallarray('paymentmethodes','id', $mythod);

					
					$methoname=$paymentmode[0]["name"];
			   $mycategory= $this->usermodel->populateall('paymentmethodes','status',"active");

			   
			   ?>
			<option value="<?php echo $mythod; ?>"  selected="selected"><?php echo $methoname; ?></option>

	
	<?php 
					 
			
			   $mycategory= $this->usermodel->populateall('paymentmethodes','status',"active");



if(is_array($mycategory)) {

   foreach($mycategory as $mycategoryrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $mycategoryrow->id;   ?>"><?=  $mycategoryrow->name; ?></option>



	<?php

}} else {
    echo 'No category/ group available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('categoryid'); ?>

	</div>
  </div>
  

      <div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">	Status</label>
    <div class="col-sm-10">
	<select class="form-control" name="status" required>
	
	<option value="1"  selected="selected">  active</option>
		<option value="0">  inactive</option>
	
	</select>
						<span class="text-danger"><?php echo form_error('status'); ?></span>

	</div>
  </div>









		
 <div class="form-group">
    <label for="inputsupplier" class="col-sm-2 control-label">Branch</label>
    <div class="col-sm-10">
				
				
				<select class="form-control" name="branchid"  id="branchid" required>
	
	
	<option value=""  >---Select Branch/Counter to Open--</option>

									
								
<?php
	     $mybranch=$this->usermodel->populateall('branch','id',$member[0]['branchid']);


if(is_array($mybranch)) {

   foreach($mybranch as $branchrow){

   ?>
					<option selected="selected" value="<?=  $branchrow->id;   ?>"><?=  $branchrow->name; ?></option>




	<?php

}} else {
    echo 'No Branch available.';
}
	
?>
	
	
	
	
	
	
	<?php 
					 
					 		$maincategory = $this->usermodel->populateall('branch','companyid',$companyid);


							


if(is_array($maincategory)) {

   foreach($maincategory as $maincategoryrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $maincategoryrow->id;   ?>"><?=  $maincategoryrow->name; ?></option>



	<?php

}} else {
    echo 'No main counter available.';
}
	
?>
</select>
				
		</div>
  </div>
					
		
	
		
	   <div class="form-group" >
    <label for="inputnhifrelief" class="col-sm-2 control-label"> SHA relief </label>
    <div class="col-sm-10">
				<input type="text"  name="nhifrelief"  value="<?php echo set_value('nhifrelief',$member[0]['nhifrelief']); ?>"id="nhifrelief" class="form-control"  placeholder="Enter SHA relief " >
    <span class="text-danger"><?php echo form_error('nhifrelief'); ?></span>
   </div>
  </div>
  
  	



  
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
     
	<button type="submit" name="btn_updatepayroll" class="btn btn-primary" value="payroll">SAVE</button>
                     <a  id="more" class="btn btn-primary" href="<?php echo base_url();?>user/editmember?randomitemidentifier=<?php   {echo  $member[0]['id'];   }  ?>">Back to this employee  </a>

<a class="btn primary" href="<?php echo base_url(); ?>user/viewmember"> Back to all employees?</a>
    </div>
   </div>
   

 

			<?PHP
		echo form_close();
		
		?>
		
		</div>
</div>
</div>
   	<div class="col-md-8">
	
  
		<div class="panel panel-default" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>
							
View my pay/ deductions
<br>
						 <a data-toggle='modal' data-target='#payeModal' class="btn btn-primary">Process Statutory deductions </a>

						 <a data-toggle='modal' data-target='#addModal' class="btn btn-primary">Process Payroll </a>

            	</div>
            </div>
			<div class="panel-body">

				<div class="widget-content nopadding table_holder table-responsive" >				
	<?PHP
				echo $this->session->flashdata('activemsg'); 								?>	
										
					<div class="row">
						<div class="col-md-12">
							
							<div class="panel-body">
	
									
									
				<table cellpadding="0" cellspacing="0" border="0" class="table  table-striped" style="border-color:#CCCCCC; width:100%;"  >

             <thead>
         <tr>
     <th>Code</th>
	      <th>Category</th>

     <th>Name</th>
	      <th>Amount</th>

	 <th>Quantity</th>
	  	 <th>Unit</th>

<th>Amount Mode</th>		 
		<th>Qty Mode</th>		 
		<th>Statutory</th>		 

		<th>Status</th>		 

	<th>More</th>	

                 </tr>
             </thead><tbody>
<?php
 if(!is_array($payrollsetup)) {
				    echo '<div class="alert alert-danger text-center">There is no salary setup for this employee.</div>';

			 }else{

    
       
  
  	foreach ($payrollsetup as $c): 

		 

             ?>



             <tr>
                
            <?php 
$id=$c->id;


?>


  <td><?php echo $c->code ; ?></td>          
      <td><?php echo $c->category ; ?></td>          

  <td><?php echo $c->name ; ?></td>
    <td><?php echo $c->amount ; ?></td>

   
   	  <td><?php echo $c->quantity ; ?></td>
	  <td><?php echo $c->unit ; ?></td>

  
  
  
  
  	  <td><?php echo $c->amountmode ; ?></td>
	  <td><?php echo $c->qtymode ; ?></td>
	  <td><?php 

if($c->statutory=="NHIF"){
	echo "SHIF";
}else if($c->statutory=="HOUSE LEVY"){

	echo "HOUSING LEVY";



}else{
	
echo $c->statutory	;
}

	   ?></td>

  
  
	  <td><?php echo $c->status ; ?></td>
	 <td> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
                                        More <span class="caret"></span>
                                    </button>
									
                                    <ul class="dropdown-menu dropdown-primary pull-right" role="menu">
                                        
                                        <!-- teacher EDITING LINK -->
                                      
										
											  <li> 
										 <a class="btn btn-danger managebtn" id="managebtndelete"		 data-id='<?php echo  $c->id;?>'    data-toggle='modal' data-target='#myModal<?php  $c->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Remove / Cancel
                                                </a>
                                                        </li>
									
									
                                        <li class="divider"></li>
                                        
                                     	  <li> 

		   	 <a class="btn btn-primary updatebtn" id="updatebtn"   data-statutory ='<?php echo  $c->statutory ;?>'  data-quantity='<?php echo  $c->quantity;?>' data-unit='<?php echo  $c->unit;?>' data-category='<?php echo  $c->category;?>' data-status='<?php echo  $c->status;?>' data-amountmode='<?php echo  $c->amountmode;?>'  data-amount='<?php echo  $c->amount;?>' data-code='<?php echo  $c->code;?>'  data-qtymode='<?php echo  $c->qtymode;?>' data-name='<?php echo  $c->name;?>' data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#updateProductModel'> 	 

                                                <i class="glyphicon glyphicon-pencil"></i>
																Update
                                                </a>
                                                        </li>
										
                                    </ul>
										
                                </div>
</td>
		 
		 
		 
             </tr>

	<?php endforeach;} ?>

             
<tbody>
        </table>

							




<br>
<h2>AVAILABLE PAYMENTS/DEDUCTIONS</h2>
<br>

				<table cellpadding="0" cellspacing="0" border="0" class="table  table-striped" id="example" style="border-color:#CCCCCC; width:100%;"  >

             <thead>
         <tr>
     <th>Code</th>
	      <th>Category</th>

     <th>Name</th>
	      <th>Amount</th>

	 <th>Quantity</th>
	  	 <th>Unit</th>

<th>Amount Mode</th>		 
		<th>Qty Mode</th>		 

		<th>Status</th>		 

	<th>More</th>	

                 </tr>
             </thead><tbody>
<?php

$session_data = $this->session->userdata('logged_in');

   
 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
		 		$data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
		
						$allsetup= $this->usermodel->populateall('salarycharges','companyid',$companyid);








 if(!is_array($allsetup)) {
				    echo '<div class="alert alert-danger text-center">There is no salary setup in the system.</div>';

			 }else{

    
       
  
  	foreach ($allsetup as $c): 

		 

             ?>



             <tr>
                
            <?php 
$id=$c->id;


?>


  <td><?php echo $c->code ; ?></td>          
      <td><?php echo $c->category ; ?></td>          

  <td><?php echo $c->name ; ?></td>
    <td><?php echo $c->amount ; ?></td>

   
   	  <td><?php echo $c->quantity ; ?></td>
	  <td><?php echo $c->unit ; ?></td>

  
  
  
  
  	  <td><?php echo $c->amountmode ; ?></td>
	  <td><?php echo $c->qtymode ; ?></td>

  
  
	  <td><?php echo $c->status ; ?></td>
	 <td> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
                                        Assign <span class="caret"></span>
                                    </button>
									
                                    <ul class="dropdown-menu dropdown-primary pull-right" role="menu">
                                        
                                        <!-- teacher EDITING LINK -->
                                      
										
                                        
                                     	  <li> 

		   	 <a class="btn btn-primary editbtn" id="editbtn"  data-quantity='<?php echo  $c->quantity;?>' data-unit='<?php echo  $c->unit;?>' data-category='<?php echo  $c->category;?>' data-status='<?php echo  $c->status;?>' data-amountmode='<?php echo  $c->amountmode;?>'  data-amount='<?php echo  $c->amount;?>' data-code='<?php echo  $c->code;?>'  data-qtymode='<?php echo  $c->qtymode;?>' data-name='<?php echo  $c->name;?>' data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#editProductModel'> 	 

                                                <i class="glyphicon glyphicon-pencil"></i>
																Assign to employee
                                                </a>
                                                        </li>
										
                                    </ul>
										
                                </div>
</td>
		 
		 
		 
             </tr>

	<?php endforeach;} ?>

             
<tbody>
        </table>
							
									
									
					</div>	

					
					
					
					
					
					
					
	
	<div id="payeModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Calculate paye</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');
					  $mydate=date("Y-m-d H:i:s");
					  $frommydate=date("Y-m-d 00:00:00");

         $YEAR = date('Y');
				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/calculatemypaye' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>

	
	
	
	
	
	
		
<div class="form-group">
    <label for="inputsalaryyear" class="col-sm-2 control-label">	Year </label>
    <div class="col-sm-10">
		<input type="hidden" name="view" value="user/salaryhistory"id="view" class="form-control" required placeholder="Enter status">
		  		<input type="hidden" name="amount" value="<?php echo set_value('amount'); ?>" class="form-control" required placeholder="Enter gross salary ">

	<input type="hidden" name="view1" value="user/mypayrollsetup?randomitemidentifier=<?php echo $member[0]['id']; ?>"id="view" class="form-control" required placeholder="Enter status">
	<input type="hidden" name="action" value="insert"id="action" class="form-control" required placeholder="Enter action">

		  		<input type="number" name="salaryyear" value="<?php echo set_value('salaryyear',$YEAR); ?>" class="form-control" required placeholder="Enter salary year">
		 
							  		<input type="hidden" readonly name="myid" value="<?php echo set_value('myid',$member[0]['id']); ?>"id="myid" class="form-control" required placeholder="Enter itemid">

		<span class="text-danger"> <?php echo form_error('salaryyear'); ?>
		
		</span>
	</div>
  </div>	
	<div class="form-group">
    <label for="inputslarymonth" class="col-sm-2 control-label">	Month </label>
    <div class="col-sm-10">
	
     <select name='slarymonth' class="form-control" required>
    <option value=''>--Select Month for payment--</option>
    <option  value='Janaury'>Janaury</option>
    <option value='February'>February</option>
    <option value='March'>March</option>
    <option value='April'>April</option>
    <option value='May'>May</option>
    <option value='June'>June</option>
    <option value='July'>July</option>
    <option value='August'>August</option>
    <option value='September'>September</option>
    <option value='October'>October</option>
    <option value='November'>November</option>
    <option value='December'>December</option>
    </select> 		 
				
		<span class="text-danger"> <?php echo form_error('name'); ?>
		
		</span>
	</div>
  </div>

  
  


	<div class="form-group">
    <label for="inputnssf" class="col-sm-2 control-label">	NSSF </label>
    <div class="col-sm-10">
	
     <select name='nssf' class="form-control" required>
    <option value=''>--Select NSSF Rates to use--</option>
	    <option  value='Old'>Old rates</option>

    <option  value='Tire1'>New Rates(TIER I)</option>
        <option  value='Tire1Tire2' selected >New Rates(TIER I and II)</option>

	
    </select> 		 
				
		
	</div>
  </div>

  
	 

	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="paye" name="btn_mypaye" class="btn btn-primary"> Calculate Statutories  </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>	
	
					
					
					
					
					
					
					
					
<div id="editProductModel" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Add payment</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/assignpayrollsetup' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>

	<input type="hidden" name="mycategoryid" value=""id="mycategoryid" class="form-control" required placeholder="Enter mycategoryid">
	<input type="hidden" name="action" value="insert"id="action" class="form-control" required placeholder="Enter action">
<input type="hidden" name="view" value="user/mypayrollsetup?randomitemidentifier=<?php echo $member[0]['id']; ?>"id="view" class="form-control" required placeholder="Enter status">
			  		<input type="hidden" readonly name="myid" value="<?php echo set_value('myid',$member[0]['id']); ?>"id="myid" class="form-control" required placeholder="Enter itemid">

	
 <div class="form-group">
    <label for="inputcategory" class="col-sm-2 control-label"> Category?</label>
    <div class="col-sm-10">
	<select class="form-control" name="category"   id="category" required>
			<option value="" selected="selected" ></option>

		<option value="Pay"  >Pay</option>
		<option value="Deduction"  >Deduction</option>


		</select>
		

	</div>
  </div>
  	<div class="form-group">
    <label for="inputcode" class="col-sm-2 control-label">	Code </label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="code" id="code" value="<?php echo set_value('code'); ?>" class="form-control" required placeholder="Enter code">
		 
				
		<span class="text-danger"> <?php echo form_error('code'); ?>
		
		</span>
	</div>
  </div>
				  		
	<div class="form-group">
    <label for="inputname" class="col-sm-2 control-label">	Name </label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="name" id="name" value="<?php echo set_value('name'); ?>" class="form-control" required placeholder="Enter name">
		 
				
		<span class="text-danger"> <?php echo form_error('name'); ?>
		
		</span>
	</div>
  </div>

  
  <div class="form-group">
    <label for="inputamountmode" class="col-sm-2 control-label">Amount Mode?</label>
    <div class="col-sm-10">
	<select class="form-control" name="amountmode"  id="amountmode" required>
		<option value=""  selected="selected"></option>

		<option value="Fixed"  >Fixed Amount</option>
		<option value="Variable"  >Variable Amount</option>

		</select>
		

	</div>
  </div>
  <div class="form-group">
    <label for="inputamount" class="col-sm-2 control-label">	Amount </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="amount"  id="amount" value="" class="form-control" required placeholder="Enter amount">
		 
				
		<span class="text-danger"> <?php echo form_error('amount'); ?>
		
		</span>
	</div>
  </div>


  
  <div class="form-group">
    <label for="inputqtymode" class="col-sm-2 control-label">Qty Mode?</label>
    <div class="col-sm-10">
	<select class="form-control" name="qtymode" id="qtymode" required>
		<option value=""  selected="selected" ></option>

		<option value="Fixed"  >Fixed qty</option>
		<option value="Variable"  >Variable qty</option>

		</select>
		

	</div>
  </div>
  <div class="form-group">
    <label for="inputquantity" class="col-sm-2 control-label">	Quantity </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="quantity" value="" id="quantity" class="form-control" required placeholder="Enter quantity">
		 
				
		
		</span>
	</div>
  </div>

	

	<div class="form-group">

    <label for="inputunit" class="col-sm-2 control-label">	Unit </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="unit"  id="unit" value="<?php echo set_value('unit'); ?>" class="form-control"  placeholder="Enter unit if any">
		 
				
		<span class="text-danger"> <?php echo form_error('unit'); ?>
		
		</span>
	</div>
  </div>

	  <div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">Status</label>
    <div class="col-sm-10">
	<select class="form-control" name="status"   id="status" required>
		<option value=""  selected="selected" ></option>

		<option value="Active"  >Active</option>
		<option value="Inactive"  >Inactivet</option>

		</select>
		

	</div>
  </div>
  
  
  
  
  
  
  
	  <div class="form-group">
    <label for="inputstatutory " class="col-sm-2 control-label">Statutory? </label>
    <div class="col-sm-10">
	<select class="form-control" name="statutory" required >
		<option value=""  >Is this one of the main Statutory?</option>

		<option value="No"  selected="selected"  >This is Not A Statutory</option>
		<option value="NHIF"  >SHIF</option>
		<option value="NSSF"  >NSSF</option>
		<option value="PAYE"  >PAYE</option>
		<option value="HOUSE LEVY"  >HOUSE LEVY</option>

		</select>
		

	</div>
  </div>
  
  
  
  
  
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="salarycharges" name="btn_addsalarycharges" class="btn btn-primary"> SAVE  </button>

    </div>
  </div>
  				
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>
					
							
						<div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Delete</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to cancel this item? </h3>
      </div>
      <div class="modal-footer">
	  	

     
		<?PHP
				$session_data = $this->session->userdata('logged_in');
 echo $this->session->flashdata('deletemsg'); 

		
                 echo form_open('user/deletebyid' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
 <input type="hidden" id="table"name="table" class="table" placeholder="view" value="employeecharges">

 <input type="hidden" name="view" value="user/mypayrollsetup?randomitemidentifier=<?php echo $member[0]['id']; ?>"id="view" class="form-control" required placeholder="Enter status">

 <input type="hidden" id="itemid1"name="itemid" class="itemid" placeholder="itemid" value=""><br>
 <button type="button" class="btn btn-success" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_delete" value="deletebyid" class="btn btn-danger"> Delete  </button>

	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>
					
					
					<div id="updateProductModel" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Update payment</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/assignpayrollsetup' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
	<input type="hidden" name="mycategoryid" value=""id="mycategoryid1" class="form-control" required placeholder="Enter mycategoryid">
	<input type="hidden" name="action" value="update"id="action" class="form-control" required placeholder="Enter action">
<input type="hidden" name="view" value="user/mypayrollsetup?randomitemidentifier=<?php echo $member[0]['id']; ?>"id="view" class="form-control" required placeholder="Enter status">
			  		<input type="hidden" readonly name="myid" value="<?php echo set_value('myid',$member[0]['id']); ?>"id="myid" class="form-control" required placeholder="Enter itemid">

	
 <div class="form-group">
    <label for="inputcategory" class="col-sm-2 control-label"> Category?</label>
    <div class="col-sm-10">
	<select class="form-control" name="category"   id="category1" required>
			<option value="" selected="selected" ></option>

		<option value="Pay"  >Pay</option>
		<option value="Deduction"  >Deduction</option>


		</select>
		

	</div>
  </div>
  	<div class="form-group">
    <label for="inputcode" class="col-sm-2 control-label">	Code </label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="code" id="code1" value="<?php echo set_value('code'); ?>" class="form-control" required placeholder="Enter code">
		 
				
		<span class="text-danger"> <?php echo form_error('code'); ?>
		
		</span>
	</div>
  </div>
				  		
	<div class="form-group">
    <label for="inputname" class="col-sm-2 control-label">	Name </label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="name" id="name1" value="<?php echo set_value('name'); ?>" class="form-control" required placeholder="Enter name">
		 
				
		<span class="text-danger"> <?php echo form_error('name'); ?>
		
		</span>
	</div>
  </div>

  
  <div class="form-group">
    <label for="inputamountmode" class="col-sm-2 control-label">Amount Mode?</label>
    <div class="col-sm-10">
	<select class="form-control" name="amountmode"  id="amountmode1" required>
		<option value=""  selected="selected"></option>

		<option value="Fixed"  >Fixed Amount</option>
		<option value="Variable"  >Variable Amount</option>

		</select>
		

	</div>
  </div>
  <div class="form-group">
    <label for="inputamount" class="col-sm-2 control-label">	Amount </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="amount"  id="amount1" value="" class="form-control" required placeholder="Enter amount">
		 
				
		<span class="text-danger"> <?php echo form_error('amount'); ?>
		
		</span>
	</div>
  </div>


  
  <div class="form-group">
    <label for="inputqtymode" class="col-sm-2 control-label">Qty Mode?</label>
    <div class="col-sm-10">
	<select class="form-control" name="qtymode" id="qtymode1" required>
		<option value=""  selected="selected" ></option>

		<option value="Fixed"  >Fixed qty</option>
		<option value="Variable"  >Variable qty</option>

		</select>
		

	</div>
  </div>
  <div class="form-group">
    <label for="inputquantity" class="col-sm-2 control-label">	Quantity </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="quantity" value="" id="quantity1" class="form-control" required placeholder="Enter quantity">
		 
				
		
		</span>
	</div>
  </div>

	

	<div class="form-group">

    <label for="inputunit" class="col-sm-2 control-label">	Unit </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="unit"  id="unit1" value="<?php echo set_value('unit'); ?>" class="form-control"  placeholder="Enter unit if any">
		 
				
		<span class="text-danger"> <?php echo form_error('unit'); ?>
		
		</span>
	</div>
  </div>

  
	  <div class="form-group">
    <label for="inputstatutory " class="col-sm-2 control-label">Statutory </label>
    <div class="col-sm-10">
	<select class="form-control" name="statutory"   id="statutory" required>
		<option value=""  selected="selected" ></option>

		<option value="No"  >This is Not aStatutory</option>
		<option value="NHIF"  >SHA</option>
		<option value="NSSF"  >NSSF</option>
		<option value="PAYE"  >PAYE</option>
				<option value="HOUSE LEVY"  >HOUSE LEVY</option>


		</select>
		

	</div>
  </div>
	  <div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">Status</label>
    <div class="col-sm-10">
	<select class="form-control" name="status"   id="status1" required>
		<option value=""  selected="selected" ></option>

		<option value="Active"  >Active</option>
		<option value="Inactive"  >Inactivet</option>

		</select>
		

	</div>
  </div>
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="salarycharges" name="btn_addsalarycharges" class="btn btn-primary"> Update Data  </button>

    </div>
  </div>
  				
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>
					
					
					

  
<div id="addModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Process payment</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');

         $YEAR = date('Y');


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/processsinglepayment' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
		
		
		
		
		
		
		
		
 <div class="form-group">
    <label for="inputsupplier" class="col-sm-2 control-label">Branch</label>
    <div class="col-sm-10">
				
				
				<select class="form-control" name="branchid"  id="branchid" required>
	
	
	<option value=""  >---Select Branch/Counter to Open--</option>

									
								
<?php
	     $mybranch=$this->usermodel->populateall('branch','id',$branchid);


if(is_array($mybranch)) {

   foreach($mybranch as $branchrow){

   ?>
					<option selected="selected" value="<?=  $branchrow->id;   ?>"><?=  $branchrow->name; ?></option>




	<?php

}} else {
    echo 'No Branch available.';
}
	
?>
	
	
	
	
	
	
	<?php 
					 
					 		$maincategory = $this->usermodel->populateall('branch','companyid',$companyid);


							


if(is_array($maincategory)) {

   foreach($maincategory as $maincategoryrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $maincategoryrow->id;   ?>"><?=  $maincategoryrow->name; ?></option>



	<?php

}} else {
    echo 'No main counter available.';
}
	
?>
</select>
				
		</div>
  </div>
					
		
	
		
		
		
		
		
		
		
		
<div class="form-group">
    <label for="inputsalaryyear" class="col-sm-2 control-label">	Year </label>
    <div class="col-sm-10">
		<input type="hidden" name="view" value="user/salaryhistory"id="view" class="form-control" required placeholder="Enter status">

	<input type="hidden" name="view1" value="user/mypayrollsetup?randomitemidentifier=<?php echo $member[0]['id']; ?>"id="view" class="form-control" required placeholder="Enter status">
	<input type="hidden" name="action" value="insert"id="action" class="form-control" required placeholder="Enter action">

		  		<input type="number" name="salaryyear" value="<?php echo set_value('salaryyear',$YEAR); ?>" class="form-control" required placeholder="Enter salary year">
		 
							  		<input type="hidden" readonly name="myid" value="<?php echo set_value('myid',$member[0]['id']); ?>"id="myid" class="form-control" required placeholder="Enter itemid">

		<span class="text-danger"> <?php echo form_error('salaryyear'); ?>
		
		</span>
	</div>
  </div>	
	<div class="form-group">
    <label for="inputslarymonth" class="col-sm-2 control-label">	Month </label>
    <div class="col-sm-10">
	
     <select name='slarymonth' class="form-control" required>
    <option value=''>--Select Month for payment--</option>
    <option  value='Janaury'>Janaury</option>
    <option value='February'>February</option>
    <option value='March'>March</option>
    <option value='April'>April</option>
    <option value='May'>May</option>
    <option value='June'>June</option>
    <option value='July'>July</option>
    <option value='August'>August</option>
    <option value='September'>September</option>
    <option value='October'>October</option>
    <option value='November'>November</option>
    <option value='December'>December</option>
    </select> 		 
				
		<span class="text-danger"> <?php echo form_error('name'); ?>
		
		</span>
	</div>
  </div>

  
  
    <div class="form-group">
    <label for="inputpayment" class="col-sm-2 control-label">	Payment</label>
    <div class="col-sm-10">
	<select class="form-control" name="payment" required>

		<option  readonly value="<?php echo $member[0]['paymentmode']; ?>"  selected="selected"><?php echo $member[0]['paymentmode']; ?></option>



	</select>
						<span class="text-danger"><?php echo form_error('paymentmode'); ?></span>

	</div>
  </div>


	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="payment" name="btn_processpayment" class="btn btn-primary"> Process Payment  </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>


					
					



					
									
									
							</div>		
									
							</div>
						</div>
				

			
			</div>
		</div>
  
  </div>
			
			
			
		
		
  

 
</div>


















