


         <script type="text/javascript">
  
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });
			</script>
			 
			<style>
			#mainbody{
	
	text-align: left;
		font-size: 12px;
		border-top: 1px solid #D0D0D0;
		
		
		 background-mage: #f4f4f4 url(../images/img/memberertificate.jpg);
		padding:5px;
		margin: 5px ;
		border-radius:10px 10px;

		border: 1px solid #D0D0D0;
		color: black;
		
	
	
	}

</style>			
				
				<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>
				All supervisors
				
 <span class="pull-right">  <a  id="more" class="btn btn-primary" href="<?php echo base_url();?>user/viewleaves">Go back  </a>

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

			
										
					<div class="row">
						<div class="col-md-12">
							
							<div class="panel-body">
					
	
				<?PHP
				$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'];	
	  echo $this->session->flashdata('deletemsg'); 

$mydate=date("d-m-Y");
$myear=date("Y");
$transactioncode = rand(1000, 99000).time();
$imgid = rand(100, 990000).time();
				echo $this->session->flashdata('msg'); 
				
	
		
?>
					

  
				
									
									
									
									
									
									
									
									<table id="example"  cellspacing="1" class="border  table" width="100%">
             <thead>
         <tr>
		 
		  <th> Name</th>
		 		   <th>Position Name</th>
<th>Department Name</th>
		   <th>Start date</th>
		  <th>End Date</th>
 	
<th>Description</th> 

<th>Status</th> 

<th>More</th> 


                 </tr>
             </thead>
<?php
 if(!is_array($supervisor)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='6'>";
    
       echo '<div class="alert alert-warning text-center">No data available</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  
  	foreach ($supervisor as $c): 

		 

             ?>



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


?>
	   <td><?php 
	
								 
 
					// $branch="";
					 $myincharge=$c->employeeno;

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



if(is_array($myenployee)) {

   foreach($myenployee as $myenployeerow){

   echo $myenployeerow->lastname." ".$myenployeerow->firstname."(".$myenployeerow->number.")"; 
 
 
}} else {
    echo 'No Employee';
}
	
?>
	
	
</td>
<td><?php 
	
								 
 
					// $branch="";
					 $mytitle=$c->title;

					 $post= $this->usermodel->populateall('post','id',$mytitle);



if(is_array($post)) {

   foreach($post as $postrow){

   echo $postrow->name;
 
 
}} else {
    echo 'No post';
}
	
?>
	
	
</td>
 
<td><?php 
	
								 
 
					// $branch="";
					 $mytype=$c->department;

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



if(is_array($leavetype)) {

   foreach($leavetype as $leavetyperow){

   echo $leavetyperow->name;
 
 
}} else {
    echo 'No type';
}
	
?>
	
	
</td>
              
  <td><?php echo $c->startdate; ?></td> 	
 <td><?php echo $c->enddate; ?></td> 	
 
		   

				   
 <td><?php echo $c->description; ?></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>
									<?php
										if($usertype=="admin"){
											
											?>
                                    <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>
																Delete
                                                </a>
                                                        </li>
									
								
                                        
                                    </ul>
											<?php
										}
										?>
                                </div>
</td>
		 
		 
					 
   

             </tr>

             <?php endforeach; ?>

              <?php }?>

        </table>

									
									
									
									
									
									
									
									
									
									
									
									
									
									
									
									
									
									
									
									
								
							</div>
						</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 delete this item? </h3>
      </div>
      <div class="modal-footer">
	  	

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

		
                 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="supervisor">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/supervisor">
 <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>
















