<?php  //echo '<pre>'; print_r($vt_ticket_records); echo '</pre>';	
		//index.php?module=HelpDesk&view=Detail&record=44
		//[id] => 17x33
	if($vt_ticket_records =='Vtiger Login Failed'){ echo $vt_ticket_records; die; } 
	if(count($vt_ticket_records)>0){ //echo '<pre>'; print_r($operation); echo '</pre>'; ?>
		<section id="vis_ticket_post_forms">
		
		<form class="form-horizontal" method="post" enctype="multipart/form-data" name="vis_vtiger_ticket_form" id="vis_vtiger_ticket_form">
					
			<div class="form-group" id="vtiger_data">
					 <div class="line b-b line-lg pull-in"></div>
					 <br/> 
							<div class="col-xs-4">
									 <div class="form-group col-xs-10">
										<label for="taskPriority"><? echo $vis_language['TXTUSER'];?></label> 
										<select class="form-control input-sm selectpicker" onchange="get_vt_status(this.value);" id="vis_vt_user" name="vis_vt_user" <?php if(count($vt_acc_list) > 5) $src= 'data-live-search="true"' ; ?>   >
										<option value="-1" ><? echo $vis_language['TXTSELECT'];?></option>
										<?
										   for($i=0;$i<count($vt_acc_list);$i++) {                                      
										   echo '<option value="'.$vt_acc_list[$i]['integration_id'].'" >'.$vt_acc_list[$i]['domain_name'].'::'.$vt_acc_list[$i]['vtiger_user'].'</option>'; } ?>
										</select>
									 </div>			 
									 
							</div> 
						<div id="ajax_vt" >
 							<!--<div class="col-xs-4">
									 <div class="form-group col-xs-10">
										<label for="taskPriority"><? echo $vis_language['TXTSTATUS'];?></label> 
										<select class="form-control input-sm selectpicker" id="vis_vt_status" name="vis_vt_status" <?php if(count($vt_ticketstatus) > 5) $src= 'data-live-search="true"' ; ?>   >
										<?
										   for($i=0;$i<count($vt_ticketstatus);$i++) {                                      
										   echo '<option value="'.$vt_ticketstatus[$i]['value'].'" >'.$vt_ticketstatus[$i]['label'].'</option>'; } ?>
										</select>
									 </div>			 
									 
							</div>								
							<div class="col-xs-4">
									 <div class="form-group col-xs-10">
										<label for="taskPriority"><? echo $vis_language['TXTPRIORITY'];?></label> 
										<select class="form-control input-sm selectpicker" id="vis_vt_priority" name="vis_vt_priority" <?php if(count($vt_ticket_priorities) > 5) $src= 'data-live-search="true"' ; ?>   >
										<?
										   for($i=0;$i<count($vt_ticket_priorities);$i++) {                                      
										   echo '<option value="'.$vt_ticket_priorities[$i]['value'].'" >'.$vt_ticket_priorities[$i]['label'].'</option>'; } ?>
										</select>
									 </div>			 
									 
							</div>
							<input type="hidden" name="vis_ticketid" id="vis_ticketid" value="<?php echo $operation['vis_ticketid']; ?>" >
						--></div>
						<div class="col-xs-10">
							</div>
							<div class="col-xs-2" id="btn_create">
								
							</div>
					</div>
		</form>
		 


		
		<div id="vt_list">
				<?php if($vt_ticket_records!=-1){ 
					include(VIS_PATH_TEMPLATE.'vt_ticket_list.php');
				}else{
					include(VIS_PATH_TEMPLATE.'no_record_yet.php');
				} ?>
			</div>
	    </section>
	<?   
	}else include(VIS_PATH_TEMPLATE.'no_record_yet.php');?>
	<script>
	function get_vt_status(integration_id) {
	  $('#ajax_vt').visExecution('load_operations', {'vis_module':'ticket', 'vis_operation':'vt_status', 'vis_integration_id':integration_id}); 
	  if(integration_id!=-1){ 
		html = '<button type="button" id="btn_create_ticket" class="btn btn-default m-r " ';
		html += "onclick=\"$(this).visExecution('submit_form', {'vis_module': 'ticket', 'vis_operation': 'vt_create_ticket_from_list', 'vis_form': 'vis_vtiger_ticket_form','vis_ticketid':'<?php echo $operation['vis_ticketid']; ?>', 'vis_integration_id':"+integration_id+"});$('#btn_create_ticket').button('loading');\" ";
		html += '><? echo $vis_language['TXTADDTICKET']; ?></button>';
		//alert(html);
		$("#btn_create").html(html);
	  }else{ html = ''; $("#btn_create").html(html); }
	  get_vt_ticket_list(integration_id);
    }
	function get_vt_ticket_list(integration_id) {
	  $('#vt_list').visExecution('load_operations', {'vis_module':'ticket', 'vis_operation':'vt_ticket_list', 'vis_integration_id':integration_id}); 
	 
    }
	</script>