<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$language.lblAdmin}: {$language.lblCatalogSearchTerms}</title>
{include file='CommonStyles.tpl'}
{include file='CommonJavaScript.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/grid_listing.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/right-menu.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/colorbox.css" />
{include file='CommonCustomStyles.tpl'}
<link href="{$view_styles}/jquery-ui-1.8.19.custom.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/ui.daterangepicker.css" />
</head>
<body>
<div class="outer_container"> {include file='CommonTop.tpl'} 
  <!--End:Header Container--> 
   <!--End:Header Container--> 
  <!--***********************************END HEADER ONTAINER********************************-->
  <div class="content_container clearfix">
      <div class="content_wrapper">{html->anchor priv_href="catalogsearch/new/" href="catalogsearch/new/" caption="<span class='add' ></span><strong>{$language.lblAddNewSearchTerm}</strong>" class="custom-btnt fixing_right"}
        <h2>{$language.lblCatalogSearchTerms}</h2>
        <div id="common_message"></div>
        <!--End: Right Block--> 
        
        
        {form->start name="formSearchTermsSearch" action="" method="post" enctype="multipart/form-data"}
        <div class="search_container">
          <div class="inner wide-box">
            <ul class="clearfix">
            	<li class="column">
                	<p class="label-field01">{$language.lblSearchTerm}</p>
                    <span class="form-field01">
						 {form->textbox name="queryTextSearch" class="text-box"}	                 
					</span>
                </li>
				
				<li class="column">
                	<p class="label-field01">{$language.lblCategories}</p>
                    <span class="form-field01">
						 {form->select name="categoryID" options="{$productCategories}" caption="->{$language.lblSelect}" class="select-box"}	                 
					</span>
                </li>
               <li class="column">
                	<p class="label-field01">{$language.lblSynonymFor}</p>
                    <span class="form-field01">
						 {form->textbox name="synonymForSearch" class="text-box"}	                 
					</span>
                </li>

				<li class="column" style="width:12%">
                	<p class="label-field01">{$language.lblResults} >= </p>
                    <span class="form-field01">
						 {form->textbox name="numResultsSearch" class="text-box"}	                 
					</span>
                </li>
				
				<li class="column" style="width:12%">
                	<p class="label-field01">{$language.lblNumberOfUsers} >= </p>
                    <span class="form-field01">
						 {form->textbox name="popularitySearch" class="text-box"}	                 
					</span>
                </li>
				<li class="column" >
                	<p class="label-field01">{$language.lblSearchDate} </p>
                    <span class="form-field01">
						 {form->textbox name="searchDate" readonly="readonly" class="date-field class_datepicker"}	                 
					</span>
                </li>
				<li class="column" style="width:10%">
                	<p class="label-field01">{$language.lblStatus}</p>
                    <span class="form-field01">
						 {form->select 
							class="select-box " 
							name="queryStatusSearch" options="->{$language.lblSelect}~*A->{$language.lblActive}~*I->{$language.lblInactive}"}  
					</span>
                </li>
                <li class="column"><p class="label-field01">&nbsp;</p>
                	{form->submit 
						name="submitSearch" 
						value="{$language.lblSearch}" 
						class="button01 margin-r-10"} 
					
					{html->anchor 
						href="/catalogsearch/index/" 
						class="action-link" 
						caption="{$language.lblListAll}" 
						tabindex="8"}
				</li>
               </ul>
          </div>
        </div>
        {if $resBusiness|default:''} 
        	{include file='ContentLanguageOptions.tpl'}
            {form->submit name="exportBusiness" id="exportBusiness" class="txt-link fixing_right" style="margin: 5px;" value="{$language.lblExport}"}
            <div class="clear"></div>
        {/if}
        {form->close}
       
        <!--END:sEARCH cONTAINER--> 
		
		{include file='ContentLanguageOptions.tpl'}<div class="clear"></div>
        
        {if $listSeachTerms|@count>0}
        
        <div class="grid_table00"> {form->start name="formSearchTerms" action="" method="post" enctype="multipart/form-data"}
          <table width="100%" border="0" cellspacing="0" cellpadding="0" >
            <thead>
              <tr>
			{if $editPrivilage || $deletePrivilage}
                <th align="left" valign="top"  class="checkbox_column" width="30"> <div class="chekingdiv">
                    <ul>
                      <li> {form->checkbox id="ListStatusLinkCheckbox"  class="fixing_left" tabindex="1"}
                        {html->anchor href="" id="ListStatusLink" class="status-arw fixing_left"}
                        <ul id="ListStatusSelection" class="check_status">
                          <li> {html->anchor href="" rel="ListActive" content="{$language.lblActive}"}</li>
                          <li> {html->anchor href="" rel="ListInactive"  content="{$language.lblInactive}"}</li>
                          <li> {html->anchor href="" rel="ListAll"  content="{$language.lblSelectAll}"}</li>
                        </ul>
                      </li>
                    </ul>
                  </div></th>
				{/if}  
               <th align="left" valign="top"  width="20%"  class="sort{if $sortby=='query'}{$orderby}{/if}">
					{html->anchor 
						href="{$link}sortby/query/orderby/$orderby/" 
						title="{$language.lblSearchTerm}" 	
						content="{$language.lblSearchTerm}"}
                </th> 
				<th align="left" valign="top"  class="sort{if $sortby=='category'}{$orderby}{/if}">
					{html->anchor 
						href="{$link}sortby/category/orderby/$orderby/" 
						title="{$language.lblCategories}" 	
						content="{$language.lblCategories}"}
                </th>
                <th align="left" valign="top" width=""  class="sort{if $sortby=='result'}{$orderby}{/if}">
					{html->anchor 
						href="{$link}sortby/result/orderby/$orderby/" 
						title="{$language.lblResults}" 	
						content="{$language.lblResults}"}
				</th>
                <th align="left" valign="top" width=""  class="sort{if $sortby=='users'}{$orderby}{/if}">
					{html->anchor 
						href="{$link}sortby/users/orderby/$orderby/" 
						title="{$language.lblPopular}" 	
						content="{$language.lblPopular}"}
				</th>
                <th align="left" valign="top"  class="sort{if $sortby=='synonym'}{$orderby}{/if}">
					{html->anchor 
						href="{$link}sortby/synonym/orderby/$orderby/" 
						title="{$language.lblSynonymFor}" 	
						content="{$language.lblSynonymFor}"}
				</th>
                <th align="left" valign="top"   class="sort{if $sortby=='redirect'}{$orderby}{/if}">
					{html->anchor 
						href="{$link}sortby/redirect/orderby/$orderby/" 
						title="{$language.lblRedirect}" 	
						content="{$language.lblRedirect}"}
				</th>
                <th align="left" valign="top"   class="sort{if $sortby=='related'}{$orderby}{/if}">
					{html->anchor 
						href="{$link}sortby/related/orderby/$orderby/" 
						title="{$language.lblRelatedSearchTerm}" 	
						content="{$language.lblRelatedSearchTerm}"}
				</th>
                <th align="left" valign="top" class="sort{if $sortby=='terms'}{$orderby}{/if}">
					{html->anchor 
						href="{$link}sortby/terms/orderby/$orderby/" 
						title="{$language.lblDisplaySuggestedTerms}" 	
						content="{$language.lblDisplaySuggestedTerms}"}
				</th>
                <th align="left" valign="top"   class="sort{if $sortby=='status'}{$orderby}{/if}">
					{html->anchor 
						href="{$link}sortby/status/orderby/$orderby/" 
						title="{$language.lblStatus}" 	
						content="{$language.lblStatus}"}
				</th>
				<th align="left" valign="top"   class="sort{if $sortby=='updated'}{$orderby}{/if}">
					{html->anchor 
						href="{$link}sortby/updated/orderby/$orderby/" 
						title="{$language.lblLastUpdate}" 	
						content="{$language.lblLastUpdate}"}
				</th>
				{if $editPrivilage || $deletePrivilage || $globalTagPrivilage}
                <th align="left" valign="middle"  width="60"> </th>
				{/if}
              </tr>
            </thead>
            <tbody>
            
            {foreach from=$listSeachTerms item="listSeachTerm" key="key"}
				{assign var="queryID" value=$listSeachTerm.queryID}
				{if $listSeachTerm.queryStatus=='A'}
					{assign var="statusClass" value="Active"}
					{assign var="queryStatus" value=$language.lblActive}
				{else}
					{assign var="statusClass" value="Inactive"}
					{assign var="queryStatus" value=$language.lblInactive}
				{/if}				
            <tr> 
				{if $editPrivilage || $deletePrivilage}
				<td align="left" valign="top" class="checkbox_column"> 				
					{form->checkbox 
						name="checkSearchTermIDs[]" 
						class="check" 
						class="checkbox01 ListAll List"|cat:$statusClass
						value=$queryID}
				</td>
				{/if}
				<td align="left" valign="top" class="queryText">
					{$listSeachTerm.queryText}
				</td>
				<td align="left" valign="top">
					{if $listSeachTerm.productCategoryName!=''} 
						{$listSeachTerm.productCategoryName} 
					{else}
						{$language.lblAll}
					{/if}
				</td>
				<td align="left" valign="top">
					{$listSeachTerm.numResults}
				</td>
				<td align="left" valign="top"> 
					{$listSeachTerm.popularity}
				</td>
				<td align="left" valign="top">
					{$listSeachTerm.synonymFor}
				</td>
                <td align="left" valign="top">
					{$listSeachTerm.redirect}
				</td>
				<td align="left" valign="top">
					{$listSeachTerm.relatedSearchTerm}
				</td>
				<td align="left" valign="top">
					{if $listSeachTerm.displayInTerms=='Y'}
						{assign var="displayInTerms" value=$language.lblYes}
					{else}
						{assign var="displayInTerms" value=$language.lblNo}
					{/if}		
					{$displayInTerms}
				</td>
				<td align="left" valign="top">
					{$queryStatus}
				</td>
				<td align="left" valign="top">
					{$listSeachTerm.updatedAt|date_format:$date_format} 
					{$listSeachTerm.updatedAt|date_format:$time_format}
				</td>
				{if $editPrivilage || $deletePrivilage || $globalTagPrivilage}
				<td align="left" valign="top">
						
				{if $listSeachTerm.addTag == 1}				
				<div class="fixing_right pos-relative">
					<ul><li> 
					{if $globalTagPrivilage}
					{html->anchor href="" class="langDropdownStart add-section icon-set " queryid={$listSeachTerm.queryID} title="{$language.lblAddAsGlobalCatalogTag}"}
					{/if}
					<ul id="ListStatusSelection2" class="ListLangSelection_{$listSeachTerm.queryID} check_lang right-pos" >
                    {if $resLanguages|@count gt 1}
						<li > {html->anchor href="" rel="ListAll2" class="checkall" content="{$language.lblSelectAll}"}</li>
						{/if}
						{foreach from=$resLanguages item="reslang" key="key"}
                          <li> 
							{form->checkbox id="lang_{$reslang.languageID}"  class="ListAll2" value="{$reslang.languageID}"}
							{$reslang.languageName}
						  </li>
                        {/foreach}
						{if $globalTagPrivilage}
						<li class="textto_center br-tp"> {html->anchor class="addAsTag" caption="{$language.lblAddAsGlobalCatalogTag}"}</li>
						{/if}
                   </ul>
				   </li> </ul>
			   </div>
					{/if}	
					{if $editPrivilage}
					{html->anchor 
						href="catalogsearch/edit/id/$queryID/"
						class="edit03 icon-set"  
						title="Edit" 
						caption="" 
						history="yes"}
					{/if}
					{if $deletePrivilage}
					{html->anchor 
						confirm="{$language.msgDeleteSearchTerm}"  
						href="catalogsearch/destroy/id/$queryID/" 
						alt=$language.lblDelete
						class="delete05 icon-set"
						confirm_head=$language.lblDelete}
					{/if}	
				</td>
				{/if}
            </tr>
            {/foreach}
            </tbody>
            
          </table>
        </div>
        <div class="fixing_right pagination_outer"> 
			{paginate->layout  
				key="page" 
				label_record="{$language.lblRecorsFound}" 
				label_pages="{$language.lblPages}"} 
          <!--end: Pagination-->
          <div class="clear"></div>
        </div>
        {if $editPrivilage || $deletePrivilage} 
			{assign var="bulkStatusOptions" value="->{$language.lblDonotchange}"}
			{if $editPrivilage}
				{assign var="bulkStatusOptions" value="{$bulkStatusOptions}~*A->{$language.lblActivate}~*I->{$language.lblInactivate}"}
			{/if}
			{if $deletePrivilage}
				{assign var="bulkStatusOptions" value="{$bulkStatusOptions}~*D->{$language.lblDelete}"}
			{/if}
			<div class="action_box"> 
				{form->select 
					id="businessStatusList"  
					class="select-box width-auto" 
					name="changeStatus" options=$bulkStatusOptions}  
				{form->submit 
					name="submitBusiness" 
					class="update_btn_table button04" 
					value="{$language.lblUpdate}"} 
			</div>
        {/if}
        <div class="clear"></div>
        {form->close}
        {else}
        <div  class="message_info">{$language.msgNoRecords}</div>
        {/if} </div>
    
  </div>
  <!--End:Content Container--> 
  {include file='CommonBottom.tpl'} </div>
<!--End:Outer Container--> 
{include file='CommonJavaScriptBottom.tpl'}
{form->rootpath_script}
{form->basepath_script} 
<script type="text/javascript" src="{$view_javascript}/table.plugin.js"></script> 
<script type="text/javascript" src="{$view_javascript}/catalogtags.page.js"></script> 
<script type="text/javascript" src="{$common_js}/date.js"></script>
<script type="text/javascript" src="{$view_javascript}/daterangepicker.jQuery.js"></script> 
{html->messages_script id="common_message"}
<script type="text/javascript">
 var errTagNameExts="{$language.errTagNameAlreadyExists}";
 var msgSelectSearchCriteria="{$language.msgSelectSearchCriteria}";
 var tagNameAdded = "{$language.msgTagNameAdded}";
 var msgBusinessDelConfirmation = "{$language.msgDeleteSearchTerm}";
 var lblSelectAction = "{$language.lblSelectAction}";
 var msgSelectItem = "{$language.msgSelectItem}";
 $(document).ready(function(){
	$('#searchDate').daterangepicker({ arrows: false });
	$(".update_btn_table").click(function () {
		var ListAllCheckedCount = $(".ListAll:checked").size();
		var businessStatus = $('#businessStatusList').val();
		if ($(".ListAll:checked").size() == 0) {
			jAlert(msgSelectItem);
			return false;
		} else if (businessStatus == "") {
			jAlert(lblSelectAction);
			return false;
		}
		if (businessStatus == 'D') {
			jConfirm(msgBusinessDelConfirmation, 'Alert', function (r) {
				if (r == true) {
					$('#formSearchTerms').submit();
				}
			});
		} else {
			return true;
		}
		return false;
	});
 
 })
 </script>
</body>
</html>