亚洲免费乱码视频,日韩 欧美 国产 动漫 一区,97在线观看免费视频播国产,中文字幕亚洲图片

      1. <legend id="ppnor"></legend>

      2. 
        
        <sup id="ppnor"><input id="ppnor"></input></sup>
        <s id="ppnor"></s>

        phpcms v9教程 聯(lián)動搜索在房地產(chǎn)網(wǎng)站開發(fā)中的應(yīng)用

        字號:


            開發(fā)簡述:使用phpcms v9系統(tǒng),修改源文件5個,創(chuàng)建模型:樓盤、出售、出租、中介、小區(qū),增加聯(lián)動菜單:樓盤,增加用戶組:房產(chǎn)中介。
            實(shí)現(xiàn)功能:
            游客發(fā)布信息、會員申請中介、樓盤全方位展示、報名團(tuán)購、看房功能,發(fā)布信息時可根據(jù)登陸后的會員資料自動填好聯(lián)系信息,中介有自己的店鋪,可給中介留言,聯(lián)動篩選搜索、排序,房源對比功能。
            聯(lián)動篩選搜索功能的實(shí)現(xiàn)方法及代碼:
            要修改的文件就是list.html模板
            核心代碼:
            <?php
            $theurl = app_path.index.php?m=content&c=index&a=lists&catid=$catid;
            $where = status=99;
            $orderby = ;
            foreach ($_get as $field => $r) {
            if($r) {
            if(!in_array($field,array('m','c','a','page'))){
            if(strrpos($field,'_')){
            $arr=explode(-,$r);
            $field = str_replace('_','',$field);
            $where .= and $field >= '$arr[0]' and $field <= '$arr[1]';
            }else if($field == 'title'){
            $where .= and $field like .'%.$r.%';
            }else if($field == 'orderby'){
            $orderby = str_replace('_',' ',$r);
            }else{
            $where .= and $field='$r';
            }
            }
            }
            }
            //if($where)$where = substr($where,5);
            if(!$orderby)$orderby = id desc;
            ?>
            用這段代碼來構(gòu)造查詢條件和排序方式,有了這段代碼之后,要把list.htm獲得列表的pc語句改造成這樣
            原來的
            {pc:content action=lists catid=$catid num=25 order=id desc page=$page}
            改造后的
            {pc:content action=lists where=$where catid=$catid num=25 order=$orderby page=$page}
            使用的時候就比較麻煩了
            <p><span>狀態(tài):</span><span><a href='{url_par(price_=$_get[price_]&hstatus=& typeid=$_get[typeid]&address=$_get[address],$theurl)}'>全部</a& amp; gt;</span>
            <span {if $_get[hstatus] == 1}class='shaixuan'{/if}><a href='{url_par(price_=$_get[price_]&hstatus=1& typeid=$_get[typeid]&address=$_get[address],$theurl)}'>新盤</a& amp; gt;</span>
            <span {if $_get[hstatus] == 2}class='shaixuan'{/if}><a href='{url_par(price_=$_get[price_]&hstatus=2& typeid=$_get[typeid]&address=$_get[address],$theurl)}'>在售</a& amp; gt;</span>
            <span {if $_get[hstatus] == 3}class='shaixuan'{/if}><a href='{url_par(price_=$_get[price_]&hstatus=3& typeid=$_get[typeid]&address=$_get[address],$theurl)}'>尾盤</a& amp; gt;</span>
            <span {if $_get[hstatus] == 4}class='shaixuan'{/if}><a href='{url_par(price_=$_get[price_]&hstatus=4& typeid=$_get[typeid]&address=$_get[address],$theurl)}'>售完</a& amp; gt;</span></p>
            <p><span>均價:</span><span><a href='{url_par(price_=&hstatus=$_get[hstatus]& typeid=$_get[typeid]&address=$_get[address],$theurl)}'>全部</a& amp; gt;</span>
            <span {if $_get[price_] == '0-4000'}class='shaixuan'{/if}><a href='{url_par(price_=0-4000&hstatus=$_get[hstatus]& typeid=$_get[typeid]&address=$_get[address],$theurl)}'>4000以下& amp; lt;/a></span>
            <span {if $_get[price_] == '4000-5000'}class='shaixuan'{/if}><a href='{url_par(price_=4000-5000&typeid=$_get[typeid]&hstatus=$_get[hstatus]&address=$_get[address],$theurl)}'>4000-5000</a></span>
            <span {if $_get[price_] == '5000-6000'}class='shaixuan'{/if}><a href='{url_par(price_=5000-6000&hstatus=$_get[hstatus]&typeid=$_get[typeid]&address=$_get[address],$theurl)}'>5000-6000</a></span>
            <span {if $_get[price_] == '6000-7000'}class='shaixuan'{/if}><a href='{url_par(price_=6000-7000&hstatus=$_get[hstatus]&typeid=$_get[typeid]&address=$_get[address],$theurl)}'>6000-7000</a></span>
            <span {if $_get[price_] == '7000-8000'}class='shaixuan'{/if}><a href='{url_par(price_=7000-8000&hstatus=$_get[hstatus]&typeid=$_get[typeid]&address=$_get[address],$theurl)}'>7000-8000</a></span>
            <span {if $_get[price_] == '8000-9000'}class='shaixuan'{/if}><a href='{url_par(price_=8000-9000&hstatus=$_get[hstatus]&typeid=$_get[typeid]&address=$_get[address],$theurl)}'>8000-9000</a></span>
            <span {if $_get[price_] == '9000-10000'}class='shaixuan'{/if}><a href='{url_par(price_=9000-10000&hstatus=$_get[hstatus]&typeid=$_get[typeid]&address=$_get[address],$theurl)}'>9000-10000</a></span>
            <span {if $_get[price_] == '10000-100000'}class='shaixuan'{/if}><a href='{url_par(price_=10000-100000&hstatus=$_get[hstatus]& typeid=$_get[typeid]&address=$_get[address],$theurl)}'>10000以上& amp; lt;/a></span>
            </p>
            <p><span>類型:</span><span><a href={url_par(price_=$_get[price_]&hstatus=$_get[hstatus]& typeid=&address=$_get[address],$theurl)}>全部</a></span& amp; gt;
            {pc:get sql=select * from `v9house_type` where `module`='content'}
            {loop $data $key $val}
            <span {if $_get[typeid] == $val[typeid]}class='shaixuan'{/if}><a href={url_par(price_=$_get[price_]&hstatus=$_get[hstatus]&typeid=$val[typeid]&address=$_get[address],$theurl)}>{$val[name]}</a></span>
            {/loop}
            {/pc}</p>
            <p><span>地區(qū):</span>
            <span><a href={url_par(price_=$_get[price_]&hstatus=$_get[hstatus]& typeid=$_get[typeid]&address=,$theurl)}>全部</a></span& amp; gt;
            {pc:get sql=select linkageid,name from `v9house_linkage` where parentid=(select linkageid from `v9house_linkage` where name='淄博市')}
            {loop $data $key $val}
            <span {if $_get[address] == $val[linkageid]}class='shaixuan'{/if}> <a href={url_par(price_=$_get[price_]&hstatus=$_get[hstatus]&typeid=$_get[typeid]&address=$val[linkageid],$theurl)}>{$val[name]}</a></span>
            {/loop}
            {/pc}</p>
            沒辦法,要想聯(lián)動,就得每次都傳遞出所有需要聯(lián)動的參數(shù),所以url的參數(shù)部分就很多,容易暈掉~
            獲取搜索結(jié)果的代碼是
            共返回 {php echo count($data);} 個結(jié)果
            放在
            {pc:content action=lists where=$where catid=$catid num=25 order=$orderby page=$page}
            下面
            loop
            的上面
            共返回 {php echo count($data);} 個結(jié)果
            排序的參數(shù)也很麻煩
            <a href='{url_par(price_=$_get[price_]&area_=$_get[area_]& shi=$_get[shi]&typeid=$_get[typeid]&address=$_get[address]& orderby=area_desc,$theurl)}'>面積</a>
            基本就這樣了,希望有人能看懂
            搜索表單也可以直接用在這里
            給個例子
            <form name=myform1 method=get action=>
            <input type=hidden name=m value=content>
            <input type=hidden name=c value=index>
            <input type=hidden name=a value=lists>
            <span><select name=catid>
            <option value=6>出售</option>
            <option value=12>求購</option>
            </select></span>
            <span><select name=area_>
            <option value=>面積不限</option>
            <option value=0-50>小于50</option>
            <option value=50-80>50到80</option>
            <option value=80-120>80到120</option>
            <option value=120-200>120到200</option>
            <option value=200-10000>大于200</option>
            </select></span>
            <span><select name=shi>
            <option value=>所有戶型</option>
            <option value=1>1室</option>
            <option value=2>2室</option>
            <option value=3>3室</option>
            </select></span>
            <span><input name=title type=text class=text4 style=width:60px; /></span>
            <span><input type=submit value= class=text3 /></span></form>