

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

                           $(function () {
        $("#method").change(function () {
			var studentstatus = $("#method").val();
            if ($(this).val() == "1") {
                $("#day").hide();
				 $("#fromdate").hide();
					$("#todate").hide();
				
            } 
            else  if ($(this).val() == "2") {
                $("#day").show();
				$("#fromdate").show();
					$("#todate").show();
					$("#offday").hide();
	  					$("#btn_assigmultiplenoffdays").show();
	  					$("#btn_assignoffdays").hide();

            }
        });
    });
			 
  $("#day").hide();
    $("#fromdate").hide();
	  $("#todate").hide();
	  					$("#btn_assigmultiplenoffdays").hide();

			 }); 
          
        </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>
				Update off days regarding this group
				
								                   <span class="pull-right">  <a  id="more" class="btn btn-primary" href="<?php echo base_url();?>user/leavetypes">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'); 
$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/postgroupoffdays' , 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="inputmethod" class="col-sm-2 control-label">Assigning Method</label>
    <div class="col-sm-10">
	<select class="form-control" name="method"  id="method" required>
	
	<option value=""  >---Do you want to asign off days one by one?--</option>

            <option value="1" selected>Yes</option>
            <option value="2">No-I want do mutiple signing</option>
				
				</select>
		
						<span class="text-danger"><?php echo form_error('method'); ?>

	</div>
  </div>
  
  		<div class="form-group">
    <label for="inputtype" class="col-sm-2 control-label">	Off Type</label>
    <div class="col-sm-10">
	<select class="form-control" name="type" required>
	
	<option value="" selected >---Select  Off day Type---</option>

            <option value="1" >All day is off</option>
			  <option value="2">Half day is off</option>
            <option value="3">Morning is off</option>
            <option value="4">Afternoon is off</option>
				
				</select>
		
						<span class="text-danger"><?php echo form_error('type'); ?>

	</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" id="day" >
    <label for="inputday" class="col-sm-2 control-label">Day of the week</label>
    <div class="col-sm-10">
	<select class="form-control" name="day" >
	
	<option value="" selected >---Select multiple  off/holiday to assign--</option>

            <option value="1" >Monday</option>
			<option value="2" >Teusday</option>
			<option value="3" >Wednesday</option>
			<option value="4" >Thursday</option>
			  <option value="5" >Friday</option>
			<option value="6" >Saturday </option>
			<option value="7" >Sunday</option>
				</select>
		
						<span class="text-danger"><?php echo form_error('day'); ?>

	</div>
  </div>
  

  
  <div class="form-group" id="offday">
    <label for="inputoffday" class="col-sm-2 control-label">	Off Date ?</label>
    <div class="col-sm-10">

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

	<input type="date" name="fromdate" value="<?php echo set_value('fromdate'); ?>"id="fromdate" class="form-control"  placeholder="Enter specific start (YYY-mm-dd) ">
			<span class="text-danger"> <?php echo form_error('fromdate'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
  
   
  <div class="form-group" id="todate">
    <label for="inputtodate" class="col-sm-2 control-label">	To Date ?</label>
    <div class="col-sm-10">

	<input type="date" name="todate" value="<?php echo set_value('todate'); ?>"id="todate" class="form-control"  placeholder="Enter specific end date (YYY-mm-dd) ">
			<span class="text-danger"> <?php echo form_error('todate'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
  
  
  
  
  
       
  
   <div class="form-group">
    <label for="inputtitle" class="col-sm-2 control-label">Title</label>
    <div class="col-sm-10">

	<input type="text" name="title" value="Weekend"id="year" class="form-control" required placeholder="Enter title of the off day  ">
			<span class="text-danger"> <?php echo form_error('title'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  

  
  
  
  
  
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit" id="btn_assignoffdays" name="btn_assignoffdays"  value="offdays"  class="btn btn-primary"> Assign Off Day </button>
 <button type="submit" id="btn_assigmultiplenoffdays" name="btn_assigmultiplenoffdays"  value="offdays"  class="btn btn-primary"> Assign Mulitple Off Days </button>
    </div>
  </div>
			</div>							   
									<?php echo form_close();?>
									
									
									
									
									
									
									
									
  <table cellpadding="0" cellspacing="0" border="0" class="table  table-striped" id="example" style="border-color:#CCCCCC; width:100%;"  >
             <thead>
         <tr>
		 		   <th>Leave type</th>

		   <th>Date</th>
		  <th>Title</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 no data posted..</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('offtypes','id',$mytype);



if(is_array($leavetype)) {

   foreach($leavetype as $leavetyperow){

   echo $leavetyperow->name;
 
 
}} else {
    echo 'No type';
}
	
?>
	
	
</td>
              
  <td><?php echo $c->offday; ?></td> 	
 <td><?php echo $c->title; ?></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>
																Cancel
                                                </a>
                                                        </li>
									
									
                                       
                                    </ul>
											<?php
										}
										?>
                                </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="offdays">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/groupoffdays?randomitemidentifier=<?php echo $itemid;?>&type=group">
 <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>












