<?php $is_owner = $this->db->get_where('admin' , array('admin_id' => $this->session->userdata('login_user_id')))->row()->owner_status;
?>
<script type="text/javascript">

$(document).ready(function() {

 $('#reasondec').hide();
	$('#employer').change(function() {
 
	 var $index = $('#employer').index(this);
 
	 if($('#employer').val() == 'Declined') { //if this value is NOT selected
	 $('#reasondec').show(); //this field is hidden


	 } 
	 
 else {
	 $('#reasondec').hide();//else it is shown

	 
	 }
        });
 });
 
</script>

<?php $allowed = $this->db->get_where('academic_settings' , array('type' =>'allowed_marks'))->row()->description; ?>
<?php $running_year = $this->db->get_where('settings' , array('type' => 'running_year'))->row()->description; ?>
<?php $company_id=1;?>
  <?php 
	$invoice_info = $this->db->get_where('jobcards', array('jid' =>$jobcard_id))->result_array();
	foreach($invoice_info as $rowjob):
	   
?>
<?php $client_id=$rowjob['client_id'];
    $jid=$rowjob['jid'];
    ?>
<div class="content-w">
    <div class="os-tabs-w menu-shad">
        <div class="os-tabs-controls">
          <ul class="nav nav-tabs upper">
                      <?php if($status == 1):?>
                     <li class="nav-item">
              <a class="nav-link" href="<?php echo base_url();?>admin/teachers/"><i class="os-icon picons-thin-icon-thin-0007_book_reading_read_bookmark"></i><span><?php echo get_phrase('Customers');?></span></a>
            </li>
            
                    <li class="nav-item">
              <a class="nav-link" href="<?php echo base_url();?>admin/projects/"><i class="os-icon picons-thin-icon-thin-0007_book_reading_read_bookmark"></i><span><?php echo get_phrase('Projects');?></span></a>
            </li>
            <li class="nav-item">
              <a class="nav-link active" href="<?php echo base_url();?>admin/upload_marks/"><i class="os-icon picons-thin-icon-thin-0007_book_reading_read_bookmark"></i><span><?php echo get_phrase('Create Job Card');?></span></a>
            </li>
            <?php endif;?>
            <li class="nav-item">
              <a class="nav-link" href="<?php echo base_url();?>admin/view_jobsheets/"><i class="os-icon picons-thin-icon-thin-0197_layout_grid_view"></i><span><?php echo get_phrase('Job sheets');?></span></a>
            </li>
          </ul>
        </div>
      </div>
          <div class="element-wrapper">
          <?php echo form_open(base_url() . 'admin/update_jobsheet', array('class' => 'form m-b'));?>
             <div class="element-box lined-primary shadow">
          
              <div class="table-responsive">
             <div id="table">
       
  <table id="timeTable"    style=" background-repeat:no-repeat; width:450px;margin:0;" cellpadding="0" cellspacing="0" border="0">
    <tr>
  <div class="content-i">
    <div class="content-box">
      <th>Client</th>
      <th>Engineer</th>
      <th>Date</th>
      <th>Time In</th>
      <th>Time Out</th>
      <th>Total Hours</th>
      <th>Chargeable hours</th>
    </tr>
    <tr>
      

    
  
            <td  style="width:30%">
     	<select name="client_id"  >
                    		
							<?php $exams = $this->db->get_where('client' , array('company_id' =>$company_id))->result_array();
							foreach($exams as $row):
							    if($row['client_id']==$rowjob['client_id'])
							    {
							?>		
								<option value="<?php echo $row['client_id'];?>" selected><?php echo $row['client_name'];?></option>
			
							<?php	}?>
							
												<option value="<?php echo $row['client_id'];?>" ><?php echo $row['client_name'];?></option>
							<?php endforeach;?>
						</select>
      </td>
          <td  style="width:20%">
     <select name="job_user" >
						<option value="<?php echo $this->db->get_where($this->session->userdata('login_type'), array($this->session->userdata('login_type') . '_id' => $this->session->userdata('login_user_id')))->row()->admin_id;?>" >   <?php echo $this->db->get_where($this->session->userdata('login_type'), array($this->session->userdata('login_type') . '_id' => $this->session->userdata('login_user_id')))->row()->name;?></option>
		<?php $c_id=0;	$userss = $this->db->get_where('admin' , array('client_id' =>$c_id))->result_array();
							foreach($userss as $row):
							
							?>
									<option value="<?php echo $row['admin_id'];?>" ><?php echo $row['name'];?></option>
							    <?php endforeach;?>
					</select>
      </td>
       <input type="hidden" name="job_card_id"  value="<?php echo $jobcard_id;
	?>" size="12" />
      <td style="width:20%">
        <input type="date" name="job_date"  value="<?php echo $rowjob['job_date'];
	?>" size="12" />
      </td>
      <td style="width:10%">
        <input type="time"class="Time1" name="job_time_in" value="<?php echo $rowjob['job_time_in'];
	?>" placeholder="Enter your start time" readonly/>
      </td>
      <td style="width:10%">
        <input type="time"class="Time2" name="job_time_out" value="<?php echo $rowjob['job_time_out'];
	?>" placeholder="Enter your end time" readonly/>
      </td>
      <td style="width:5%">
        <input type="text" class="Hours" name="Hours" value="<?php echo $rowjob['total_hours'];
	?>" readonly=""  size="16" readonly/>
      </td>
      <td style="width:5%">
        <input type="text" class="Hourschargeable" name="Chargeable_hours" value="<?php echo $rowjob['Chargeable_hours']?>" readonly size="16"/>
      </td>
    </tr>
  </table>
