

 <div class="row">
  
   	<div class="col-md-12">
		<div class="panel panel-default" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>
				Update Leave Status
				
								                   <span class="pull-right">  <a  id="more" class="btn btn-primary" href="<?php echo base_url();?>user/viewleaves">Go back to leaves  </a>

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

			
										
					<div class="row">
						<div class="col-md-12">
							
							<div class="panel-body">
					
	<?php


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

   
 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
$data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];




				

$imgid = rand(100, 990000).time();
				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/postleaves' , 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="inputstatus" class="col-sm-2 control-label">	Leave Status</label>
    <div class="col-sm-10">
	<select class="form-control" name="status" required>
	
	<option value=""  >---Select Leave Status---</option>

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

	


if(is_array($leavetypes)) {

   foreach($leavetypes as $leavetypesrow){

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



	<?php

}} else {
    echo 'No Leave Status available.';
}
	
   


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

	</div>
  </div>
  
  
  		
	    
  
  
  
  
  
  
   
    	<input type="hidden" name="itemid" value="<?php echo set_value('itemid',$itemid); ?>"id="itemid" class="form-control" required placeholder="Enter mytype ">

     

    
  <div class="form-group">
    <label for="inputcomments" class="col-sm-2 control-label">Comments</label>
    <div class="col-sm-10">

	<textarea name="comments" class="form-control" placeholder="Enter Comments/Reason"></textarea> 
			<span class="text-danger"> <?php echo form_error('comments'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
  
  
  			<div class="form-group">
    <label for="inputapproval" class="col-sm-2 control-label">Forward to?</label>
    <div class="col-sm-10">
	<select class="form-control" name="approval" required>
		<option value="no"  >NO</option>

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

	
	<?php 
				 if(isset($myuserid)) {  echo $myuserid;


					 $myenployee= $this->usermodel->populateall('people','id',$myuserid);



if(is_array($myenployee)) {

   foreach($myenployee as $myenployeerow){

    
  ?>
  			 								<option selected="selected" value="<?php echo $incharge;   ?>"><?php echo $myenployeerow->lastname." ".$myenployeerow->firstname."(".$myenployeerow->number.")";  ?></option>

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


			
			 

			  } 	 
	
						$myemployee = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'category','user');


if(is_array($myemployee)) {

   foreach($myemployee as $myemployee){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $myemployee->id;   ?>"><?= $myemployee->firstname ." ".$myemployee->surname; ?></option>



	<?php

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

	</div>
  </div>
  
  
  
  
  
  
  
  
  
  

	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  name="btn_postrejectleaves"  value="leaves"  class="btn btn-primary"> Update Leave Status  </button>

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

								
			
			
			
			
			
			
		
		</div>
  
  </div>

</div>
















