查看文件: city_zone_add.php
大小: 3.96 KB
类型: application/octet-stream
<?php require('system/login.php'); ?> <?php require_once('../Connections/BE2.php'); ?> <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $kbdoc=trim($_POST['kbdoc']); if (isset($_POST['city']) && ($kbdoc<>'')){ $INSERTSQL ="INSERT INTO addzone (k1,kbdoc)VALUES"; $city = $_POST['city']; foreach ($city as $scity=>$value) { // echo "city : ".$value."<br />"; $s1=sprintf(" ( '%s','%s' ) ,",$value ,$kbdoc); $INSERTSQL .=$s1; } $INSERTSQL=substr($INSERTSQL,0,-1); $INSERTSQL.=';'; mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($INSERTSQL, $BE2) or die(mysql_error()); $updateGoTo =$_POST['url']; echo "<script>alert('上傳完成 ..');location.href='".$updateGoTo."';</script>"; } } mysql_select_db($database_BE2, $BE2); $query_R2 = "SELECT * FROM `addrcity` WHERE k1 <25"; $R2 = mysql_query($query_R2, $BE2) or die(mysql_error()); $row_R2 = mysql_fetch_assoc($R2); ?> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">新增-城市分區表</h3> </div> <form action="" method="post" name="form1" id="form1" > <table width="50%" align="center"> <tr valign="baseline"> <th height="38" colspan="3" align="center" valign="middle" nowrap="nowrap"><span class="font2">城市分區表 新增</span><span class="font2">分區</span></th> </tr> <tr valign="baseline"> <th width="16%" height="42" align="center" valign="middle" nowrap="nowrap"> </th> <td width="71%" valign="middle"> </td> <td width="13%" valign="baseline"> </td> </tr> <tr valign="baseline"> <th height="42" align="center" valign="middle" nowrap="nowrap"><span class="font2">分區說明</span>:</th> <td valign="middle"><input name="kbdoc" type="text" id="kbdoc" value="" size="32" /></td> <td width="13%" valign="baseline"> </td> </tr> <tr valign="baseline"> <th height="38" align="center" valign="middle" nowrap="nowrap"><span class="font2">城市選擇:</span></th> <td valign="middle"> <table border="1" cellpadding="1" cellspacing="0"> <tr> <? $i=0; do{ if(($i%4==0) && ($i>0)){ echo '</tr><tr>' ;} $i++; ?> <td nowrap="nowrap"><input name="city[]" type="checkbox" id="city[]" value="<?= $row_R2['k1'] ?>" /> <label for="city[]"> <?= $row_R2['county']; ?> </label></td> <?php } while ($row_R2 = mysql_fetch_assoc($R2)); ?> </tr> </table></td> <td valign="baseline"> </td> </tr> <tr valign="baseline"> <th height="42" align="center" valign="middle" nowrap="nowrap"> </th> <td valign="middle"> </td> <td valign="baseline"> </td> </tr> <tr valign="baseline"> <td height="30" align="center" valign="middle" nowrap="nowrap"> </td> <td height="30" align="left" valign="middle" nowrap="nowrap"><label for="select"></label></td> <td align="left" valign="middle" nowrap="nowrap"> </td> </tr> <tr valign="baseline"> <td height="34" colspan="3" align="center" valign="middle" nowrap="nowrap"><br></td> </tr> <tr valign="baseline"> <td height="40" colspan="3" align="center" valign="middle" nowrap="nowrap"><input type="submit" value="更新" /></td> </tr> </table> <input type="hidden" name="MM_update" id="MM_update" value="form1" /> <input name="url" type="hidden" id="url" value="<?= $_SERVER['HTTP_REFERER']; ?>" /> </form> <div id="back"><a href="javascript:history.back();"><img src="images/back.gif" alt="回上一頁" title="回上一頁" width="115" height="32" border="0"></a></div> </div> </div> </div> <? mysql_free_result($R2); ?>
保存
取消
返回文件列表