</div>
      </div>
         
                     <div class="table-responsive">
          
       
  <table  style=" background-repeat:no-repeat; width:450px;margin:0;" cellpadding="0" cellspacing="0" border="0">
    <tr>
       
      <th>Contract </th>
     <br>
      <th>Car Used</th>
         <th>Project</th>
        <th>Remote Access</th>
        <th>Overtime</th>
         <th>Hrs</th>
        <th>Travel Charge(Kms) </th>
    </tr>
    <tr>
      

    
  
            <td class="tg-yw4l">
     	<select name="contract_type" >
                    		<option value="Yes"><?php echo "Yes";?></option>
                    		<option value="No"><?php echo "No";?></option>
					
						</select>
      </td>
             <td  style="width:30%">
     	<select name="car_used"  >
                    		<option value=""><?php echo get_phrase('select');?></option>
							<?php $cars = $this->db->get_where('vehicle')->result_array();
							foreach($cars as $row):
							?>		
								<option value="<?php echo $row['vehicle_reg_no'];?>" <?php if($exam_id == $row['vehicle_reg_no']) echo 'selected';?>><?php echo $row['vehicle_reg_no'];?></option>
							<?php endforeach;?>
						</select>
      </td>
      
      <td style="height:2px; width:2px; color:blue; margin:0;">
       	<select name="project"  >
                    		<option value="None"><?php echo get_phrase('None');?></option>
							<?php $carss = $this->db->get_where('projects')->result_array();
							foreach($carss as $row):
							?>		
								<option value="<?php echo $row['project_title'];?>" ><?php echo $row['project_title'];?></option>
							<?php endforeach;?>
						</select>
      </td>
      <td>
                 	<select name="remote_access">
                   	<option value="No"><?php echo $row['remote_access'];?>;</option> 	
				<option value="No"><?php echo get_phrase('No');?></option>
				<option value="Yes"><?php echo get_phrase('Yes');?></option>
						</select>
     
      </td>
   <td>
         	<select name="overtime">
         	    <option value="None"><?php echo "None";?></option>
                    		<option value="afterhours"><?php echo get_phrase('afterhours');?></option>
				<option value="saturday"><?php echo get_phrase('saturday');?></option>
				<option value="sunday"><?php echo get_phrase('sunday');?></option>
			<option value="public holyday"><?php echo get_phrase('public holyday');?></option>
						</select>
    
      </td>

      <td class="tg-yw4l">
        <input type="text" name="drs" value="<?php echo $rowjob['drs'];
	?>" size="6"  />
      </td>
     
 	
 	    <td class="tg-yw4l">
        <input type="text" name="travel_charge" value="0"  size="12" />
      </td>
    
 
    </tr>
  </table>

      </div>
      
           
             
         </div>      
             
            <?php // echo form_close();?>
            <div class="element-box lined-primary shadow">
              <left><h5 class="form-header"><?php echo get_phrase('STANDARD ROUTINE CHECK LIST PROCEDURE');?> <strong><?php ?></strong></h5></left>

              <br>
              <?php //echo form_open(base_url() . 'admin/marks_update/'.$exam_id.'/'.$class_id.'/'.$section_id.'/'.$subject_id);?>
              <div class="table-responsive">
                  
                <table   style=" background-repeat:no-repeat; width:450px;margin:0;" cellpadding="0" cellspacing="0" border="1">
                  <thead>
                      <tr>
                   
           <th width="50%"> Server Tasks</th>
        <th></th>
        <th></th>
        <th>Details</th>
   
        <th>Initials</th>
                      </tr>
                  </thead>
                  <tbody>
                 <?php
                    $count = 1;
                  $marks_of_students = $this->db->get('jobcard_tasks')->result_array();
                      foreach($marks_of_students as $row):
                          
                     
                                         $taskid= $row['Tasks_id']; 
                
  $description = $this->db->get_where('jobcard_tasks_details' , array('Tasks_id' => $taskid,'jid' =>$jid))->row()->Description_one;
   $task_detail_id = $this->db->get_where('jobcard_tasks_details' , array('Tasks_id' => $taskid,'jid' =>$jid))->row()->task_detail_id;
  
  
      	   $userid= $rowjob['job_user'];
