
			<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>			
		

				   	
 <script type="text/javascript">
        
        
		
		
				 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });
          
        </script>		
				<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 leaves to this group
				
								                   <span class="pull-right">  <a  id="more" class="btn btn-primary" href="<?php echo base_url();?>user/viewleaves">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'];
        
		 $userid = $data['id'];

 $data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
	  echo $this->session->flashdata('deletemsg'); 

$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 $fromdates;
	
	
		
		
		
                 echo form_open('user/postgroupleaveandcalculation' , 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="inputtype" class="col-sm-2 control-label">	Leave Type</label>
    <div class="col-sm-10">
	<select class="form-control" name="type" required>
	
	<option value=""  >---Select Leave Type---</option>

	
	<?php 
					 
			$leavetypes = $this->usermodel->populateall('leavetypes','description','all');

	


if(is_array($leavetypes)) {

   foreach($leavetypes as $leavetypesrow){

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



	<?php

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


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

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

    	<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="inputstartdate" class="col-sm-2 control-label">	Start Date ?</label>
    <div class="col-sm-10">

	<input type="text" name="startdate" readonly value="<?php echo set_value('startdate',$fromdates); ?>"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="text" readonly 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="inputdays" class="col-sm-2 control-label"> No of Day</label>
    <div class="col-sm-10">
	<input type="text" name="days" readonly value="<?php    if(isset($days)) {  echo $days; }else{ echo 0;}  ?>"id="duration" class="form-control"  placeholder="Leave days ">

			<span class="text-danger"> <?php echo form_error('days'); ?>
		
		</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 the group leaves"><?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_confirmleaves"  value="confirms"  class="btn btn-info"> Confirm Leave Days First </button>

	         <button type="submit"  name="btn_assignleaveCalculate"  value="assignleave"  class="btn btn-primary"> Assign Leave </button>

    </div>
  </div>
			</div>							   
									<?php echo form_close();?>
									
									
									
									
									
									
									
									
									<table id="example"  cellspacing="1" class="border  table" width="100%">
             <thead>
         <tr>
		 		   <th>Leave type</th>

		   <th>Start date</th>
		  <th>End Date</th>
     <th>Days</th>  	
 	
<th>Description</th> 


 		  <th>More</th>



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

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='6'>";
    
       echo '<div class="alert alert-warning text-center">You have not posted  any payment please feel free to do so..</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  
  	foreach ($assignedleave as $c): 

		 

             ?>



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


?>
<td><?php 
	
								 
 
					// $branch="";
					 $mytype=$c->type;

					 $leavetype= $this->usermodel->populateall('leavetypes','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->days; ?></td> 				   
 
		   

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

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/groupleavedaysandcalculations?randomitemidentifier=<?php echo $itemid;?>&type=single&days=0">
 <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"> Cancel Now  </button>

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

  </div>

  </div>



















