<?php session_start() ; if (!isset($_SESSION['login_true'])) { header("Location: main.php"); exit; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <link href="style2.css" rel="stylesheet" type="text/css" media="screen" /> <title>Welcome</title> </head> <body> <div id="All"> <div id="head"> </div><!--head--> <div id="content2"> <div align='center'><h1>Manage customer data</h1></div> <?php $conn=odbc_connect('DB','admin','1234'); if (!$conn){exit("Connection Failed: " . $conn);} if (isset($_POST['change'])){ $user = $_POST['user']; $cusID = $_POST['cusID']; $firstLast = $_POST['firstLast']; $note = $_POST['note']; echo "first = $firstLast, note = $note,<br>"; $sql2 = "update datas set commentary ='$note' where cusID=$cusID"; $rs2=odbc_exec($conn,$sql2); if (!$rs2){exit("Error in SQL2");} //--------------------------------under line echo "Change data complete"; echo "<form name=\"form2\" method=\"post\" action=\"sendDoc.php\">"; echo "<input type=hidden name=user value=$user>"; echo "<input type=submit name=change value='Go Back'>"; echo "</form>"; } odbc_close($conn); ?> <?php $user = $_POST['user']; $cusID = $_POST['cusID']; echo"<a href=\"sendDoc.php?user=$user\">Cancel</a>"; $conn=odbc_connect('DB','admin','1234'); if (!$conn) {exit("Connection Failed: " . $conn);} $sql1="SELECT * FROM datas where cusID=$cusID"; $rs1 = odbc_exec($conn,$sql1); if (!$rs1){exit("Error in SQL1");} while($row = odbc_fetch_array($rs1)){ echo "<form name=\"form2\" method=\"post\" action=\"editSendDoc.php\">"; echo "<table border='1' width='500'>"; echo "<tr><td width='150'><label>Customer's name</label></td>"; echo "<td><textarea name=\"firstLast\" cols=\"30\" rows=\"2\">".$row["firstLast"]."</textarea></td></tr>";//name echo "<tr><td><label>Note</label></td>"; echo "<td><textarea name=\"note\" cols=\"50\" rows=\"4\">".$row["note"]."</textarea></td></tr>";//note echo "<tr><td colspan=\"2\"><input type='submit' name='change' value='manage'></td><tr>"; echo "<input type=hidden name=user value=$user>"; echo "<input type=hidden name=cusID value=$cusID>"; echo "</table></form>"; } odbc_close($conn); ?> </div><!-- content2--> </div><!-- all --> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง