查看文件: cuser_city.php
大小: 3.99 KB
类型: application/octet-stream
<?php require('system/login.php'); ?> <?php require_once('../Connections/BE2.php'); ?> <?php if ((isset($_GET['check_id'])) && ($_GET['check_id'] != "")) { // $deleteSQL = sprintf("DELETE FROM cuser WHERE level<'%s' AND cuid='%s'",$_SESSION['login_lv'],$_GET['check_id']); // mysql_select_db($database_BE2, $BE2); // $Result1= mysql_query($deleteSQL, $BE2) or die(mysql_error()); } if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $deleteSQL = sprintf("DELETE FROM tb2city WHERE buid2='%s'",$_POST['buid']); mysql_select_db($database_BE2, $BE2); $Result1= mysql_query($deleteSQL, $BE2) or die(mysql_error()); $insertkid = "INSERT INTO tb2city(buid2,ec1,ec3,bctaddr,bcttel) VALUES "; $c=0; for($i=1;$i<=$_POST['ckcount'];$i++){ if(isset($_POST['ck'.$i])){ if($c>0) $insertkid .=","; $insertkid .= "( ".$_POST['buid'].",".$_POST['ck'.$i].",'".$_POST['ec3_'.$i]."','".$_POST['addr_'.$i] ."','". $_POST['tel_'.$i]."')"; $c++; } } if($c>0){ $insertkid .=";"; mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($insertkid, $BE2) or die(mysql_error()); //echo "<br> $1 insertkid :".$insertkid ; $write='資料已更新...'; echo "<script>alert('".$write."');</script>"; $updateGoTo =$_POST['url'];// "main.php?act=user"; header(sprintf("Location: %s", $updateGoTo)); } } mysql_select_db($database_BE2, $BE2); $query_Rt2 =sprintf("select c.bc2,c.bc3,c.bc4,a.*,b.bctid,b.bctaddr,b.bcttel from tb2 as c,tb1 as a left join tb2city as b on a.ec1=b.ec1 AND b.buid2='%s' where c.buid='%s' order by a.tbc0,a.ec4",$_GET['id'],$_GET['id']); $Rt2 = mysql_query($query_Rt2, $BE2) or die(mysql_error()); $row_Rt2 = mysql_fetch_assoc($Rt2); $totalRows_Rt2 = mysql_num_rows($Rt2); // if($_SERVER['REMOTE_ADDR']=='220.130.43.121'){ echo $query_Rt2;} ?> <div class="font2"><? echo $row_Rt2['bc2']." ".$row_Rt2['bc3'].$row_Rt2['bc4'] ?></div> <div id="content" align="center"> <form id="form1" name="form1" method="post" action=""> <table width="71%" border="0" cellspacing="0" cellpadding="0"> <tr> <th height="33" align="center" valign="middle" nowrap="nowrap" class="font2">服務城市</th> <th valign="middle" nowrap="nowrap" class="font2">選擇</th> <th align="center" valign="middle" class="font2">服務電話</th> <th align="center" valign="middle" class="font2">服務地址</th> </tr> <?php $i=0; do { $i++; ?> <tr> <th width="19%" align="center" valign="top" nowrap="nowrap" class="font3"><?= $row_Rt2['ec3']; ?> <input name="ec3_<?= $i ?>" type="hidden" id="ec3_<?= $i ?>" value="<?= $row_Rt2['ec3']?>" /></th> <td width="12%" align="center" valign="top" class="font3"><input name="ck<?= $i ?>" type="checkbox" id="ck<?= $i ?>" value="<?= $row_Rt2['ec1']?>" <? if($row_Rt2['bctid']>0){ echo 'checked="checked"';} ?> /> </td> <td width="69%" align="center" valign="top" class="font3"><input name="tel_<?= $i ?>" type="text" id="tel_<?= $i ?>" value="<?= $row_Rt2['bcttel']?>" size="20" maxlength="20" /></td> <td width="69%" align="center" valign="top" class="font3"><input name="addr_<?= $i ?>" type="text" id="addr_<?= $i ?>" value="<?= $row_Rt2['bctaddr']?>" size="40" maxlength="40" /></td> </tr> <?php } while ($row_Rt2 = mysql_fetch_assoc($Rt2)); ?> <tr> <td height="3" colspan="4" align="center" ><input type="submit" name="button" id="button" value="送出" /></td> </tr> </table> <input type="hidden" name="MM_update" value="form1" /> <input name="ckcount" type="hidden" id="ckcount" value="<?= $i;?>" /> <input name="buid" type="hidden" id="buid" value="<?= $_GET['id'];?>" /> <input name="url" type="hidden" id="url" value="<?= $_SERVER['HTTP_REFERER']; ?>" /> </form> </div> <?php mysql_free_result($Rt2); ?>
保存
取消
返回文件列表