查看文件: addr.php
大小: 4.05 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php $z0=''; $z1=''; $z2=''; $z3=''; $z0=isset($_POST['z4'])?$_POST['z4']:""; mysql_select_db($database_BE2, $BE2); $query_Rta = "SELECT distinct(z1) FROM zip2"; $Rta = mysql_query($query_Rta, $BE2) or die(mysql_error()); $row_Rta = mysql_fetch_assoc($Rta); $totalRows_Rta = mysql_num_rows($Rta); if($z0<>''){ $query_Rtc = sprintf("SELECT * FROM zip2 where z0='%s'",$z0); $Rtc = mysql_query($query_Rtc, $BE2) or die(mysql_error()); $row_Rtc = mysql_fetch_assoc($Rtc); $totalRows_Rtc = mysql_num_rows($Rtc); if($row_Rtc['z2']<>""){ $z1=$row_Rtc['z1']; $z2=$row_Rtc['z2']; $z3=$row_Rtc['z3']; } mysql_free_result($Rtc); } ?> <div class="webform" align="center" > <table width="487" height="69" border="1" cellpadding="0" cellspacing="0" bordercolor="#0099CC" bgcolor="#FFFFFF"> <tr> <td width="475" align="center" valign="middle"><table width="99%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td width="14%"> <select name="ta1" id="ta1" onChange="setcityz1()"> <option value="0">=====</option> <?php do { ?> <option value="<?php echo $row_Rta['z1']?>" <? if($row_Rta['z1']==$z1){ ?>selected="selected" <? }?>><?php echo $row_Rta['z1']?></option> <?php } while ($row_Rta = mysql_fetch_assoc($Rta)); $rows = mysql_num_rows($Rta); if($rows > 0) { mysql_data_seek($Rta, 0); $row_Rta = mysql_fetch_assoc($Rta); } ?> </select> </td> <td width="18%"><select name="ta2" id="ta2" onChange="setcityz2()"> <? if($z1<>''){ ?> <?php mysql_select_db($database_BE2, $BE2); $query_Rtg = sprintf("SELECT distinct(z2),cid FROM zip2 WHERE z1 = '%s'", $z1); $Rtg = mysql_query($query_Rtg, $BE2) or die(mysql_error()); $row_Rtg = mysql_fetch_assoc($Rtg); $totalRows_Rtg = mysql_num_rows($Rtg); ?> <option value="0" selected="selected">=====</option> <?php do { ?> <option value="<?php echo $row_Rtg['cid']?>" <? if($row_Rtg['z2']==$z2){ ?> selected="selected" <? }?> ><?php echo $row_Rtg['z2']?></option> <?php } while ($row_Rtg = mysql_fetch_assoc($Rtg)); mysql_free_result($Rtg); ?> <? }?> </select></td> <td width="14%"><select name="ta4" id="ta4" > <? if($z1<>''){ ?> <? mysql_select_db($database_BE2, $BE2); $query_Rtz = sprintf("SELECT distinct(z3),z0 FROM zip2 WHERE z1 = '%s' AND z2= '%s'", $z1,$z2); $Rtz = mysql_query($query_Rtz, $BE2) or die(mysql_error()); $row_Rtz = mysql_fetch_assoc($Rtz); $totalRows_Rtz = mysql_num_rows($Rtz); ?> <option value="0" selected="selected">=====</option> <?php do { ?> <option value="<?php echo $row_Rtz['z0']?>" <? if($row_Rtz['z0']==$z0){ ?> selected="selected" <? }?>><?php echo $row_Rtz['z3']?></option> <?php } while ($row_Rtz = mysql_fetch_assoc($Rtz)); mysql_free_result($Rtz); ?> <? } ?> </select></td> <td width="6%"><label> <input name="ta5" type="text" id="ta5" size="4" maxlength="20" class="namew9"/> </label></td> <td width="8%">巷 </td> <td width="6%"><input name="ta6" type="text" id="ta6" size="4" maxlength="4" class="namew9"/></td> <td width="3%">弄</td> <td width="6%"><input name="ta7" type="text" id="ta7" size="4" maxlength="4" class="namew9"/></td> <td width="3%">號</td> <td width="6%"><input name="ta8" type="text" id="ta8" size="4" maxlength="4" class="namew9"/></td> <td width="9%">樓 之</td> <td width="7%"><input name="ta9" type="text" id="ta9" size="4" maxlength="4" class="namew9"/></td> </tr> <tr> <td><input name="ta3" type="hidden" id="ta3" size="8" maxlength="20" /></td> <td> </td> <td colspan="3"><label> <input type="button" name="Submit2" value="取消" onclick="close_addr()"/> </label></td> <td> </td> <td> </td> <td colspan="4"> <input type="button" name="Submit1" value="確認" onclick="set_addr()"/> </td> <td> </td> </tr> </table></td> </tr> </table> </div> <?php mysql_free_result($Rta); ?>
保存
取消
返回文件列表