$uname= $this->db->get_where('admin' , array('admin_id' => $userid))->row()->name;          
                
                    ?>
                            <input type="hidden" name="task_detail_id[]" value="<?php echo $task_detail_id; ?>">
                
                   <?php  if($taskid=="1"){ ?>
                    <tr>                    
                
                         <input type="hidden" name="backup_date[]">
                           <input type="hidden" name="backup_restore_date[]">
                                             <td>
                                <input type="hidden" name="tasks_id[]"  value="<?php echo $row['Tasks_id'];?>"  value="<?php echo $row['Taskname'];?>">  
                  <input type="hidden" placeholder="Server Drive:" name="server_drive_one[]" value="<?php echo $this->db->get_where('jobcard_tasks_details' , array('Tasks_id' => $taskid,'jid' =>$jid))->row()->server_drive_one; ?>"size="12">
                <input type="hidden" placeholder="Server Drive:" name="server_drive_two[]" value="<?php echo $this->db->get_where('jobcard_tasks_details' , array('Tasks_id' => $taskid,'jid' =>$jid))->row()->server_drive_two; ?>"size="12">
                 <input type="hidden" placeholder="Server Drive:" name="server_drive_three[]" value="<?php echo $this->db->get_where('jobcard_tasks_details' , array('Tasks_id' => $taskid,'jid' =>$jid))->row()->server_drive_three; ?>" size="12">
                <input type="hidden" name="ups_date[]">
<input type="hidden" name="virus_def_date[]">
                            <textarea id="w3review" name="details_desc" rows="2" cols="30" readonly> <?php echo $row['Taskname'];?>
                      </textarea>
                      </td>
                       <td>

                      </td>
                         <td>
  
                      </td>
                         <td>
                                <textarea id="w3review" name="Description_one[]" rows="2" cols="30">
<?php echo $description;?>
</textarea>
                      </td>
              
                      <td>
                        <input type="text" name="lab_nueve_<?php echo $row['Tasks_id'];?>" placeholder="0"  value="<?php echo $uname?>"">
                      </td>
                 
                    </tr>
                    <?php }?>
                  <?php if($taskid=="2"){
                    ?>
      
                
                      <tr>
                      
                           <td>
                            <input type="hidden" name="backup_date[]">
                           <input type="hidden" name="backup_restore_date[]">
                                <input type="hidden" name="tasks_id[]"  value="<?php echo $row['Tasks_id'];?>"  value="<?php echo $row['Taskname'];?>">  
                <input type="hidden" name="ups_date[]">
<input type="hidden" name="virus_def_date[]">
                            <textarea id="w3review" name="details_desc" rows="1" cols="30" readonly> <?php echo $row['Taskname'];?>
                      </textarea>
                      </td>
                       <td>
<input type="text" placeholder="Server Drive:" name="server_drive_one[]" size="12" value="<?php echo $this->db->get_where('jobcard_tasks_details' , array('Tasks_id' => $taskid,'jid' =>$jid))->row()->server_drive_one; ?>">
                      </td>
                         <td>
  
                      </td>
                         <td>
                                <textarea id="w3review" name="Description_one[]" rows="2" cols="30">
<?php echo $description;?>
</textarea>
                      </td>
              
                      <td>
                        <input type="text" name="lab_nueve_<?php echo $row['Tasks_id'];?>" placeholder="0"  value="<?php echo $this->db->get_where($this->session->userdata('login_type'), array($this->session->userdata('login_type') . '_id' => $this->session->userdata('login_user_id')))->row()->name;?>"">
                      </td>
                 </tr>
                      <tr>
                           <td>
                               
                  
                      </td>
                       <td>
<input type="text" placeholder="Server Drive:" name="server_drive_two[]" value="<?php echo $this->db->get_where('jobcard_tasks_details' , array('Tasks_id' => $taskid,'jid' =>$jid))->row()->server_drive_two; ?>" size="12">
                      </td>
                         <td>
  
                      </td>
                         <td>
         <textarea id="w3review" name="Description_one[]" rows="2" cols="30">
<?php echo $description;?>
</textarea>
                      </td>
              
                      <td>

                      </td>
                 </tr>
                   <tr>
                           <td>
                               
                  
                      </td>
                       <td>
<input type="text" placeholder="Server Drive:" name="server_drive_three[]" value="<?php echo $this->db->get_where('jobcard_tasks_details' , array('Tasks_id' => $taskid,'jid' =>$jid))->row()->server_drive_three; ?>" size="12">
                      </td>
                         <td>
  
                      </td>
                         <td>
         <textarea id="w3review" name="Description_one[]" rows="2" cols="30">
<?php echo $description;?>
</textarea>
                      </td>
              
                      <td>

                      </td>
                 </tr>
                    <?php }?>
                    <?php if($taskid=="3"){
                        
                    ?>
                  <tr>
                     <input type="hidden" name="ups_date[]">
<input type="hidden" name="virus_def_date[]">
                           <input type="hidden" name="backup_restore_date[]">
                           <td>
                                <input type="hidden" name="tasks_id[]"  value="<?php echo $row['Tasks_id'];?>"  value="<?php echo $row['Taskname'];?>">  
                         <input type="hidden" placeholder="Server Drive:" name="server_drive_one[]" size="12">
                <input type="hidden" placeholder="Server Drive:" name="server_drive_two[]" size="12">
                 <input type="hidden" placeholder="Server Drive:" name="server_drive_three[]" size="12">
                            <textarea id="w3review" name="details_desc" rows="2" cols="30" readonly> <?php echo $row['Taskname'];?>
                      </textarea>
                      </td>
                       <td>
<input type="date" name="backup_date[]" value="<?php echo $this->db->get_where('jobcard_tasks_details' , array('Tasks_id' => $taskid,'jid' =>$jid))->row()->backup_date; ?>">
                      </td>
                         <td>
  
                      </td>
                         <td>
                                <textarea id="w3review" name="Description_one[]" rows="2" cols="30">
<?php echo $description;?>
</textarea>
                      </td>
              
                      <td>
                        <input type="text" name="lab_nueve_<?php echo $row['Tasks_id'];?>" placeholder="0"  value="<?php echo $this->db->get_where($this->session->userdata('login_type'), array($this->session->userdata('login_type') . '_id' => $this->session->userdata('login_user_id')))->row()->name;?>"">
                      </td>
                 </tr>   
                 
                    <?php }?> 
                        <?php if($taskid=="4"){
                    ?>
                  <tr>
                           <td>
                        <input type="hidden" name="ups_date[]">
<input type="hidden" name="virus_def_date[]">
                               <input type="hidden" name="backup_date[]">
                           
                                            <input type="hidden" placeholder="Server Drive:" name="server_drive_one[]" size="12">
                <input type="hidden" placeholder="Server Drive:" name="server_drive_two[]" size="12">
                 <input type="hidden" placeholder="Server Drive:" name="server_drive_three[]" size="12">
                                <input type="hidden" name="tasks_id[]"  value="<?php echo $row['Tasks_id'];?>"  value="<?php echo $row['Taskname'];?>">  
                  
                            <textarea id="w3review" name="details_desc" rows="2" cols="30" readonly> <?php echo $row['Taskname'];?>
                      </textarea>
                      </td>
                       <td>
<input type="date" name="backup_restore_date[]" value="<?php echo $this->db->get_where('jobcard_tasks_details' , array('Tasks_id' => $taskid,'jid' =>$jid))->row()->backup_restore_date; ?>">
                      </td>
                         <td>
  
                      </td>
                         <td>
                                <textarea id="w3review" name="Description_one[]" rows="2" cols="30">
<?php echo $description;?>
</textarea>
                      </td>
              
                      <td>
                        <input type="text" name="lab_nueve_<?php echo $row['Tasks_id'];?>" placeholder="0"  value="<?php echo $uname?>"">
                      </td>
                 </tr>   
                 
                    <?php }?>
                            <?php if($taskid=="5"){
                    ?>
                  <tr>
                      <input type="hidden" name="ups_date[]">
<input type="hidden" name="virus_def_date[]">
                          <input type="hidden" name="backup_date[]">
                           <input type="hidden" name="backup_restore_date[]">
                           <td>
                                <input type="hidden" name="tasks_id[]"  value="<?php echo $row['Tasks_id'];?>"  value="<?php echo $row['Taskname'];?>">  
                                <input type="hidden" placeholder="Server Drive:" name="server_drive_one[]" size="12">
                <input type="hidden" placeholder="Server Drive:" name="server_drive_two[]" size="12">
                 <input type="hidden" placeholder="Server Drive:" name="server_drive_three[]" size="12">
                            <textarea id="w3review" name="details_desc" rows="2" cols="30" readonly> <?php echo $row['Taskname'];?>
                      </textarea>
                      </td>
                       <td>

                      </td>
                         <td>
  
                      </td>
                         <td>
                                <textarea id="w3review" name="Description_one[]" rows="2" cols="30">
<?php echo $description;?>
</textarea>
                      </td>
              
                      <td>
                        <input type="text" name="lab_nueve_<?php echo $row['Tasks_id'];?>" placeholder="0"  value="<?php echo $uname?>">
                      </td>
                 </tr>   
                 
                    <?php }?>
                    
                                 <?php if($taskid=="6"){
                    ?>
                    
                  <tr>
                  <input type="hidden" name="ups_date[]">
<input type="hidden" name="virus_def_date[]">
                      <input type="hidden" name="backup_date[]">
                           <input type="hidden" name="backup_restore_date[]">
                           <td>
                                             <input type="hidden" placeholder="Server Drive:" name="server_drive_one[]" size="12">
                <input type="hidden" placeholder="Server Drive:" name="server_drive_two[]" size="12">
                 <input type="hidden" placeholder="Server Drive:" name="server_drive_three[]" size="12">
                                <input type="hidden" name="tasks_id[]"  value="<?php echo $row['Tasks_id'];?>"  value="<?php echo $row['Taskname'];?>">  
                  
                            <textarea id="w3review" name="details_desc" rows="2" cols="30" readonly> <?php echo $row['Taskname'];?>
                      </textarea>
                      </td>
                       <td>

                      </td>
                         <td>
  
                      </td>
                         <td>
                                <textarea id="w3review" name="Description_one[]" rows="2" cols="30">
<?php echo $description;?>
</textarea>
                      </td>
              
                      <td>
                        <input type="text" name="lab_nueve_<?php echo $row['Tasks_id'];?>" placeholder="0"  value="<?php echo $uname?>">
                      </td>
                 </tr>   
                 
                    <?php }?>
            
            
                  <?php if($taskid=="7"){
                    ?>
                  <tr>
                           <td>
                               <input type="hidden" name="backup_date[]">
                           
                                            <input type="hidden" placeholder="Server Drive:" name="server_drive_one[]" size="12">
                <input type="hidden" placeholder="Server Drive:" name="server_drive_two[]" size="12">
                 <input type="hidden" placeholder="Server Drive:" name="server_drive_three[]" size="12">
                                <input type="hidden" name="tasks_id[]"  value="<?php echo $row['Tasks_id'];?>"  value="<?php echo $row['Taskname'];?>">  
                  
                            <textarea id="w3review" name="details_desc" rows="2" cols="30" readonly> <?php echo $row['Taskname'];?>
                      </textarea>
                      </td>
                       <td>
<input type="date" name="ups_date[]" value="<?php echo $this->db->get_where('jobcard_tasks_details' , array('Tasks_id' => $taskid,'jid' =>$jid))->row()->ups_date; ?>">
<input type="hidden" name="virus_def_date[]">
                      </td>
                         <td>
  
                      </td>
                         <td>
                                <textarea id="w3review" name="Description_one[]" rows="2" cols="30">
<?php echo $description;?>
</textarea>
                      </td>
              
                      <td>
                        <input type="text" name="lab_nueve_<?php echo $row['Tasks_id'];?>" placeholder="0"  value="<?php echo $uname?>">
                      </td>
                 </tr>   
                 
                    <?php }?>        
                      <?php if($taskid=="8"){
                    ?>
                  <tr>
                           <td>
                               <input type="hidden" name="backup_date[]">
                           
                                            <input type="hidden" placeholder="Server Drive:" name="server_drive_one[]" size="12">
                <input type="hidden" placeholder="Server Drive:" name="server_drive_two[]" size="12">
                 <input type="hidden" placeholder="Server Drive:" name="server_drive_three[]" size="12">
                                <input type="hidden" name="tasks_id[]"  value="<?php echo $row['Tasks_id'];?>"  value="<?php echo $row['Taskname'];?>">  
                  
                            <textarea id="w3review" name="details_desc" rows="2" cols="30" readonly> <?php echo $row['Taskname'];?>
                      </textarea>
                      </td>
                       <td>
<input type="date" name="virus_def_date[]" value="<?php echo $this->db->get_where('jobcard_tasks_details' , array('Tasks_id' => $taskid,'jid' =>$jid))->row()->virus_def_date; ?>">
<input type="hidden" name="ups_date[]">

                      </td>
                         <td>
  
                      </td>
                         <td>
                                <textarea id="w3review" name="Description_one[]" rows="2" cols="30">
<?php echo $description;?>
</textarea>
                      </td>
              
                      <td>
                        <input type="text" name="lab_nueve_<?php echo $row['Tasks_id'];?>" placeholder="0"  value="<?php echo $uname?>">
                      </td>
                 </tr>   
                 
                    <?php }?>
                    
                      <?php if($taskid=="9" || $taskid=="10" || $taskid=="11" || $taskid=="12"){
                    ?>
                  <tr>
                      <input type="hidden" name="ups_date[]">
<input type="hidden" name="virus_def_date[]">
                          <input type="hidden" name="backup_date[]">
                           <input type="hidden" name="backup_restore_date[]">
                           <td>
                                <input type="hidden" name="tasks_id[]"  value="<?php echo $row['Tasks_id'];?>"  value="<?php echo $row['Taskname'];?>">  
                                <input type="hidden" placeholder="Server Drive:" name="server_drive_one[]" size="12">
                <input type="hidden" placeholder="Server Drive:" name="server_drive_two[]" size="12">
                 <input type="hidden" placeholder="Server Drive:" name="server_drive_three[]" size="12">
                            <textarea id="w3review" name="details_desc" rows="2" cols="30" readonly> <?php echo $row['Taskname'];?>
                      </textarea>
                      </td>
                       <td>

                      </td>
                         <td>
  
                      </td>
                         <td>
                                <textarea id="w3review" name="Description_one[]" rows="2" cols="30">
<?php echo $description;?>
</textarea>
                      </td>
              
                      <td>
                        <input type="text" name="lab_nueve_<?php echo $row['Tasks_id'];?>" placeholder="0"  value="<?php echo $uname?>">
                      </td>
                 </tr>   
                 
                    <?php }?>        
                    
                    
                    <?php endforeach;?>
                  </tbody>
                </table>
                 <p><b></b>WORK CARRIED OUT ON SITE</b></p>
                            <table class="table table-bordered">
    <thead>
      <tr>
                <th>Username </th>
        <th>Details</th>
        <th>Resolution</th>
        <th>User 
