<?
   global $vis_language;
   $paging_list='';
   for($i=0;$i<$view_info['page_count'];$i++) $paging_list.='<option value="'.$i.'" '.(($impact_info['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 $vis_language['TXTMAGENTO']; ?></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']; ?>"><? 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 $vis_language['TXTMAGENTO']; ?></li>
      </ul>
   </div>
</section>
<div class="col-lg-12">
	<div class="wrapper bg-white b-t" id="vis_filter_list">
		<form id="vis_gotomeeting_search_form" name="vis_gotomeeting_search_form" method="post">
		<label class="control-label"><b><? //= $vis_language['TXTFILTERLIST']; ?></b></label>
		<div class="row">
			<div class="m-t m-b">
				<div class="form-group">
					<label class="col-sm-1 control-label m-t-xs"><?= $vis_language['TXTDOMAIN'];?></label>
					<div class="col-sm-2">
						<select class='form-control selectpicker' name="vis_domain" id="vis_domain">
						    <? if(count($department)>0 && count($magento_details)>0){
								foreach($department as $dept){
									foreach($magento_details as $magento_dept){
										if($magento_dept['domain_id']==$dept['domain_id']){
											echo '<option value="'.$dept['domain_id'].'">'.$dept['domain_name'].'</option>'; 
										}
									}
								}
							}?>
						</select>
					</div>
				</div>						
				<div class="form-group">
					<label class="col-sm-1 control-label m-t-xs"><?=$vis_language['TXTSEARCHBY'];?></label>
					<div class="col-sm-2">
						<select class='form-control selectpicker' name="vis_search_by" id="vis_search_by">
							<option value="email"><?php echo $vis_language['TXTEMAIL']; ?></option>
							<option value="name"><?php echo $vis_language['TXTNAME']; ?></option>	
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-1 control-label m-t-xs"><?= $vis_language['TXTSEARCHSTRING'];?></label>
					<div class="col-sm-4">
					 <span class="input-group-addon no-padder no-borders">
						<input id="vis_search_string" name="vis_search_string" class="form-control input-sm" type="text" >
					</span>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="m-t m-b">
				<div class="form-group">
					<div class="col-sm-12">
					  <button type="button" id="btn_apply_filter" class="btn btn-primary pull-right" onclick="vis_search_magento();"><?= $vis_language['TXTSEARCH'];?></button>
					  <button type="button" class="btn btn-default pull-right m-r-sm" onclick="$('#vis_gotomeeting_search_form').trigger('reset');$('.selectpicker').selectpicker('refresh');"><?= $vis_language['TXTCLEAR'];?></button>
					</div>
				</div>
			</div>
		</div>
		</form>
	</div>

</div>
<div class="col-lg-12" id="magento_search_result"></div>
<script>
function vis_search_magento(){
	var data = {'vis_action': $("#vis_filter_list input, #vis_filter_list select").serialize() };
    $.ajax({
		url: 'index.php?vis_module=client&vis_operation=get_magento_client',
		data: data,
		type: "POST",
		dataType: "json",
		success: function(data) {
			if(data.status== 'error')$("#vis_global_msg_div").visInterface("load_global_message", data.msg);
			if(data.status== 'success')$("#magento_search_result").html(data.list);
		},
		error: function(xhr, ajaxOptions, thrownError) {$("#vis_global_msg_div").visInterface("load_global_message", "Error: "+xhr.status+" - "+thrownError);}
	});

}
</script>