
 
         <script type="text/javascript">
  
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });
			</script>
  <div class="container-fluid">
 <div class="row">

  <div class="col-xs-12 col-sm-6 col-lg-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>
				Please Add New Leave type
				
  <a data-toggle='modal' data-target='#addModal' class="btn btn-info">Add Leave types</a>

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

				<?PHP
 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'];	
	  echo $this->session->flashdata('deletemsg'); 
		?>
		
										
					<div class="row">
							
					<div class="col-md-2">
				<div id="sidebar" class="hidden-print minibar ">
			
					 <a href="<?php echo base_url();?>user/viewleaves" class="btn btn-info">  Go back</a>	

		</div>
					
					</div>
					
					
					
					
					
					
					
					
					
						<div class="col-md-10">
							
							<div class="panel-body">
							
					
	
	
	
	
	
	
	
	
	
	
	
					<div id="myModal2" 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="leavetypes">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/leavetypes">
 <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="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">Add new Leave type</h4>
      </div>
      <div class="modal-body">
      
	  	
				<?PHP
 echo $this->session->flashdata('msg'); 
		?>
		
		
			<?PHP
				$session_data = $this->session->userdata('adminlogged_in');


		
                 echo form_open('user/addLeave' , 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="inputname" class="col-sm-2 control-label">	Leave Name</label>
    <div class="col-sm-10">

		  		<input type="text" name="name" value="<?php echo set_value('name'); ?>"id="name" class="form-control"  placeholder="Enter Leave Type">
		 
				
		<span class="text-danger"> 	Enter Leave type  here..<?php echo form_error('name'); ?>
		
		</span>
	</div>
  </div>	

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

		
			<select  class="form-control" name="gender" required>
								<option value="">---Select Leave Gender---</option>

				<option value="Both">Both male and Female</option>
				<option value="Male"> Male Only</option>
						
				<option value="Female"> Female Only</option>
	
						
				</select>		
		  		
				
		<span class="text-danger"> 	<?php echo form_error('gender'); ?>
		
		</span>
	</div>
  </div>
  
	<div class="form-group">
    <label for="inputdeduct" class="col-sm-2 control-label"> Deduction </label>
    <div class="col-sm-10">
		

		
			<select  class="form-control" name="deduct" required>
								<option value="">---Do you want to deduct non working days---</option>

				<option value="Yes">Yes</option>
				<option value="No">No</option>
						
	
						
				</select>		
		  		
				
		<span class="text-danger"> 	<?php echo form_error('deduct'); ?>
		
		</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"></textarea>		
		<span class="text-danger"> Enter description if any<?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_Leavetype" class="btn btn-primary" value="Leave">
                                <span class="glyphicon glyphicon-log-in"></span> Add Leave Type                           
								 </button>
								 

    </div>
  </div>

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

    

				</div>

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

					
			

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

   

    <th>Leave Name</th>    
    <th>Gender type</th>   
	   <th>Deduction</th> 
    <th>Leave Description</th>    

    <th>Date</th>   
    <th>More</th>    
	
</thead>
  </tr>

<?php 

if(is_array($Leave)) {

   foreach($Leave as $c){
	   ?>

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

				   
 <td><?php echo $c->gender; ?></td> 				   
			   
 <td><?php echo $c->deduct; ?></td> 	
 				   
 <td><?php echo $c->description; ?></td> 				   
			   
 <td><?php echo $c->createdate; ?></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='#myModal2<?php  $c->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Delete
                                                </a>
                                                        </li>
									
								-->
                                        
                                    </ul>
											<?php
										}
										?>
                                </div>
</td>
		 
		 
			</tr>
 <?php

}} else {
    echo 'There is no any Leave data available.... try again.';
}






?>

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

</div>








  
  </div>
 
</div>




















