Confirm
</th></th
Sign

        
      </tr>
    </thead>
    <tbody>
        <?php $works = $this->db->get_where('works_onsite' , array('jid' =>$jid))->result_array();
							foreach($works as $onsite):
							   $userid= $onsite['user_id'];
//$uname= $this->db->get_where('admin' , array('admin_id' => $userid))->row()->name;			
							?>	
     
          <tr>
           <input name="works_id[]" type="hidden"  value="<?php echo $onsite['works_id'];?>" class="form-control" />
           <td><input name="user_onsite[]" type="text"  id="Details" value="<?php echo $userid;?>" class="form-control" /></td>
        <td><textarea id="w3review" align="right" name="details[]" rows="2" cols="40">
  <?php echo $onsite['details'];?>
  </textarea></td>
        <td><textarea id="w3review" align="right" name="resolution[]" rows="2" cols="40">
  <?php echo $onsite['resolution'];?>
  </textarea></td>
        
        <td><input class="form-control" name="user_confirm[]" value="<?php echo $onsite['user_confirm'];?>"/></td>
    
        
      </tr>
      <?php endforeach;?>
      
         
     
    </tbody>
  </table>
  
   <p><b></b>EXTRA WORK REQUIRED / RECOMMENDATIONS</b></p>
             <table class="table table-bordered" align="centre">
    
    <tbody>
     


