
         <script type="text/javascript">
  
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });
		$(document).on("click", "#editbtn", function()
        {
          var mycategoryid = $(this).data('id');
		  $("#mycategoryid").val(mycategoryid); 
		   		 
   var currency = $(this).data('currency');

				 $("#currency").val(currency); 

		   		   
   var maincategory = $(this).data('maincategory');
		   $("#maincategory").val(maincategory);
 
		    var name = $(this).data('name');
		   $("#name").val(name); 
		   
		     var description = $(this).data('description');
		   $("#description").val(description); 
		  var status = $(this).data('status');
		   $("#status").val(status);
		  
		     
		     var invoice = $(this).data('invoice');
		   $("#invoice").val(invoice); 
		   
        });
		
		
		
		
    </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>
				Assign this member to be a supervisor
				
								                   <span class="pull-right">  <a  id="more" class="btn btn-primary" href="<?php echo base_url();?>user/viewmember">Back  </a>

</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'];

$id=$data['id'];
$mydate=date("Y-m-d");
$myear=date("Y");
$transactioncode = rand(1000, 99000).time();
$imgid = rand(100, 990000).time();
				echo $this->session->flashdata('msg'); 
				
	
		
                 echo form_open('user/postsupervisor' , 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="inputtitle" class="col-sm-2 control-label">	Position Name</label>
    <div class="col-sm-10">
	<select class="form-control" name="title" required>
	
	<option value=""  >---Select Post Name---</option>

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

	


if(is_array($post)) {

   foreach($post as $postrow){

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



	<?php

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


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

	</div>
  </div>
  		<div class="form-group">
    <label for="inputdepartment" class="col-sm-2 control-label">	Department Name</label>
    <div class="col-sm-10">
	<select class="form-control" name="department" required>
	
	<option value=""  >---Select Department Name---</option>

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

	


if(is_array($leavetypes)) {

   foreach($leavetypes as $leavetypesrow){

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



	<?php

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


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

	</div>
  </div>
  
	

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

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

  
 
  
  

  

  
  <div class="form-group">
    <label for="inputstartdate" class="col-sm-2 control-label">	Start Date ?</label>
    <div class="col-sm-10">

	<input type="date" name="startdate" value="<?php echo set_value('startdate',$mydate); ?>"id="startdate" class="form-control" required placeholder="Enter specific date of payment(dd-mm-YYY) ">
			<span class="text-danger"> <?php echo form_error('startdate'); ?>
		
		</span>
	</div>
  </div>
  
  
    <div class="form-group">
    <label for="inputenddate" class="col-sm-2 control-label">	 To Date?</label>
    <div class="col-sm-10">

	<input type="date" name="enddate" value="<?php echo set_value('enddate',$mydate); ?>"id="enddate" class="form-control"  placeholder="Enter due date if possible ">
			<span class="text-danger"> <?php echo form_error('enddate'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
       

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

	<textarea name="description" class="form-control" placeholder="You can describe supervisor here"><?php echo set_value('description'); ?></textarea> 
			<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
  
  
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  name="btn_supervisor"  value="supervisor"  class="btn btn-primary"> Create Supervisor </button>

    </div>
  </div>
			</div>							   
									<?php echo form_close();?>
									
									
									
									
									
									
									
									
									<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($assignedleave)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='7'>";
    
       echo '<div class="alert alert-warning text-center">No data available</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  
  	foreach ($assignedleave 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>
						 
										 <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>
                                                     </td> 
					 
   

             </tr>

             <?php endforeach; ?>

              <?php }?>

        </table>

									
									
									
									
									
									
									
									
									
									
									
									
									
									
									
									
									
									
									
									
								
							</div>
						</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('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="supervisor">

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












