<?
    global $vis_language;
    $paging_list='';
    for($i=0;$i<$view_info['page_count'];$i++) $paging_list.='<option value="'.$i.'" '.(($page==$i)?'selected="selected"':'').'>'.($i+1).'</option>'; ?>
<section id="breadcrumb" class="row m-b m-l-none m-r-none">
   <div class="col-sm-6" id="url_header">
      <h3 class="m-b-xs text-black"><? echo $operation['view_title']; ?><span id="total_cnt"> (<? echo $parserlog_info['total']; ?>)</span></h3>
      <div>
         <ul class="breadcrumb bg-empty no-border m-b-xxs no-padder">
            <li><a class="link" href="#/home/quick_view/<? echo $vis_language['TXTHOME']; ?>"><? echo $vis_language['TXTHOME']; ?></a></li>
            <li><a class="link" href="#/setting/setting_menu/<? echo $vis_language['TXTSETTINGS'];?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo $vis_language['TXTSETTINGS'];?>',{'vis_module':'setting','vis_operation':'setting_menu'});"><? echo $vis_language['TXTSETTINGS']; ?></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">
        <? if($parserlog_details!=-1) { ?>
       <div class="btn-group pull-right">
			<a title="<?= $vis_language['TXTFILTERLIST']; ?>" href="javascript:void(0);" class="btn btn-default btn-sm dropdown-toggle" onclick="$('#vis_filter_list').slideToggle();"><i style="font-size:10px;" class="vh vh-filter"></i></a>
		</div>
        <? } ?>
   </div>
</section>
<div class="col-lg-12">
   <? include_once(VIS_PATH_TEMPLATE.'parser_log_search.php');?>