<textarea id="w3review" align="right" name="extra_work_required" rows="4" cols="100">
  <?php echo $this->db->get_where('jobcards' , array('jid' =>$jid))->row()->extra_work_required; ?>
  </textarea>
   <td>
         	<select name="status_update" id="employer">
         	    
                    		<option value="Approved"><?php echo "Approved";?></option>
				<option value="Declined"><?php echo "Declined";?></option>
				
						</select>
    
      </td>
      <tr><td><textarea id="reasondec" align="right" name="reasondec" rows="4" cols="100">

  </textarea></td></tr>
    </tbody>

  </table>
                <div class="form-buttons-w text-center">
                       <?php   if($is_owner==3){  }   else{?>
                  <button class="btn btn-success btn-rounded" type="submit"><?php echo get_phrase('update');?></button>
                <?php }?>
                </div>
                <?php echo form_close();?>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
 <?php endforeach;?>


    <script type="text/javascript">
    function get_class_sections(class_id) 
    {
        $.ajax({
            url: '<?php echo base_url();?>teacher/get_class_section/' + class_id ,
            success: function(response)
            {
                jQuery('#section_selector_holder').html(response);
            }
        });
    }
</script>

<script type="text/javascript">
    function get_class_subject(class_id) {
        $.ajax({
            url: '<?php echo base_url(); ?>admin/get_class_subject/' + class_id,
            success: function (response)
            {
                jQuery('#subject_selector_holder').html(response);
            }
        });
    }
