<? global $vis_language; 
if($contract_details==-1){ 
	include(VIS_PATH_TEMPLATE.'no_record_yet.php'); 
	echo '<script> $("#view_action").hide(); $("#vis_contract_form .panel-footer").hide(); $("#vis_contract_list").hide(); $(".fullFrame").removeClass("b-t").addClass("m-t-lg m-b-lg"); </script>';
 } else { ?>
<script> $("#view_action").show(); $("#vis_contract_form .panel-footer").show(); $("#vis_contract_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;"><input type="checkbox"><i></i></label>		
            </div>
         </th>-->
		 <th class="txt_nowrap"><? echo $vis_language['TXTCONTRACTNUMBER'];?></th>
         <th><? echo $vis_language['TXTNAME']; ?></th>
		 <th class="txt_nowrap"><? echo $vis_language['TXTDEPARTMENT']; ?></th>
		 <th class="txt_nowrap"><? echo $vis_language['TXTTYPE'];?></th>
		 <th class="txt_nowrap"><? echo $vis_language['TXTVENDOR']; ?></th>
         <th class="txt_nowrap"><? echo $vis_language['TXTEXPIRY']; ?></th>
         <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
         <th></th>
      </tr>
   </thead>
   <tbody>
      <?
         for($i=0;$i<count($contract_details);$i++) {
			 if($contract_details[$i]['status']==0){ $status =$vis_language['TXTDRAFT'];$lbl='label-default'; } 
			 else if($contract_details[$i]['status']==1){ $status =$vis_language['TXTPENDING'];$lbl='vh-yellow-bg'; }
			 else if($contract_details[$i]['status']==2) { $status =$vis_language['TXTACTIVE']; $lbl='vh-green-bg';}
			 else if($contract_details[$i]['status']==3){ $status =$vis_language['TXTITILREJECTED']; $lbl='vh-red-bg';} 
			 else if($contract_details[$i]['status']==4){ $status =$vis_language['TXTITILCANCELED']; $lbl='vh-blue-bg';} 
			 else { $status =$vis_language['TXTITILEXPIRED'];$lbl='vh-red-bg';}
            //echo '<td width="30"><label class="checkbox m-n i-checks"><input type="checkbox" name="vis_global_mass_chk_'.$i.'" id="vis_global_mass_chk_'.$i.'" value="'.$contract_details[$i]['contract_id'].'" /><i></i></label></td>';
		    echo '<tr><td><a href="#/cmdb/contract_details/'.str_replace('/', ' ', $contract_details[$i]['name']).'/'.$contract_details[$i]['contract_id'].'">'.$contract_details[$i]['contract_number'].'</a></td>';
			echo '<td><a href="#/cmdb/contract_details/'.str_replace('/', ' ', $contract_details[$i]['name']).'/'.$contract_details[$i]['contract_id'].'">'.$contract_details[$i]['name'].'</a></td>';
			echo '<td><a href="#/cmdb/contract_details/'.str_replace('/', ' ', $contract_details[$i]['name']).'/'.$contract_details[$i]['contract_id'].'">'.$contract_details[$i]['domain_name'].' : '.$contract_details[$i]['department_name'].'</a></td>';
			echo '<td><a href="#/cmdb/contract_details/'.str_replace('/', ' ', $contract_details[$i]['name']).'/'.$contract_details[$i]['contract_id'].'">'.$contract_details[$i]['contract_type_name'].'</a></td>';
			echo '<td><a href="#/cmdb/contract_details/'.str_replace('/', ' ', $contract_details[$i]['name']).'/'.$contract_details[$i]['contract_id'].'">'.$contract_details[$i]['vendor_name'].'</a></td>';
			echo '<td><a href="#/cmdb/contract_details/'.str_replace('/', ' ', $contract_details[$i]['name']).'/'.$contract_details[$i]['contract_id'].'">'.format_datetime($contract_details[$i]['end_date']).'</a></td>';
			 echo '<td><span class="label '.$lbl.'">'.$status.'</span></td>'; ?>
			<td align="center"> <a class="text-muted" href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=<?php echo $operation['vis_module']; ?>&vis_operation=get_contract_delete&vis_contract_id=<? echo $contract_details[$i]['contract_id']; ?>&vis_static_area=vis_contract_delete_form" title="<? echo $vis_language['TXTDELETE']; ?>"><i class="vh vh-delete-round"></a></td></tr> 
	  <? } ?>
   </tbody>
</table><? } ?>
<script type="text/javascript">
   $(".selectpicker").selectpicker(); 
</script>
