查看文件: api01.php
大小: 5.53 KB
类型: application/octet-stream
<?php require_once('../Connections/BEB2.php'); ?> <? $vcount=isset($_POST['disc'])?$_POST['disc']:1; $city = '宜蘭縣'; mysql_select_db($database_BEB2, $BEB2); // address_id county district street $query_Rot2 = "SELECT distinct(county) FROM address where 1 order by address_id"; $Rot2 = mysql_query($query_Rot2, $BEB2) or die(mysql_error()); $row_Rot2 = mysql_fetch_assoc($Rot2); $totalRows_Rot2 = mysql_num_rows($Rot2); mysql_select_db($database_BEB2, $BEB2); // address_id county district street $query_Rat2 = sprintf("SELECT distinct(district) FROM address where county='%s' order by district",$city); $Rat2 = mysql_query($query_Rat2, $BEB2) or die(mysql_error()); $row_Rat2 = mysql_fetch_assoc($Rat2); $totalRows_Rat2 = mysql_num_rows($Rat2); $district=$row_Rat2['district']; mysql_select_db($database_BEB2, $BEB2); // address_id county district street $query_Rbt2 = sprintf("SELECT address_id,street FROM address where county='%s' AND district='%s' order by street",$city, $district); $Rbt2 = mysql_query($query_Rbt2, $BEB2) or die(mysql_error()); $row_Rbt2 = mysql_fetch_assoc($Rbt2); $totalRows_Rbt2 = mysql_num_rows($Rbt2); mysql_select_db($database_BEB2, $BEB2); // address_id county district street $query_Rct2 = sprintf("SELECT * FROM dat1 where a3='%s' order by a1",'分齡賽'); $Rct2 = mysql_query($query_Rct2, $BEB2) or die(mysql_error()); $row_Rct2 = mysql_fetch_assoc($Rct2); $totalRows_Rct2 = mysql_num_rows($Rct2); ?> <tr id="myTableRow<?= $vcount; ?>"> <td><input name="bdid<?= $vcount; ?>" type="text" id="bdid<?= $vcount; ?>" value="" size="10" maxlength="12" onkeyup="bdidfound(<?= $vcount; ?>)" /></td> <td><input name="bname<?= $vcount; ?>" type="text" id="bname<?= $vcount; ?>" value="" size="10" maxlength="12" /></td> <td> <select name="bsex<?= $vcount; ?>" id="bsex<?= $vcount; ?>"> <option value="男" >男</option> <option value="女" >女</option> </select> </td> <td><table width="100" border="1" cellpadding="1"> <tr> <td> <select name="byy<?= $vcount; ?>" id="byy<?= $vcount; ?>" onchange="set_bkind(<?= $vcount; ?>)"> <? for($i=2025;$i>1929;$i--){?> <option value="<?=$i?>"><?=$i-1911?></option> <? }?> </select> </td> <td> <select name="bmm<?= $vcount; ?>" id="bmm<?= $vcount; ?>" onchange="set_bkind(<?= $vcount; ?>)"> <? for($i=1;$i<13;$i++){?> <option value="<?=$i?>"><?= sprintf('%02d',$i)?></option> <? }?> </select> </td> <td> <select name="bdd<?= $vcount; ?>" id="bdd<?= $vcount; ?>" onchange="set_bkind(<?= $vcount; ?>)"> <? for($i=1;$i<32;$i++){?> <option value="<?=$i?>"><?= sprintf('%02d',$i)?></option> <? }?> </select> </td> </tr> </table> </td> <td><input name="btel<?= $vcount; ?>" type="text" id="btel<?= $vcount; ?>" value="" size="10" maxlength="12" /></td> <td nowrap="nowrap"><select name="city<?= $vcount; ?>" id="city<?= $vcount; ?>" onchange="Selectcity(<?= $vcount; ?>)"> <? do { ?> <option value="<?= $row_Rot2['county']; ?>" <?= ($row_Rot2['county']==$city)?'selected="selected"':""; ?>> <?= $row_Rot2['county']; ?> </option> <?php } while ($row_Rot2 = mysql_fetch_assoc($Rot2)); ?> </select> <select name="district<?= $vcount; ?>" id="district<?= $vcount; ?>" onchange="Selectstreet(<?= $vcount; ?>);"> <? $address_name .= $row_Rat2['district'].','; do { ?> <option value="<?= $row_Rat2['district']; ?>" <?= ($row_Rat2['district']==$district)?'selected="selected"':""; ?>> <?= $row_Rat2['district']; ?> </option> <? } while ($row_Rat2 = mysql_fetch_assoc($Rat2)); ?> </select> <select name="street<?= $vcount; ?>" id="street<?= $vcount; ?>" onchange="show_id(<?= $vcount; ?>)"> <? $address_id=$row_Rbt2['address_id']; $address_name .= $row_Rbt2['street']; do { ?> <option value="<?= $row_Rbt2['address_id']; ?>" > <?= $row_Rbt2['street']; ?> </option> <? } while ($row_Rbt2 = mysql_fetch_assoc($Rbt2)); ?> </select></td> <td><input name="bemail<?= $vcount; ?>" type="text" id="bemail<?= $vcount; ?>" value="" size="30" maxlength="60" /></td> <td> <input name="bkind<?= $vcount; ?>" type="text" id="bkind<?= $vcount; ?>" value="" size="15" maxlength="60" readonly="readonly" /> <? /* <select name="bkind<?= $vcount; ?>" id="bkind<?= $vcount; ?>"> <option value="分齡賽" selected="selected">分齡賽</option> <option value="趣味競賽">趣味競賽</option> <option value="大隊接力">大隊接力</option> </select> */ ?> </td> <td> <select name="bsport<?= $vcount; ?>" id="bsport<?= $vcount; ?>" > <? do { ?> <option value="<?= $row_Rct2['a2']; ?>"><?= $row_Rct2['a2']; ?></option> <? } while ($row_Rct2 = mysql_fetch_assoc($Rct2)); ?> </select> </td> <td><input type="button" onclick="saverow(<?= $vcount; ?>);" value="報名寫入" /></td> <td> <input name="bid<?= $vcount; ?>" type="hidden" id="bid<?= $vcount; ?>" value="0" /> </td> <td> </td> </tr> <? mysql_free_result($Rot2); mysql_free_result($Rat2); mysql_free_result($Rbt2); mysql_free_result($Rct2); ?>
保存
取消
返回文件列表