查看文件: netmall.php
大小: 4.13 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <? $menu=isset($_GET['menu'])?$_GET['menu']:'台北市'; $scity=explode("-",$menu); $county=$scity[0]; /* mysql_select_db($database_BE2, $BE2); // address_id county district street $query_Rbct2 = "SELECT distinct(county) FROM address where 1 "; $Rbct2 = mysql_query($query_Rbct2, $BE2) or die(mysql_error()); $row_Rbct2 = mysql_fetch_assoc($Rbct2); $totalRows_Rbct2 = mysql_num_rows($Rbct2); */ $city1=array("台北市","新北市","基隆市","桃園市","新竹市","新竹縣","宜蘭縣","臺中市","苗栗縣","彰化縣","南投縣","雲林縣"); $city2=array("高雄市","臺南市","嘉義市","嘉義縣","屏東縣","花蓮縣","臺東縣","澎湖縣","金門縣","連江縣"); //=========================// /* address_id county district street */ mysql_select_db($database_BE2, $BE2); $query_Rtc = sprintf("SELECT distinct(district) FROM address WHERE county='%s'",$county); $Rtc = mysql_query($query_Rtc, $BE2) or die(mysql_error()); $row_Rtc = mysql_fetch_assoc($Rtc); $totalRows_Rtc = mysql_num_rows($Rtc); $district=$row_Rtc['district']; if (count($scity)>1) { $district=$scity[1] ;} mysql_select_db($database_BE2, $BE2); $query_Rtd = sprintf("SELECT a.address_id,a.street,b.k2 as keycity FROM address as a, addrcity as b WHERE a.county=b.county AND a.county='%s' AND a.district='%s' ",$county,$district); $Rtd = mysql_query($query_Rtd, $BE2) or die(mysql_error()); $row_Rtd = mysql_fetch_assoc($Rtd); $totalRows_Rtd = mysql_num_rows($Rtd); $title="";//$row_Rt3['company_title']; $i=0; ?> <style> #divx{ // border: 1px solid black; width: 100%; margin-bottom: 12px; overflow-x: auto; //hidden scroll visible auto } </style> <div class="container"> <div class="col-12 align-self-center"> <div style="margin-top:0px;"><br><?=$county ?>-街道網店商城</div> <div id="divx"> <table> <tr> <? for($i=0;$i<count($city1);$i++){ ?> <td nowrap="nowrap"><a href="<?=$city1[$i]?>.html" title="<?= $city1[$i]?>街道網店商城"><?= $city1[$i]?></a> </td> <? }?> </tr> </table> </div> <div> <div id="divx"> <table> <tr> <? for($i=0;$i<count($city2);$i++){ ?> <td nowrap="nowrap"><a href="<?=$city2[$i]?>.html" title="<?= $city2[$i]?>街道網店商城" ><?= $city2[$i]?></a> </td> <? }?> </tr> </table> </div> <div id="divx"> <table> <tr> <? do { ?> <td nowrap="nowrap"> <a href="/netmall/<?= $county.'-'.$row_Rtc['district']?>.html" title="<?= $county.$row_Rtc['district']?>網路商城"> <?= $row_Rtc['district'] ;?> </a></td> <? } while ($row_Rtc = mysql_fetch_assoc($Rtc)); ?> </tr> </table> </div> <? if(count($scity)>1){?> <div style="margin-top:0px;font-weight:800;width:100%;text-align:center"><h3><?=$county.$district ?>-街道網店商城</h3></div> <? do { ?> <a href="/search.html?search2=街道網店商城&keyword=<?= $county.$row_Rtd['street'].'單號網店商城' ?>" title="<?= $county.$district.$row_Rtd['street']?>單號網店商城"><?= $county.$district.$row_Rtd['street']?>單號網店商城 </a><br /> <a href="/search.html?search2=街道網店商城&keyword=<?= $county.$row_Rtd['street'].'雙號網店商城' ?>" title="<?= $county.$district.$row_Rtd['street']?>雙號網店商城"><?= $county.$district.$row_Rtd['street'] ?>雙號網店商城</a><br /> <? } while ($row_Rtd = mysql_fetch_assoc($Rtd)); ?> <? } ?> </div> </div> <script type="text/javascript"> function gotourl(){ window.location.href='/'; } function Selectstreet() { var county= "<?= $county ?>"; var district = $("#district").val(); $.ajax({ type: 'POST', url: 'SelectcityApi.php', data: { 'county': county,'district':district }, success: function (data) { var $street = $('#street'); $street.empty(); $("select#street").html(data); } }); } </script> <? mysql_free_result($Rtc); mysql_free_result($Rtd); ?>
保存
取消
返回文件列表