<?  global $vis_language;?>
<section id="breadcrumb" class="row m-b m-l-none m-r-none">
	<div class="col-sm-4" id="url_header">
	  <h3 class="m-b-xs text-black"><? echo $vis_language['TXTUSERLIKE']; ?></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 class="active"><? echo $vis_language['TXTUSERLIKE']; ?></li>
		 </ul>
	  </div>
	</div>
    <div class="col-sm-8 text-right text-left-xs m-t-lg">
		 <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.'livechat_search.php'); // filter list?>
</div>
<div class="col-lg-12">
   <form name="vis_<?php echo $operation['vis_operation']; ?>_form" id="vis_<?php echo $operation['vis_operation']; ?>_form">
   <input type="hidden" name="vis_current_operation" value="<?php echo $operation['vis_current_operation']; ?>" />
	  <section class="panel panel-default">
         <div class="row wrapper clr">
           	<div  class="col-sm-12 pull-right text-center-xs">
             <!--<div class="pull-right" id="paging">
                 <select name="page_no" id="page_no" class="form-control input-sm selectpicker pull-right paging v-middle" onchange="vis_change_livechat_page(this);">
				   <?php if($chat_object->pages>1){
							 for($p=0;$p<$chat_object->pages;$p++){
								$page_no = $p+1;
								 if($page == $page_no)
								    $chk = 'selected="selected"';
								 else
								    $chk  = '';
							 	echo '<option '.$chk.' value="'.$page_no.'">'.$page_no.'</option>';
							 }
						 }else{
							 echo '<option>1</option>';
						 }?>
                  </select>
                   <div class="text-muted pull-right label_page"><? echo $vis_language['TXTPAGE'];?>:</div>
              </div>-->
                <div class="col-lg-3 m-l-n" id="live_domain">
                 <div class="col-sm-2 text-muted label_page"><?= $vis_language['TXTDOMAIN'];?>:</div>
                 <div class="col-sm-6">
                      <select class='form-control selectpicker' name="vis_domain" id="vis_domain" onchange="vis_change_livechat(this)" <? if(count($department) > 10) echo 'data-live-search="true"' ?>>
                          <? for($i=0;$i<count($department);$i++){
								 if($vis_domain == $department[$i]['domain_id'])
								    $chk = 'selected="selected"';
								 else
								    $chk = '';

								 for($l=0;$l<count($livechat_setting);$l++){
									if($livechat_setting[$l]['domain_id'] == $department[$i]['domain_id'] && $livechat_setting[$l]['is_enabled']==1){
									 	echo '<option '.$chk.' value="'.$department[$i]['domain_id'].'">'.$department[$i]['domain_name'].'</option>';
									}
								 }
							 }?>
                      </select>
                  </div>
                </div>
              </div>
         </div>
         <div class="table-responsive scroll-x" id="vis_livechat_list">
              <? include_once(VIS_PATH_TEMPLATE.'ajax_userlike.php');?>
         </div>
      </section>
   </form>

</div>

<script>
	function vis_change_livechat(e){
        if(e.value==0) $("#vis_livechat_list").hide();
        else $('#vis_livechat_list').visExecution('load_area', {'vis_module':'chat', 'vis_operation':'userlike_list','vis_domain':e.value});
    }
  	function hide_domain()
	{
		$('#live_domain').toggle();
	}
	$('.from_date').datetimepicker({
                    format: "YYYY-MM-DD"
                });
	$('.to_date').datetimepicker({
                    format: "YYYY-MM-DD"
                });
	function vis_livechat_filter()
	{
		$('#url_header').html('<h3 class="m-b-xs text-black"><? echo $vis_language['TXTFILTERS']; ?></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="#/chat/userlike_list/<? echo $vis_language['TXTUSERLIKE'];?>/1"><? echo $vis_language['TXTUSERLIKE'];?></a></li><li class="active"><? echo $vis_language['TXTFILTERRESULT']; ?></li></ul></div>').show();

	    var date_from = $.trim($('#from_date').val());
		var date_to = $.trim($('#to_date').val());
		var vis_domain = $.trim($('#vis_domain').val());
		//alert(date_from+'>'+date_to+'>'+field_search);
        $('#vis_livechat_list').visExecution('load_area', {'vis_module':'chat', 'vis_operation':'userlike_list','vis_date_from':date_from,'vis_date_to':date_to,'vis_domain':vis_domain,'vis_filter_enable':1});

	}
</script>
