area2.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. include("../../config/conn.php");
  3. include("../../config/function.php");
  4. $area1id=$_GET[area1id];if(empty($area1id)){$area1id=0;}
  5. $area2id=$_GET[area2id];if(empty($area2id)){$area2id=0;}
  6. $area3id=$_GET[area3id];if(empty($area3id)){$area3id=0;}
  7. if($area1id!=""){$ses1=" and parentid='".$_GET[area1id]."'";}else{$ses1=" and id=0";}
  8. if($area2id!=""){$ses2=" and parentid='".$_GET[area2id]."'";}else{$ses2=" and id=0";}
  9. ?>
  10. <html>
  11. <head>
  12. <meta http-equiv="x-ua-compatible" content="ie=7" />
  13. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  14. <meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, user-scalable=no" />
  15. <title>选择市</title>
  16. <link href="../css/global.css" rel="stylesheet" type="text/css" />
  17. <style type="text/css">
  18. .shdzt1{font-size:14px;margin:10px 0 0 0;}
  19. .shdzt1 .d1{margin:1px 0 0 10px;width:30px;}
  20. .shdzt1 .d2{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;margin:0 0 0 0;overflow:hidden;}
  21. .shdzt1 .d2 select{background-color:#fff;border:0;width:110%;float:left;font-size:14px;}
  22. .shdzt1 .d3{margin:0 10px 0 0;width:30px;text-align:right;}
  23. .shdz{font-size:14px;margin:15px 0 0 0;}
  24. .shdz .d1{margin:1px 0 0 10px;width:30px;}
  25. .shdz .d2{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;margin:0 0 0 0;overflow:hidden;}
  26. .shdz .d2 select{background-color:#fff;border:0;width:110%;float:left;font-size:14px;}
  27. .shdz .d3{margin:0 10px 0 0;width:30px;text-align:right;}
  28. .shdzok{font-size:14px;margin:15px 0 0 0;text-align:center;color:#fff;}
  29. .shdzok .d1{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;margin:0 1px 0 0;padding:10px 0 0 0;height:30px;background-color:#ff6600;}
  30. .shdzok .d2{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;margin:0 0 0 1px;padding:10px 0 0 0;height:30px;background-color:#CCC;}
  31. </style>
  32. <script language="javascript">
  33. function area1cha(){
  34. a=(document.getElementById("area1").value).split("yjcode");
  35. location.href="area2.php?area1id="+a[0];
  36. }
  37. function area2cha(){
  38. a=(document.getElementById("area2").value).split("yjcode");
  39. location.href="area2.php?area1id=<?=$area1id?>&area2id="+a[0];
  40. }
  41. function area3cha(){
  42. a=(document.getElementById("area3").value).split("yjcode");
  43. location.href="area2.php?area1id=<?=$area1id?>&area2id=<?=$area2id?>&area3id="+a[0];
  44. }
  45. function qyok(){
  46. parent.document.getElementById("add1").value=<?=$area1id?>;
  47. parent.document.getElementById("add2").value=<?=$area2id?>;
  48. parent.document.getElementById("add3").value=<?=$area3id?>;
  49. a=(document.getElementById("area1").value).split("yjcode");
  50. b=(document.getElementById("area2").value).split("yjcode");
  51. c=(document.getElementById("area3").value).split("yjcode");
  52. qy=a[1]+b[1]+c[1];
  53. parent.document.getElementById("qyname").innerHTML=qy;
  54. qyclo();
  55. }
  56. function qyclo(){
  57. parent.layer.closeAll();
  58. }
  59. </script>
  60. </head>
  61. <body>
  62. <div class="shdzt1 box">
  63. <div class="d1">省:</div>
  64. <div class="d2">
  65. <select name="area1" id="area1" onChange="area1cha()">
  66. <option value="0">请选择</option>
  67. <? while3("*","yjcode_city where level=1 order by xh asc");while($row3=mysql_fetch_array($res3)){?>
  68. <option value="<?=$row3[bh]?>yjcode<?=$row3[name1]?>"<? if($row3[bh]==$area1id){?> selected="selected"<? }?>><?=$row3[name1]?></option>
  69. <? }?>
  70. </select>
  71. </div>
  72. <div class="d3"><img src="../img/rightjian.png" height="14" /></div>
  73. </div>
  74. <div class="shdz box">
  75. <div class="d1">市:</div>
  76. <div class="d2">
  77. <select name="area2" id="area2" onChange="area2cha()">
  78. <option value="0">请选择市</option>
  79. <? while1("*","yjcode_city where level=2".$ses1." order by xh asc");while($row1=mysql_fetch_array($res1)){?>
  80. <option value="<?=$row1[bh]?>yjcode<?=$row1[name1]?>"<? if($row1[bh]==$area2id){?> selected="selected"<? }?>><?=$row1[name1]?></option>
  81. <? }?>
  82. </select>
  83. </div>
  84. <div class="d3"><img src="../img/rightjian.png" height="14" /></div>
  85. </div>
  86. <div class="shdz box">
  87. <div class="d1">区:</div>
  88. <div class="d2">
  89. <select name="area3" id="area3" onChange="area3cha()">
  90. <option value="0">请选择区</option>
  91. <? while2("*","yjcode_city where level=3".$ses2." order by xh asc");while($row2=mysql_fetch_array($res2)){?>
  92. <option value="<?=$row2[bh]?>yjcode<?=$row2[name1]?>"<? if($row2[bh]==$area3id){?> selected="selected"<? }?>><?=$row2[name1]?></option>
  93. <? }?>
  94. </select>
  95. </div>
  96. <div class="d3"><img src="../img/rightjian.png" height="14" /></div>
  97. </div>
  98. <div class="shdzok box">
  99. <div class="d1" onClick="qyok()">确定</div>
  100. <div class="d2" onClick="qyclo()">取消</div>
  101. </div>
  102. </body>
  103. </html>