您的位置:首页 > 运维架构

ECSHOP 广告添加搜索功能

2015-07-21 15:34 453 查看
第一步:新建ad_name.htm文件

<div class="form-div">
<form action="javascript:search_suppliers()" name="searchForm">
<img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />

广告列表 <input type="text" name="ad_name" size="15" />
<input type="submit" value="{$lang.button_search}" class="button" />
</form>
</div>

<script language="JavaScript">
function search_suppliers()
{
listTable.filter['ad_name'] = Utils.trim(document.forms['searchForm'].elements['ad_name'].value);

listTable.filter['page'] = 1;
listTable.loadList();
}
</script>


第二步:ads_list.htm 引入文件

{include file="ad_name.htm"}

第三步:
获得总记录数据

上面加入

$filter['ad_name'] = $_REQUEST['ad_name'];
if($filter['ad_name'])
{

$ad_name = $filter['ad_name'];
$where .= " and ad_name like '%$ad_name%'";
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: