<? 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>';
?>
    <header class="vis_login_head">
		<? if(isset($operation['message']) && $operation['message']!='' && $operation['message']!='domain') { ?> <script> $("#vis_submit_msg_div").show(); $("#vis_submit_msg_div").html('<? echo $operation['message']; ?>'); </script><? }else { ?> <div id="vis_submit_msg_div" class="alert text-center alert-success" style="display:none"></div>  <? } ?>
	 
	</header>

<? if($view_info['page_count']>0){
   ?>
  
<section class="container m-t-md">
   <div class="row">
      <div class="col-md-12">
         <section class="container">        
                <div class="panel-body">
                  <div class="form-horizontal" >
					<!--<form class="form-horizontal" name="vis_submit_ticket" method="post">-->
					  <form name="vis_assets_form" id="vis_assets_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">
               <div class="vis_mass_action">
                 <!-- /* <div class="btn-group">
                     <button class="btn bg-empty btn-sm dropdown-toggle action_btn" data-toggle="dropdown">
                     <i class="vh vh-action"></i> <span class="caret"></span>
                     </button>
                     <ul class="dropdown-menu">
                        <li><a href="javascript:void(0);" onclick="javascript:update_property(1);"><? echo $vis_language['TXTDELETE']; ?></a></li>
                     </ul>
                  </div>*/-->
               </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_module']; ?>', 'vis_operation':'<?php echo $operation['vis_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_assets_list">
            <? include_once(VIS_PATH_TEMPLATE.'cmdb_assets_list.php'); ?>
         </div>
         <footer class="wrapper panel-footer bg-white">
            <div class="row">
             <div class="col-sm-9 tkt_left_menu">
                  <div class="vis_mass_action_footer">
                      <!--/*  <div class="btn-group">
                        <button type="button" class="btn bg-empty btn-sm dropdown-toggle action_btn" data-toggle="dropdown">
                        <i class="vh vh-action"></i>
                        <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu" role="menu">
                           <li><a href="javascript:void(0);" onclick="javascript:update_property(1);"><? echo $vis_language['TXTDELETE']; ?></a></li>
                        </ul>
                     </div>*/-->
                  </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_module']; ?>', 'vis_operation':'<?php echo $operation['vis_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>
                    <!-- /.col-md-12 -->
                    
                  
                   <!-- </form>-->
                  </div>
                </div>
            </section> <!-- / .panel -->
		</div>
      </div><!-- /.row -->
 </section> <!-- / .panel -->
 <script src="<?= VIS_PATH_SCRIPT; ?>dropdown_dropup.js"></script>
<?
	}else { include(VIS_PATH_TEMPLATE.'no_record_yet.php'); }
?>
<section class="fullFrame m-n" id="vis_no_record_search1" style="display:none;"></section>
 
 <script>
$('.from_date').datetimepicker({format: "MM/DD/YYYY"});
$('.selectpicker').selectpicker();

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=cmdb&vis_operation=assets',
		data: data,
		type: "POST",
		dataType: "json",
		success: function(data) {
			$(".tkt_right_menu").html(data.paging);
			$("#vis_assets_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="#/cmdb/assets/<? echo $vis_language['TXTCMDB'];?>" onclick="$(\'#vis_workpanel_div\').visExecution(\'load_module\', \'<? echo $vis_language['TXTCMDB'];?>\', {\'vis_module\':\'cmdb\', \'vis_operation\':\'assets\'});"><? echo $vis_language['TXTCMDB'];?></a></li><li class="active"><? echo $vis_language['TXTFILTERRESULT']; ?></li></ul></div>').show();
			if(data.total_cnt==0){
				$("#vis_no_record_search1").show();
				$("#no_record_yet").hide();
				$("#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 set_ci_type_filter(vis_config_id){
 		$('#hardware_filter_option').show();
		 $('#hardware_filter_option').visExecution('load_operations', {'vis_module':'cmdb', 'vis_operation':'get_ci_type_option','vis_config_id':''+vis_config_id+'','vis_module_section':'add'});
	} 
	$("#vis_department").change(function () {
		var data = { vis_module:"<?=$operation['vis_module'];?>", vis_operation:"get_filterdata_list", vis_department_id:this.value };
		$.ajax({
			url: 'index.php',
			data: data,
			type: "POST",
			dataType: "json",
			success: function(data) {
 				$("#staff_list").html('');
  				if(data!=-1)
 					$("#staff_list").html(data.staff_list);
 			},
			error: function(xhr, ajaxOptions, thrownError) {$("#vis_global_msg_div").visInterface("load_global_message", "Error: "+xhr.status+" - "+thrownError);}
		});
	});
</script>
 
