查看文件: market_street.php
大小: 9.98 KB
类型: application/octet-stream
<? //$menu=isset($_GET['menu'])?$_GET['menu']:'台北市-中正區-八德路1段-單號側'; //$scity=explode("-",$menu); //$county=$scity[0]; //if (count($scity)<>4) { exit;} ?> <?php require_once('Connections/BE2.php'); ?> <?php function wf_to_nf($strs ){ //全形半形轉換 $wft = array( '一段', '二段', '三段', '四段', '五段', '六段', '七段', '八段', '九段','双號','台','县'); $nft = array( "1段", "2段", "3段", "4段", "5段", "6段", "7段", "8段", "9段","雙號","臺",'縣'); return str_replace($wft,$nft,$strs); //半形到全形 } // address_id,img_id,county,county2,district,street // select * from address where county='嘉義縣' $keyarr=array("0","county","county2","district","street"); $keycity=isset($_GET['keycity'])?$_GET['keycity']:'-1'; $keyword=isset($_GET['keyword'])?$_GET['keyword']:'-1'; //台北市 松山區 南京東路3段 $keyside=isset($_GET['keyside'])?$_GET['keyside']:'1'; $skey=explode("-",$keyword); if(count($skey)<>4){ $skey1=$keyword; $skey=explode("-",$skey1); } $keyside=($keyside=='1')?'1':'0'; //$skey[3]= //$query_Rt2 =sprintf("SELECT a.* FROM product_data as a,company as b WHERE a.company_num=b.mid AND b.company_name='%s' ",$menu1); //南京東路三段 ;//雙號側 http://www.skybnimap.com/streetmap-144.html?mark=mark5_1 //SELECT * FROM address WHERE county='台北市' and street='八德路1段' //county2 $arrcity=array("臺北市","基隆市","新北市","連江縣","宜蘭縣","釣魚臺","新竹市","新竹縣","桃園市","苗栗縣","臺中市","彰化縣" ,"南投縣","嘉義市","嘉義縣","雲林縣","臺南市","高雄市","南海島","澎湖縣","金門縣","屏東縣","臺東縣","花蓮縣"); $skey[0]=''; $skey[1]=''; $skey[2]=''; $skey[3]=''; $keyword= "a".wf_to_nf($keyword); for($c=0;$c<count($arrcity);$c++){ // echo strpos($keyword,$arrcity[$c])."|||".$c."<br>"; if(mb_strpos($keyword,$arrcity[$c],0)){ $skey[0]=$arrcity[$c]; break; } } if( $skey[0]<>''){ mysql_select_db($database_BE2, $BE2); $query_Rt3 =sprintf("SELECT distinct(street) FROM address WHERE county2='%s' ",$skey[0]); $Rt3 = mysql_query($query_Rt3, $BE2) or die(mysql_error()); $row_Rt3 = mysql_fetch_assoc($Rt3); $totalRows_Rt3 = mysql_num_rows($Rt3); do { if(mb_strpos($keyword,$row_Rt3['street'])){ $skey[2]=$row_Rt3['street']; break; } } while ($row_Rt3 = mysql_fetch_assoc($Rt3)); mysql_free_result($Rt3); }else{ //$arroad=array('段','街','路'); mysql_select_db($database_BE2, $BE2); $query_Rt3 ="SELECT county2,street FROM address WHERE 1 "; $Rt3 = mysql_query($query_Rt3, $BE2) or die(mysql_error()); $row_Rt3 = mysql_fetch_assoc($Rt3); $totalRows_Rt3 = mysql_num_rows($Rt3); do { if(mb_strpos($keyword,$row_Rt3['street'])){ $skey[2]=$row_Rt3['street']; $skey[0]=$row_Rt3['county2']; break; } } while ($row_Rt3 = mysql_fetch_assoc($Rt3)); mysql_free_result($Rt3); } if($skey[0]<>'' && $skey[2]<>''){ if(mb_strpos($keyword,'雙號')){ $keyside=0; $skey[3]='雙號'; }else{ $keyside=1; $skey[3]='單號'; } $sql=sprintf( "a.county2='%s' AND a.street='%s'", $skey[0],$skey[2]); } $sql=sprintf( "a.county2='%s' AND a.street='%s'", $skey[0],$skey[2]); mysql_select_db($database_BE2, $BE2); $query_Rt2 =sprintf("SELECT a.county as ac1,a.street as ast1, b.* FROM address as a ,shop5 as b WHERE a.address_id=b.address_id AND b.si11='' AND b.sicf='Y' AND b.si13>0 AND %s order by b.si13 ",$sql); $Rt2 = mysql_query($query_Rt2, $BE2) or die(mysql_error()); $row_Rt2 = mysql_fetch_assoc($Rt2); $totalRows_Rt2 = mysql_num_rows($Rt2); //台北市-中正區-三元街-雙號網店商城 $addr=$skey[0].$skey[2] ; $addr .= ($keyside==1)?'單號':'雙號'; $address_id=$row_Rt2['address_id']; // if ( $_SERVER['REMOTE_ADDR']=='220.130.43.118'){ // echo $query_Rt2."<br>" ; // } $minid=$row_Rt2['si13']; $maxid=$row_Rt2['si13']; $arrshop=array('','統一','全家','萊爾富','來來','全聯' ); $arrshopimg=array('0','7-11.png','familymark.png','hi-life.png','okmark.png','pxmark.png' ); $arr1=array(); $arrcount=-1; // si10,1統一 2全家 3萊爾富 4來來 5全聯 if($totalRows_Rt2>0){ do { if(($row_Rt2['si13'] % 2 )== $keyside){ $arrcount++; $arr1[$arrcount][1]=$row_Rt2['si13']; //號 $arr1[$arrcount][2]=$row_Rt2['si1']; //id/ $arr1[$arrcount][3]=$row_Rt2['si5']; // 第二六八分公司 $arr1[$arrcount][4]=$row_Rt2['si6']; // 桃園市蘆竹區富國路3段1460號1樓 $arr1[$arrcount][5]=$row_Rt2['si10'];// $arrshop[$row_Rt2['si10']]; // '統一'.'全家','萊爾富','來來','全聯' $arr1[$arrcount][6]=$row_Rt2['si10b'];// LOGO comany id $arr1[$arrcount][7]=$row_Rt2['si14'];// 1樓 //$arr1[$arrcount][8]=$row_Rt2['si14'];// 1樓 $minid=min($minid,$row_Rt2['si13']); $maxid=max($maxid,$row_Rt2['si13']); } } while ($row_Rt2 = mysql_fetch_assoc($Rt2)); } /* // county mysql_select_db($database_BE2, $BE2); // address_id county district street $query_Rot2 = "SELECT distinct(county) FROM address where 1 order by county"; $Rot2 = mysql_query($query_Rot2, $BE2) or die(mysql_error()); $row_Rot2 = mysql_fetch_assoc($Rot2); $totalRows_Rot2 = mysql_num_rows($Rot2); //district $county=$row_Rot2['county']; mysql_select_db($database_BE2, $BE2); // address_id county district street $query_Rat2 = sprintf("SELECT distinct(district) FROM address where county='%s' order by district",$county); $Rat2 = mysql_query($query_Rat2, $BE2) or die(mysql_error()); $row_Rat2 = mysql_fetch_assoc($Rat2); $totalRows_Rat2 = mysql_num_rows($Rat2); $district=$row_Rat2['district']; mysql_select_db($database_BE2, $BE2); // address_id county district street $query_Rbt2 = sprintf("SELECT address_id,street FROM address where county='%s' AND district='%s' order by street",$row_Rot2['county'], $district); $Rbt2 = mysql_query($query_Rbt2, $BE2) or die(mysql_error()); $row_Rbt2 = mysql_fetch_assoc($Rbt2); $totalRows_Rbt2 = mysql_num_rows($Rbt2); $street=$row_Rbt2['street']; */ ?> <style> .clear{ clear:both} .divx{ // border: 1px solid black; width: 100%; margin-bottom: 12px; overflow-x: auto; //hidden scroll visible auto } .flex0 { display: flex; height: 25px; padding: 2px; //background-color: #61a0f8; flex-wrap: nowrap; } .flex { display: flex; height: 95px; //120 padding: 2px; //background-color: #61a0f8; flex-wrap: nowrap; } .flex1 { display: flex; height: 115px; //140 padding: 2px; //background-color: #61a0f8; flex-wrap: nowrap; } .item { flex: 0 0 75px; position:relative; margin: 2px; display: flex; justify-content: center; align-items: center; font-size: 12px; } .item0 { flex: 0 0 75px; position:relative; margin: 2px; display: flex; justify-content: center; align-items: center; font-size: 12px; } .divb{ width:100px; position:absolute; vertical-align:bottom; bottom:0; text-align:center; font-size:12px; // margin-top:-12px; } .divc{ width:90px; position:absolute; vertical-align:bottom; bottom:-10; text-align:center; font-size:12px; } </style> <div class="clear"></div> <div style=" width:100%;text-align:center"><h3><?= str_replace("臺","台", $addr); ?>網店商城</h3></div> <div class="clear"></div> <div class="divx"> <? $min1=1; $max1=1; if($keyside==1){ $min1=1; $max1=301; $minid=1;//min($min1,$minid); $maxid=max($max1,$maxid); }else{ $min1=2 ; $max1=302 ; $minid=2;//min($min1,$minid); $maxid=max($max1,$maxid); } ?> <div class="clear"></div> <? for($v=0;$v<7;$v++){?> <div class="clear"></div> <? $fcc=''; if($v==0){ $fcc='0' ;} else if($v>5){$fcc='1' ; } else if($v>5){$fcc='' ; } //($v<6)?'':1; ?> <div class="flex<?= $fcc ; ?>"> <? for($i=$minid;$i<=$maxid;$i+=2){ $mmimg=7-$v.'.png'; $f=7-$v; // v6= 1F $doc=''; $link='#'; $link_id=''; if($v>1){ //2 5F for($r=0;$r<=$arrcount;$r++){ if(($arr1[$r][1]==$i) && ($arr1[$r][7]==$f )){ if($arr1[$r][5]>0){ $mmimg=$arrshopimg[$arr1[$r][5]] ;// 7-$v.'.png'; }else{ $mmimg='c_'.$arr1[$r][6].'.png'; } $doc=$arr1[$r][3]; $link='/shop/'.$arr1[$r][3].'.html'; $link_id='id='.$arr1[$r][3]; break; } } } else{ for($r=0;$r<=$arrcount;$r++){ if(($arr1[$r][1]==$i) && ($arr1[$r][7]>5 )){ if($arr1[$r][5]>0){ $mmimg=$arrshopimg[$arr1[$r][5]] ;// 7-$v.'.png'; }else{ $mmimg='c_'.$arr1[$r][6].'.png'; } $doc=$arr1[$r][3].'('.$arr1[$r][7].'F)'; $link='/shop/'.$arr1[$r][3].'.html'; $link_id='id='.$arr1[$r][3]; break; } } } if($v>0){ $link=($link=='/shop/天空商城.html')?'/':$link; ?> <div class="item" style="border:1px;top:<?= ($v==6)?-5:0 ?>px;"><a href="<?= $link ?>" <?= $link_id ;?> target="_self"><img class="img-fluid" src="/number_jpg/<?=$mmimg ?>" title="<?= $doc ?>"></a> <? if($v==6 ){ ?> <span class="divc"> <?= '<br>'.$i.'號' ; ?> </span> <? }else{ ?> <span class="divc"> <?= ($doc<>'')?$doc:" "; ?> </span> <? } ?> </div> <? } else {?> <div class="item0" style="border:1px;"><img class="img-fluid" src="/number_jpg/0f.png"><span class="divc"><?= $i.'號' ; ?></span></div> <? }?> <? } ?> </div> <? } ?> </div> <?php mysql_free_result($Rt2); ?>
保存
取消
返回文件列表