查看文件: edit_message.php
大小: 6.34 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE massage1 SET name1=%s, name2=%s, seljob=%s, email=%s, doc=%s, tel=%s, master_doc=%s, qdate=%s, flag=%s, cuid3=%s WHERE id=%s", GetSQLValueString($_POST['name1'], "text"), GetSQLValueString($_POST['name2'], "text"), GetSQLValueString($_POST['seljob'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($_POST['doc'], "text"), GetSQLValueString($_POST['tel'], "text"), GetSQLValueString($_POST['master_doc'], "text"), GetSQLValueString($_POST['qdate'], "date"), GetSQLValueString($_POST['flag'], "text"), GetSQLValueString($_POST['cuid3'], "int"), GetSQLValueString($_POST['id'], "int")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); $test_mail=$_POST['email']; if($_POST['smail']=='Y' && preg_match('/^([.0-9a-z]+)@([0-9a-z]+).([.0-9a-z]+)$/i',$test_mail) ){ $mMAILBODY = "BUS104.COM-網站留言回覆..". "\r\n"; $mMAILBODY .= "留言者姓名 :".addslashes($_POST["name1"]). "\r\n"; $mMAILBODY .= "留言者E-mail :".addslashes($_POST["email1"]). "\r\n"; $mMAILBODY .= "留言者電話 :".addslashes($_POST["tel"]). "\r\n"; $mMAILBODY .= "留言內文 :".addslashes($_POST["doc"]). "\r\n". "\r\n"; $mMAILBODY .= "留言回覆內文 :".addslashes($_POST["master_doc"]). "\r\n"; $rep_email_title="=?UTF-8?B?".base64_encode("Bus104線上服務")."?="; // 郵件寄件者信箱 $rep_email_addr="service@bus104.com"; // 郵件寄件者變數 此行勿更改 $send_title='BUS104 線上留言回覆'; $test_mail=$_POST['email'] ;//"service@bus104.com"; $headers = 'From: service@bus104.com' . "\r\n" . 'Reply-To: service@bus104.com.tw' . "\r\n" . 'X-Mailer: PHP/' . phpversion(). "\r\n" ."Content-Type: text/html ; charset=utf-8 \n";; $new_subject="=?UTF-8?B?".base64_encode($send_title)."?="; mail( $test_mail , $new_subject, $mMAILBODY ,$headers); //mail( $test_mail , $new_subject, iconv("UTF-8","BIG5",$mMAILBODY) ,$headers); } $updateGoTo = $_POST['url'];//"#"; header(sprintf("Location: %s", $updateGoTo)); } $colname_Rt2 = "-1"; if (isset($_GET['id'])) { $colname_Rt2 = $_GET['id']; } mysql_select_db($database_BE2, $BE2); $query_Rt2 = sprintf("SELECT * FROM massage1 WHERE id = %s", GetSQLValueString($colname_Rt2, "int")); $Rt2 = mysql_query($query_Rt2, $BE2) or die(mysql_error()); $row_Rt2 = mysql_fetch_assoc($Rt2); $totalRows_Rt2 = mysql_num_rows($Rt2); ?> <form action="" method="post" name="form1" id="form1"> <table align="center"> <tr valign="baseline"> <th width="115" align="right" nowrap="nowrap" class="font2">抬頭:</th> <td width="461"><input type="text" name="name1" value="<?php echo htmlentities($row_Rt2['name1'], ENT_COMPAT, 'utf-8'); ?>" size="32" /></td> </tr> <tr valign="baseline"> <th nowrap="nowrap" align="right" class="font2">聯絡人:</th> <td><input type="text" name="name2" value="<?php echo htmlentities($row_Rt2['name2'], ENT_COMPAT, 'utf-8'); ?>" size="32" /></td> </tr> <tr valign="baseline"> <th nowrap="nowrap" align="right" class="font2">諮詢項目:</th> <td><input type="text" name="seljob" value="<?php echo htmlentities($row_Rt2['seljob'], ENT_COMPAT, 'utf-8'); ?>" size="32" /></td> </tr> <tr valign="baseline"> <th nowrap="nowrap" align="right" class="font2">Email:</th> <td><input type="text" name="email" value="<?php echo htmlentities($row_Rt2['email'], ENT_COMPAT, 'utf-8'); ?>" size="32" /></td> </tr> <tr valign="baseline"> <th align="right" valign="top" nowrap="nowrap" class="font2">留言內文:</th> <td><textarea name="doc" cols="60" rows="4"><?php echo htmlentities($row_Rt2['doc'], ENT_COMPAT, 'utf-8'); ?></textarea></td> </tr> <tr valign="baseline"> <th nowrap="nowrap" align="right" class="font2">聯絡電話:</th> <td><input type="text" name="tel" value="<?php echo htmlentities($row_Rt2['tel'], ENT_COMPAT, 'utf-8'); ?>" size="32" /></td> </tr> <tr valign="baseline"> <th align="right" valign="top" nowrap="nowrap" class="font2"><span class="font_blank_12xb">板主回覆</span>:</th> <td><textarea name="master_doc" cols="60" rows="6"><?php echo htmlentities($row_Rt2['master_doc'], ENT_COMPAT, 'utf-8'); ?></textarea></td> </tr> <tr valign="baseline"> <th nowrap="nowrap" align="right" class="font2">留言日期:</th> <td><input type="text" name="qdate" value="<?php echo htmlentities($row_Rt2['qdate'], ENT_COMPAT, 'utf-8'); ?>" size="32" /></td> </tr> <tr valign="baseline"> <th nowrap="nowrap" align="right" class="font2">處理狀態:</th> <td><select name="flag"> <option value="Y" <?php if (!(strcmp("Y", htmlentities($row_Rt2['flag'], ENT_COMPAT, 'utf-8')))) {echo "SELECTED";} ?>>Y</option> <option value="N" <?php if (!(strcmp("N", htmlentities($row_Rt2['flag'], ENT_COMPAT, 'utf-8')))) {echo "SELECTED";} ?>>N</option> </select></td> </tr> <tr valign="baseline"> <th nowrap="nowrap" align="right" class="font2">發送回函EMAIL:</th> <td><select name="smail" id="smail"> <option value="Y">Y</option> <option value="N" selected="selected">N</option> </select></td> </tr> <tr valign="baseline"> <th nowrap="nowrap" align="right" class="font2"> </th> <td><input type="submit" value="更新記錄" /></td> </tr> </table> <input type="hidden" name="id" value="<?php echo $row_Rt2['id']; ?>" /> <input type="hidden" name="cuid3" value="<?php echo htmlentities($row_Rt2['cuid3'], ENT_COMPAT, 'utf-8'); ?>" /> <input type="hidden" name="MM_update" value="form1" /> <input type="hidden" name="id" value="<?php echo $row_Rt2['id']; ?>" /> <input name="url" type="hidden" id="url" value="<?php echo $_SERVER['HTTP_REFERER']; ?>" /> </form> <?php mysql_free_result($Rt2); ?>
保存
取消
返回文件列表