<?  global $vis_language;
    $paging_list='';
 
?>
<section id="breadcrumb" class="row m-b m-l m-r">
<div class="col-sm-6">
	<div class="no-padder">
		<h3 class="m-b-xs text-black"><? echo $operation['view_title']; ?><span id="total_cnt"> (<? echo ($ticket_info['total']=='')?0:$ticket_info['total']; ?>)</span></h3>
	<ul class="breadcrumb bg-empty no-border m-b-xxs no-padder">
        <li><a class="link" href="#/home/quick_view/<? echo $vis_language['TXTHOME']; ?>"><?= $vis_language['TXTHOME'];?></a></li>
		   <li><a class="link" href="#/report/report_list/<? echo $vis_language['TXTREPORTS']; ?>"><?= $vis_language['TXTREPORTS']; ?></a></li>
        <li ><a class="link" href="javascript:void(0);" onclick="$('#vis_workpanel_div').visExecution('load_module', '<? echo $vis_language['TXTCUSTOM']; ?>', {'vis_module':'report', 'vis_operation':'view_custom_report','custom_show_report':'7'})"><? echo $vis_language['TXTCUSTOMREPORT']; ?></a></li>
        <li class="active"><? echo $operation['view_title']; ?></li>
	</ul>
  </div>
  </div>
  <div class="col-sm-6 text-right text-left-xs m-t-lg">
    <? include(VIS_PATH_TEMPLATE.'report_left_menu.php'); ?>
	</div>
</section>
<section class="col-lg-12">
	<div class="wrapper bg-white clr" id="vis_filter_list" style="display:none;"></div>
</section>
<? if($ticket_details!=-1  && $ticket_details !='') {?>
<div class="col-lg-12">
	<form name="vis_ticket_form" id="vis_ticket_form" method="POST">
		<section class="panel panel-default">
		<div class="row wrapper clr" id="view_action">
		<header class="col-sm-12">
			<div class="pull-right" id="pg_1">
					<div class="btn-group">
						<div class="tkt_right_menu" id="paging" style="width:auto !important;">
							<div class="text-right">
	   <ul style="margin:0px;" class="pagination pagination-sm m-t-xs pagination_ticket_list"></ul>
	</div>
						</div>
					  </div>
                   <input type="hidden" name="vis_total_page" id="vis_total_page" value="<?= $view_info['page_count']; ?>"/>
                   <input type="hidden" name="vis_total_ticket" id="vis_total_ticket" value="<?= ($ticket_details!=-1)?count($ticket_details):0; ?>"/>
                   
				  </div>
			<div class="pull-right">
				<ul class="m-n footer_link">
					<li>
						  <input type="hidden" name="vis_filter_id" id= "vis_filter_id" value="<?php echo $operation['filter_id']; ?>">
					</li>
				</ul>
			</div> <!--/ .pull-right -->
			
		</header>
		</div>
			<div class="table-responsive scroll-x" id="vis_ticket_list">
			<? include_once(VIS_PATH_TEMPLATE.'custom_rep_ticket_list.php'); ?>
			</div>
			<footer class="wrapper panel-footer bg-white col-sm-12">
				  <div class="pull-right">
			  <div class="btn-group">
						<div class="tkt_right_menu" id="paging" style="width:auto !important;">
							<div class="text-right">
	   <ul style="margin:0px;" class="pagination pagination-sm m-t-xs pagination_ticket_list"></ul>
	</div>
						</div>
					  </div>
</div>
			 
			</footer>
		  </section>
	</form>
</div>
<section class="fullFrame m-n" id="vis_no_record_search" style="display:none;">
</section>
<? }
else
{
	include(VIS_PATH_TEMPLATE.'no_record_yet.php');
} ?>
<script type="text/javascript">

function vis_apply_filter(vis_page, vis_filter_id){
	var data=arg='';
	//if(vis_page!=undefined && typeof(vis_page)!=undefined && vis_filter_id!=undefined && typeof(vis_filter_id)!=undefined)
        data = {'vis_module':'report', 'vis_operation':'custom_report_result', 'vis_filter_id':vis_filter_id, 'vis_page':vis_page};
	$.ajax({
		url: 'index.php?vis_tmpst=new Date().getTime()',
		data: data,
		type: "POST",
		dataType: "json",
		success: function(data) {
            
                $("#total_cnt").html('('+data.total_cnt+')');
                /*$(".tkt_right_menu").html(data.paging);*/
                $("#vis_ticket_list").html(data.list);
                $("#vis_filter_id").val(data.filter_id);
                $("#vis_total_page").val(data.total_pages);
                $("#vis_total_ticket").val(data.total_tickets);
                if(data.total_cnt==0){
                    $("#vis_no_record_search").show();
                    $("#vis_no_record_search").html(data.list);
                }else $("#vis_no_record_search").hide();
               
           
		},
		error: function(xhr, ajaxOptions, thrownError) {$("#vis_global_msg_div").visInterface("load_global_message", "Error: "+xhr.status+" - "+thrownError);}
	});
	
}

	
	$('.pagination_ticket_list').twbsPagination({
totalPages:<?php echo $view_info['page_count']; ?>,visiblePages:3,startPage: 1,first:false,last:false,
	onPageClick: function (event, page) { page=parseInt(page)-1;	vis_apply_filter(page,'<?= $operation['vis_filter_id'];?>');}
});
</script>