<? global $vis_language; 
if($autosubtask_details==-1){   
	//include(VIS_PATH_TEMPLATE.'no_record_yet.php'); 
	echo '<script> $("#view_action").hide(); $("#vis_product_status_form .panel-footer").hide(); $("#vis_product_status_list").hide(); $(".fullFrame").removeClass("b-t").addClass("m-t-lg m-b-lg"); </script>';
 } else { ?>
<script> $("#view_action").show(); $("#vis_product_status_form .panel-footer").show(); $("#vis_product_status_list").show(); </script>
<table class="table table-hover b-t b-light m-b-none" data-ride="datatables">
   <thead class="table_head">
      <tr>
         <th>
            <div class="btn-group">
               <label class="checkbox m-n m-r-sm i-checks"  style="float: left;"> </label>		
            </div>
         </th>
         <th><? echo $vis_language['TXTNAME']; ?></th>
		 <th class="txt_nowrap"><? echo $vis_language['TXTDUETIME'];?></th>
         <th class="txt_nowrap"><? echo $vis_language['TXTRESOLUTIONTIME']; ?></th>
         <th class="txt_nowrap"><? echo $vis_language['TXTACTION']; ?></th>
      </tr>
   </thead>
   <tbody>
      <? if($autosubtask_details!=-1) 
		  for($i=0;$i<count($autosubtask_details);$i++) {
			  $overdue_day = $remaining_minutes = $overdue_hr = $overdue_min =0;
			  $resolution_day = $remaining_minutes = $resolution_hr = $resolution_min =0;
			  
				$overdue_day=floor($autosubtask_details[$i]['startdate']/1440);
				$remaining_minutes=$autosubtask_details[$i]['startdate']%1440;
				$overdue_hr = floor($remaining_minutes/60);
				$overdue_min = $remaining_minutes%60;

				$resolution_day = floor($autosubtask_details[$i]['enddate']/1440);
				$remaining_minutes=$autosubtask_details[$i]['enddate']%1440;
				$resolution_hr = floor($remaining_minutes/60);
				$resolution_min = $remaining_minutes%60; 
			 if($autosubtask_details[$i]['task_id']==1) $disable='disabled=disabled'; else $disable='';
             if($autosubtask_details[$i]['is_enabled']==1){ $status = $vis_language['TXTENABLED'];$lbl='vh-green-bg';} else {$status = $vis_language['TXTDISABLED'];$lbl='label-default';}
             $department_access=$autosubtask_details[$i]['department'];
             echo '<tr><td width="30"></td>';
             echo '<td><a href="#" data-toggle="ajaxModal" data-modal-arguments="vis_module=home&amp;vis_operation=update_autosubtask&page='.$page.'&autotask_id='.$autotask_details['autotask_id'].'&task_id='.$autosubtask_details[$i]['task_id'].'"  >'.$autosubtask_details[$i]['task_title'].'</a></td>';		 
			 echo '<td><a href="#" data-toggle="ajaxModal" data-modal-arguments="vis_module=home&amp;vis_operation=update_autosubtask&page='.$page.'&autotask_id='.$autotask_details['autotask_id'].'&task_id='.$autosubtask_details[$i]['task_id'].'" >'.$overdue_day.'D :'.$overdue_hr.'H :'.$overdue_min.'M</a></td>';
			 echo '<td><a href="#" data-toggle="ajaxModal" data-modal-arguments="vis_module=home&amp;vis_operation=update_autosubtask&page='.$page.'&autotask_id='.$autotask_details['autotask_id'].'&task_id='.$autosubtask_details[$i]['task_id'].'" >'.$resolution_day.'D :'.$resolution_hr.'H :'.$resolution_min.'M</a></td>';
 		 ?>
      <td>
	 <a class="text-muted" data-toggle="ajaxModal" data-modal-arguments="vis_module=home&amp;vis_operation=update_autosubtask&page='<?php echo $page; ?>'&autotask_id=<? echo $autotask_details['autotask_id']; ?>&task_id=<? echo $autosubtask_details[$i]['task_id']; ?>"> <i class="vh vh-edit"> </i></a>
	 &nbsp; 
	 <a class="text-muted" href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=home&vis_operation=get_delete_autotask&vis_task_id=<? echo $autosubtask_details[$i]['task_id']; ?>&vis_filter_id=''&vis_static_area=vis_autotask_delete_area&autotask_id='<?php echo $autotask_details['autotask_id']; ?>'" title="<? echo $vis_language['TXTDELETE']; ?>"><i class="vh vh-delete-round"></a></td>
    
      </tr> <?
         } ?>
   </tbody>
</table><? } ?>
<script type="text/javascript">
   $(".selectpicker").selectpicker();
   $(document).ready(function() {	
   $('[data-ride="datatables"]').dataTable({		
        "bPaginate" : false,	
   		"sDom": 't', "bAutoWidth": false,
   		"aoColumns": [
   			{ "bSortable": false },
   		  	null,
   		  	null,
   		  	null,
   			{ "bSortable": false }
   		]
   	});
   });   
</script>