</div>
  <? if($view_info['page_count']>0)
   {
   ?>
<div class="col-lg-12">
   <form  name="vis_parserlog_form" id="vis_parserlog_form">
	    <input type="hidden" value="" name="vis_filter_enable" id="vis_filter_enable">
      <section class="panel panel-default">
         <div class="row wrapper clr" id="view_action">
            <div class="col-sm-9 tkt_left_menu m-t-xs">

				   <div class="vis_mass_action col-sm-1">
			         <a class="m-r-sm link v-middle" href="javascript:void(0);"  id="del_parser" onclick="delete_parserlog();"><? echo $vis_language['TXTDELETE']; ?></a>
			        </div>
			        <div class="">
					 <a  href="javascript:void(0);" data-modal-arguments="vis_module=<?php echo $operation['vis_current_module']; ?>&vis_operation=<?php echo $operation['vis_operation']; ?>&vis_parserlog_area=0&vis_static_area=vis_parserlog_delete_area" title="<? echo $vis_language['TXTEMTPARSLOG']; ?>"  data-toggle="ajaxModal" class="link v-middle"><? echo $vis_language['TXTEMTPARSLOG']; ?></a>
               </div>
            </div>
			<div  class="col-sm-3 text-right text-center-xs tkt_right_menu" id="paging">
				 <select name="pageing" class="form-control input-sm selectpicker pull-right paging v-middle" onchange="$(this).parents('#vis_workpanel_div').visExecution('load_area',{'vis_module':'<?php echo $operation['vis_current_module']; ?>', 'vis_operation':'<?php echo $operation['vis_current_operation']; ?>', 'vis_page':this.value})">
					<? echo $paging_list;?>
				  </select>
				  <div class="text-muted pull-right label_page"><? echo $vis_language['TXTPAGE']; ?>:</div>
			</div>
         </div>
         <div class="table-responsive scroll-x" id="vis_parserlog_list">
             <? include_once(VIS_PATH_TEMPLATE.'parser_log_list.php'); ?>
         </div>
         <footer class="wrapper panel-footer bg-white">
            <div class="row">
               <div class="col-sm-9 tkt_left_menu m-t-xs">
               <div class="">
				    <div class="vis_mass_action col-sm-1">
			         <a class="m-r-sm link v-middle" href="javascript:void(0);" id="del_parser1" onclick="delete_parserlog();" title="<? echo $vis_language['TXTDELETE']; ?>" ><? echo $vis_language['TXTDELETE']; ?></a>
			        </div>
					 <a  href="javascript:void(0);" data-modal-arguments="vis_module=<?php echo $operation['vis_current_module']; ?>&vis_operation=<?php echo $operation['vis_operation']; ?>&vis_parserlog_area=0&vis_static_area=vis_parserlog_delete_area" title="<? echo $vis_language['TXTEMTPARSLOG']; ?>"  data-toggle="ajaxModal" class="link v-middle"><? echo $vis_language['TXTEMTPARSLOG']; ?></a>
               </div>
            </div>
			<div  class="col-sm-3 text-right text-center-xs tkt_right_menu" id="paging">
				 <select name="pageing" class="form-control input-sm selectpicker pull-right paging v-middle" onchange="$(this).parents('#vis_workpanel_div').visExecution('load_area',{'vis_module':'<?php echo $operation['vis_current_module']; ?>', 'vis_operation':'<?php echo $operation['vis_current_operation']; ?>', 'vis_page':this.value})">
					<? echo $paging_list;?>
				  </select>
				  <div class="text-muted pull-right label_page"><? echo $vis_language['TXTPAGE']; ?>:</div>
			</div>
            </div>
         </footer>
      </section>
   </form>
</div>
<section class="fullFrame m-n" id="vis_no_record_search1" style="display:none;">
</section>
<script>
   function vis_apply_filter(vis_page){
	vis_page = (vis_page!=undefined && typeof(vis_page)!=undefined && vis_page != '') ? vis_page:'';
	var data = {'vis_filter_enable':'1', 'vis_page':vis_page, 'vis_action': $("#vis_filter_list input, #vis_filter_list select").serialize() };
    $.ajax({
		url: 'index.php?vis_module=setting&vis_operation=view_parser_log',
		data: data,
		type: "POST",
		dataType: "json",
		success: function(data) {
			$("#total_cnt").html('('+data.total_cnt+')');
			$(".tkt_right_menu").html(data.paging);
			$("#vis_parserlog_list").html(data.list);
			$('#url_header').html('<h3 class="m-b-xs text-black"><? echo $vis_language['TXTFILTERRESULT']; ?><span id="total_cnt"> ('+data.total_cnt+')</span></h3><div><ul class="breadcrumb bg-empty no-border m-b-xxs no-padder"><li><a class="link" href="#/home/quick_view/<? echo $vis_language['TXTHOME']; ?>"><? echo $vis_language['TXTHOME']; ?></a></li> <li><a class="link" href="#/setting/setting_menu/<? echo $vis_language['TXTSETTINGS'];?>"><? echo $vis_language['TXTSETTINGS'];?></a></li><li><a class="link" href="#/setting/view_parser_log/<? echo $vis_language['TXTPARSERLOG'];?>" onclick="location.reload();"><? echo $vis_language['TXTPARSERLOG'];?></a></li><li class="active"><? echo $vis_language['TXTFILTERRESULT']; ?></li></ul></div>').show();
			if(data.total_cnt==0){
				$("#vis_no_record_search1").show();
				$("#vis_no_record_search1").html(data.list);
			}else $("#vis_no_record_search1").hide();
            toggle_mass_actions(); // To disable header & footer mass actions on list pages
		},
		error: function(xhr, ajaxOptions, thrownError) {$("#vis_global_msg_div").visInterface("load_global_message", "Error: "+xhr.status+" - "+thrownError);}
	});

}
    function delete_parserlog()
   {
		var selected = [];
		var selected1 = [];
		var vis_action = "";
		$('#checkbox_data input:checked').each(function() {
		selected.push($(this).attr('name'));
		selected1.push($(this).attr('value'));
		vis_action +=$(this).attr('name')+"="+$(this).attr('value')+",";
		});
		if( selected.length > 0)
		 {
			 vis_action= vis_action.substring(0, vis_action.length-1);
			$('#del_parser').attr('data-toggle','ajaxModal');
			$('#del_parser').attr('data-modal-arguments','vis_module=<?php echo $operation['vis_current_module']; ?>&vis_operation=<?php echo $operation['vis_operation']; ?>&vis_action='+vis_action+'&vis_parserlog_area=1&vis_static_area=vis_parserlog_delete_area');
			$('#del_parser1').attr('data-toggle','ajaxModal');
			$('#del_parser1').attr('data-modal-arguments','vis_module=<?php echo $operation['vis_current_module']; ?>&vis_operation=<?php echo $operation['vis_operation']; ?>&vis_action='+vis_action+'&vis_parserlog_area=1&vis_static_area=vis_parserlog_delete_area');
		 }
		 else
		{
			$("#vis_global_msg_div").visInterface("load_global_message", "<? echo $vis_language['MSGLGNTSEL'];?>");
			return false;
		}
	}
</script>
<?
}
else
{

	 include(VIS_PATH_TEMPLATE.'no_record_yet.php');
} ?>
