<? if($service_details!=-1){?>
<table class="table table-hover b-t b-light m-b-none">
    <thead class="table_head">
        <tr>
         <th></th>
         <th><? echo $vis_language['TXTNAME']; ?></th>
         <th><? echo $vis_language['TXTSERVICECATEGORY']; ?></th>
         <th><? echo $vis_language['TXTCOST']; ?></th>						
        </tr>
    </thead>
    <tbody>
	<? for($i=0;$i<count($service_details);$i++){?>
      <tr>
      	<td><label onClick="show_data(<?=$service_details[$i]['item_id'];?>,'<?=$service_details[$i]['cost'];?>','<?=$service_details[$i]['name'];?>','<?=$service_details[$i]['description'];?>','<?=$service_details[$i]['domain_id'];?>','<?=$service_details[$i]['department_id'];?>');" class="checkbox m-n i-checks"><input type="radio" name="vis_service_item_id" id="vis_service_item_id" value="<?=$service_details[$i]['item_id'];?>" /><i></i></label></td>
        <td><?=$service_details[$i]['name'];?></td>
        <td><?=$service_details[$i]['category_name'];?></td>
        <td><?=$service_details[$i]['cost'];?></td>
      </tr>
    <? }?>  
    </tbody>
</table>
</form>
<div class="row">
<div class="form-horizontal">
<div class="col-md-12">
  <div class="wrapper">
  <form method="post">
      <div id="vis_custom_field_form">
      </div>
  </form>
  </div>
</div>
</div>
</div>    
<? }else{
	   echo '<div class="text-center">'.$vis_language['TXTNOMATCHFOUND'].'</div>';
   }?>
<script type="application/javascript">
function show_data(item_id,cost,name,description,domain_id,department_id){
	$('#vis_service_cost').val(cost);
	$('#vis_subject').val('<?=$vis_language['TXTITILSERVICEREQUESTFOR'];?>'+' '+name);
	$('#vis_ticket_post').val(description);
	//$('#vis_service_domain').val(domain_id);
	//$('#vis_service_department').val(department_id);
	$('#sevice_quantity').show();
	 show_total_cost();
	 get_custom_field(item_id);
}
function get_custom_field(item_id){
	$('#vis_custom_field_form').visExecution('load_area', {'vis_module':'setting', 'vis_operation':'ticket_service_item_custom_field', 'vis_item_id':''+item_id+''});
	
}
function get_custom_data(){
		var datastring = $('#vis_custom_field_form').closest('form').serialize();
		$('#vis_service_request_data').val(datastring);
		$('#vis_service_form').visExecution('submit_form', {'vis_module': 'ticket', 'vis_operation': 'open_new_ticket', 'vis_form': 'vis_service_form'});
}
</script>   