|
|
|
มีปัญหาเกี่ยวกับ ตัว MM_preloadImages กับ enctype="multipart/form-data" ช่วยทีนะ |
|
|
|
|
|
|
|
Code (PHP)
<?php require_once('../../Connections/Melody.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
session_start();
}
// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
$_SESSION['MM_Username'] = NULL;
$_SESSION['MM_UserGroup'] = NULL;
$_SESSION['PrevUrl'] = NULL;
unset($_SESSION['MM_Username']);
unset($_SESSION['MM_UserGroup']);
unset($_SESSION['PrevUrl']);
$logoutGoTo = "../../palace.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
}
}
?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "Webmaster,Admin,User";
$MM_donotCheckaccess = "false";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "../../palace.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO palace (plid, plname, plrank, plyear, plpic) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['plid'], "int"),
GetSQLValueString($_POST['plname'], "text"),
GetSQLValueString($_POST['plrank'], "text"),
GetSQLValueString($_POST['plyear'], "text"),
GetSQLValueString($_FILES["plpic"]["name"], "text"));
move_uploaded_file($_FILES["plpic"]["tmp_name"],"../../images/palace/".$_FILES["plpic"]["name"]);
mysql_select_db($database_Melody, $Melody);
mysql_query("SET NAMES UTF8");
$Result1 = mysql_query($insertSQL, $Melody) or die(mysql_error());
$insertGoTo = "../palace.php?check=adds";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
$colname_mBody = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_mBody = $_SESSION['MM_Username'];
}
mysql_select_db($database_Melody, $Melody);
mysql_query("SET NAMES UTF8");
$query_mBody = sprintf("SELECT * FROM member WHERE username = %s", GetSQLValueString($colname_mBody, "text"));
$mBody = mysql_query($query_mBody, $Melody) or die(mysql_error());
$row_mBody = mysql_fetch_assoc($mBody);
$totalRows_mBody = mysql_num_rows($mBody);
?>
<?php
if ($_SESSION['MM_UserGroup']=="Webmaster") {
$uGroup = "เว็บมาสเตอร์";
}
if ($_SESSION['MM_UserGroup']=="Admin") {
$uGroup = "ผู้ดูแลระบบ";
}
if ($_SESSION['MM_UserGroup']=="User") {
$uGroup = "ผู้ใช้งาน";
}
?>
<!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=utf-8" />
<title>ฝ่ายส่งน้ำและบำรุงรักษาที่ 1</title>
<style type="text/css">
@import url("../../css/bg.css");
</style>
<script src="../../SpryAssets/SpryCollapsiblePanel.js" type="text/javascript"></script>
<link href="../../SpryAssets/SpryCollapsiblePanel.css" rel="stylesheet" type="text/css" />
<?php if($_GET['check']=="updates"){ ?>
<script language="JavaScript">
function loadalert ()
{
alert("แก้ไขข้อมูลเรียบร้อยแล้ว")
}
loadalert()
</script>
<?php } ?>
</head>
<body onload="MM_preloadImages('../../images/icon/index1.jpg','../../images/icon/about1.jpg','../../images/icon/gallery1.jpg','../../images/icon/download1.jpg','../../images/icon/news1.jpg','../../images/icon/contact1.jpg','../../images/icon/site1.jpg','../../images/icon/city1.jpg','../../images/icon/maelao1.jpg','../../images/icon/padaet1.jpg','../../images/icon/wiangchai1.jpg','../../images/icon/wiangchiangrung1.jpg','../../images/icon/palace1.jpg');">
<br />
<div align="center">
<table border="0" cellpadding="1" cellspacing="0" class="page">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="paget"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table border="1" cellpadding="0" cellspacing="0">
<tr>
<td><a href="../2011.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('index','','../../images/icon/index1.jpg',1)"><img src="../../images/icon/index.jpg" name="index" width="79" height="30" border="0" id="index" /></a></td>
</tr>
</table></td>
<td> </td>
<td><table border="1" cellpadding="0" cellspacing="0">
<tr>
<td><a href="../about.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('about','','../../images/icon/about1.jpg',1)"><img src="../../images/icon/about.jpg" name="about" width="110" height="30" border="0" id="about" /></a></td>
</tr>
</table></td>
<td> </td>
<td><table border="1" cellpadding="0" cellspacing="0">
<tr>
<td><a href="../palace.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('palace','','../../images/icon/palace1.jpg',1)"><img src="../../images/icon/palace.jpg" name="palace" width="160" height="30" border="0" id="palace" /></a></td>
</tr>
</table></td>
<td> </td>
<td><table border="1" cellpadding="0" cellspacing="0">
<tr>
<td><a href="../gallery.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('gallery','','../../images/icon/gallery1.jpg',1)"><img src="../../images/icon/gallery.jpg" name="gallery" width="71" height="30" border="0" id="gallery" /></a></td>
</tr>
</table></td>
<td> </td>
<td><table border="1" cellpadding="0" cellspacing="0">
<tr>
<td><a href="../download.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('download','','../../images/icon/download1.jpg',1)"><img src="../../images/icon/download.jpg" name="download" width="96" height="30" border="0" id="download" /></a></td>
</tr>
</table></td>
<td> </td>
<td><table border="1" cellpadding="0" cellspacing="0">
<tr>
<td><a href="../news.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('news','','../../images/icon/news1.jpg',1)"><img src="../../images/icon/news.jpg" name="news" width="47" height="30" border="0" id="news" /></a></td>
</tr>
</table></td>
<td> </td>
<td><table border="1" cellpadding="0" cellspacing="0">
<tr>
<td><a href="../contact.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contact','','../../images/icon/contact1.jpg',1)"><img src="../../images/icon/contact.jpg" name="contact" width="95" height="30" border="0" id="contact" /></a></td>
</tr>
</table></td>
<td> </td>
<td><table border="1" cellpadding="0" cellspacing="0">
<tr>
<td><a href="../site.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('site','','../../images/icon/site1.jpg',1)"><img src="../../images/icon/site.jpg" name="site" width="94" height="30" border="0" id="site" /></a></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td class="paget"><table border="0" cellpadding="0" cellspacing="0" class="paget">
<tr>
<td align="center" valign="middle" class="ht"><div id="CollapsiblePanel1" class="CollapsiblePanel">
<div class="CollapsiblePanelTab" tabindex="0">> > > <?php echo "ยินดีต้อนรับ"." ".$uGroup." ".ucfirst($_SESSION['MM_Username']); ?> < < <</div>
<div class="CollapsiblePanelContent"><table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#c8cdd3"><tr><td valign="middle" align="center">
<form id="loginut" name="logout" method="POST" action="<?php echo $logoutAction ?>">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle" class="flog">ชื่อ</td>
<td class="flog"> : </td>
<td class="flog"><?php echo $row_mBody['firstname']." ".$row_mBody['lastname']; ?>
</td>
<td>
</td>
<td valign="middle" class="flog">อีเมล์</td>
<td class="flog"> : </td>
<td class="flog"><?php echo $row_mBody['email']; ?>
</td>
<td>
</td>
<td valign="middle" class="flog">โทรศัพท์</td>
<td class="flog"> : </td>
<td class="flog"><?php echo $row_mBody['tel']; ?>
</td>
<td>
</td>
<td align="center" valign="middle" class="fforget">
<a href="../../member/alltag.php" class="fforget">
แก้ไขข้อมูล
</a>
</td>
<td> </td>
<td align="right"><input type="submit" name="logout" id="logout" value=" ออกจากระบบ " />
</td>
</tr>
</table> </form>
</td></tr>
<tr><td valign="middle" align="center" bgcolor="#FFFFFF" height="8">
</td></tr>
</table></div>
</div></td>
</tr>
<tr>
<td align="center" valign="middle" class="ht"><img src="../../images/logod.jpg" width="956" height="208" /></td>
</tr>
</table></td>
</tr>
<tr>
<td class="paget" align="left" valign="bottom"><table border="0" cellpadding="0" cellspacing="0" class="pagetopage1">
<tr>
<td align="left" height="2"></td>
</tr>
<tr>
<td align="left"><a href="../2011.php" class="pagetopage">หน้าแรก</a> > <a href="../palace.php" class="pagetopage">ทำเนียบหัวหน้าฝ่ายส่งน้ำและบำรุงรักษาที่ 1</a> > เพิ่มข้อมูลทำเนียบ</td>
</tr>
<tr>
<td align="left" height="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top" class="pagebo">
<table width="191" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
<tr>
<td valign="middle" align="center">
<form method=get action="http://www.google.com/search" name="frmsearchgg" target="_blank">
<DIV class=search>
<input class=inputbox type="text" id=mod_search_searchword onblur="if(this.value=='') this.value='ค้นหา...';" onfocus="if(this.value=='ค้นหา...') this.value='';"size="26" name="q" value="ค้นหา...">
</DIV>
</FORM>
</td>
</tr>
</table>
<br />
<table border="1" cellpadding="0" cellspacing="0"><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle"><img src="../../images/headjud.jpg" width="191" height="31" /></td>
</tr>
</table></td></tr>
<tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle"><a href="../jurisdiction.php#city" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('city','','../../images/icon/city1.jpg',1)"><img src="../../images/icon/city.jpg" name="city" width="191" height="28" border="0" id="city" /></a></td>
</tr>
<tr>
<td valign="middle"><a href="../jurisdiction.php#maelao" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('maelao','','../../images/icon/maelao1.jpg',1)"><img src="../../images/icon/maelao.jpg" name="maelao" width="191" height="28" border="0" id="maelao" /></a></td>
</tr>
<tr>
<td valign="middle"><a href="../jurisdiction.php#padaet" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('padaet','','../../images/icon/padaet1.jpg',1)"><img src="../../images/icon/padaet.jpg" name="padaet" width="191" height="28" border="0" id="padaet" /></a></td>
</tr>
<tr>
<td valign="middle"><a href="../jurisdiction.php#wiangchai" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('wiangchai','','../../images/icon/wiangchai1.jpg',1)"><img src="../../images/icon/wiangchai.jpg" name="wiangchai" width="191" height="28" border="0" id="wiangchai" /></a></td>
</tr>
<tr>
<td valign="middle"><a href="../jurisdiction.php#wiangchiangrung" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('wiangchiangrung','','../../images/icon/wiangchiangrung1.jpg',1)"><img src="../../images/icon/wiangchiangrung.jpg" name="wiangchiangrung" width="191" height="28" border="0" id="wiangchiangrung" /></a></td>
</tr>
</table></td></tr></table>
<br />
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td><iframe src="http://www.tmd.go.th/daily_forecast_forweb.php?strProvinceID=1-2-3-7-11-12-13" width="190" height="212" scrolling="no" frameborder="0"></iframe></td>
</tr>
</table>
<br />
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td><embed src="http://www.siaminfobiz.com/Icons/Calendar/kal16.swf" width="165" height="235" wmode="transparent" type="application/x-shockwave-flash"></embed></td>
</tr>
</table>
<br />
</td>
<td valign="top" class="pagebt"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td rowspan="2" width="37"> </td>
<td align="center" valign="middle" class="texthead"><img src="../../images/palacet.jpg" width="430" height="61" /></td>
</tr>
<tr>
<td align="center" valign="middle">
<br />
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1" enctype="multipart/form-data">
<table class="fshow" border="0" align="center" cellpadding="0" cellspacing="0">
<tr valign="baseline">
<td nowrap="nowrap" align="right">ชื่อ : </td>
<td><input type="text" name="plname" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right" height="6"></td>
<td align="left"></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">ตำแหน่ง : </td>
<td><input type="text" name="plrank" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right" height="6"></td>
<td align="left"></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">ปีที่ดำรงตำแหน่ง พ.ศ. : </td>
<td><input type="text" name="plyear" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right" height="6"></td>
<td align="left"></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">รูปภาพ : </td>
<td><input type="file" name="plpic" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right" height="6"></td>
<td align="left"></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" value=" เพิ่มข้อมูล " /></td>
</tr>
</table>
<input type="hidden" name="plid" value="" />
<input type="hidden" name="MM_insert" value="form1" />
</form>
</td>
</tr>
</table>
<br />
<br />
<br />
</td>
</tr>
<tr>
<td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="fl">ออกแบบและพัฒนาโดย ฝ่ายส่งน้ำและบำรุงรักษาที่ 1
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</div>
<script type="text/javascript">
var CollapsiblePanel1 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel1", {contentIsOpen:false});
</script>
</body>
</html>
<?php
mysql_free_result($mBody);
?>
|
|
|
|
|
Date :
2011-09-21 11:04:20 |
By :
BizkitEyes |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|