</script>

<script>
var numRows = 2,
  ti = 5;
var tableCount = 1;
var index = 1;

window.standBy = function() {
  var sum = 0;
  $(".Standby").each(function(index, stand) {
    sum += parseFloat($(stand).val());
  })

  $(".grandtotal").val(sum)
}

function calculate() {
  var tr = $(this).closest('tr'),
    startTime = $('.Time1').val(),
    endTime = $('.Time2').val();

  if (startTime === '' || endTime === '') {
    return;
  }

  var hours = parseInt(endTime.split(':')[0], 10) - parseInt(startTime.split(':')[0], 10);
  if (hours < 0) hours = 24 + hours;
  $(".Hours", tr).val(hours);

  if (hours >= 4) $(".Standby", tr).val("1");
  if (hours <= 4) $(".Standby", tr).val("0.5");
  //if (hours==4 && hours<8) $(".Standby").val("1");

  if (hours >= 8 && hours <= 12) $(".Standby", tr).val("1.5");

  if (hours > 12) $(".Standby", tr).val("1.5");



}
$('#table').on('input', ".Time1,.Time2", calculate);
$('#table').find(".Time1").trigger('change')


window.addTime = function() {
  tableCount++;
  $('#timeTable').clone().attr('id', "timeTable" + tableCount).appendTo('#table');
  $('#timeTable' + tableCount).find("input").val("");
  index++;
  $('#timeTable' + tableCount + ' .aa').html(tableCount);

};


$(document).on('click', 'button.removeTime', function() {
  var closestTable = $(this).closest('table');
  if (closestTable.attr('id') != "timeTable") {
    closestTable.remove();
  }
  tableCount--;
  if (tableCount < 1) {
    tableCount = 1;
  }
  return false;
});
</script>