| Server IP : 61.19.30.66 / Your IP : 216.73.216.15 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /var/www/cooperative/sell/ |
Upload File : |
<?
ob_start();
session_start();
if($_SESSION["adminlogin"]=="")
{
header('location:index.php');
exit();
}
//============ Start Session และทำการเรียก Function ติดต่อฐานข้อมูล
require_once('../connect/connect.php');
require_once('../connect/function.php');
//=========== กรณีมีการแก้ไขรายการสินค้า
if($_GET["Action"]=="Save")
{
$resultChk=select("employee","where 1=1 and User='".$_POST["txtUser"]."'");
if($resultChk)
{
echo"<script language='JavaScript'>";
echo"alert('รหัสพนักงานนี้มีอยู่แล้ว');";
echo"</script>";
}
else
{
//=========== บันทึกข้อมูลสินค้า
$sql_up = "insert into employee (User,Password,Name) Values ('$_POST[txtUser]','$_POST[txtPassword]','$_POST[txtName]')";
$dbquery_up = mysql_query($sql_up);
//echo $sql_up;
echo"<script language='JavaScript'>";
echo"alert('เพิ่มข้อมูลเรียบร้อยแล้ว');";
echo"window.location='employee.php';";
echo"</script>";
}
}
?>
<html>
<title>..:: ระบบจัดการฐานข้อมูล ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../css/styles.css" type="text/css">
<script language="JavaScript" src="editor.js"></script>
<div align="center"><br>
<table cellspacing=1 cellpadding=4 width="68%" bgcolor=#CCCCCC border=0 align="center" height="10">
<tbody>
<tr bgcolor=#e5e5e5>
<td width="100%" bgcolor="#FFFFFF"> <div align="center"></div>
<table cellspacing=1 cellpadding=4 width="100%" border=0 align="center" height="10">
<tbody>
<tr bgcolor=#e5e5e5>
<td width="35%" bgcolor="#FFFFFF"> <div align="left"><b><img src="../image/allrowto.gif" width="11" height="11" align="absbottom">
เพิ่มข้อมูลพนักงาน</b></div></td>
<td width="22%" align=middle bgcolor="#FFFFFF"> <div align="left">
</div></td>
<td width="43%" bgcolor="#FFFFFF"> <div align="right"><a href="product.php?CatID=<?=$result["CatID"];?>">กลับไป</a></div></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
</div>
<form name="frmChangeP>" method="post" action="<?=$_SERVER['PHP_SELF'];?>?EmployeeID=<?=$_GET["EmployeeID"];?>&Action=Save" onsubmit="return checkvalue()">
<table cellspacing=1 cellpadding=3 width="68%" bgcolor=#CCCCCC border=0 align="center" height="10">
<tbody>
<tr bgcolor=#e5e5e5>
<td width="31" bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="24%"> </td>
<td width="76%"><script language="JavaScript">
function checkvalue()
{
if(document.all.txtUser.value=="")
{
alert('กรุณากรอก รหัสพนักงาน');
document.all.txtUser.focus();
return false;
}
if(document.all.txtPassword.value=="")
{
alert('กรุณากรอก รหัสผ่าน');
document.all.txtPassword.focus();
return false;
}
if(document.all.txtPassword2.value=="")
{
alert('กรุณากรอก ยืนยันรหัสผ่าน');
document.all.txtPassword2.focus();
return false;
}
if(document.all.txtName.value=="")
{
alert('กรุณากรอก ชื่อ-นามสกุล ');
document.all.txtName.focus();
return false;
}
}
</script></td>
</tr>
<tr>
<td valign="top">รหัสพนักงาน <font color="#FF0000">** </font></td>
<td><input name="txtUser" type="text" class="txtbox" id="txtUser" value="<?=$_POST["txtUser"];?>" maxlength="20">
</td>
</tr>
<tr>
<td valign="top">รหัสผ่าน <font color="#FF0000">** </font></td>
<td><input name="txtPassword" type="password" class="txtbox" id="txtPassword" value="<?=$_POST["txtPassword"];?>" maxlength="100"></td>
</tr>
<tr>
<td valign="top">ยืนยันรหัสผ่าน <font color="#FF0000">** </font></td>
<td><input name="txtPassword2" type="password" class="txtbox" id="txtPassword2" value="<?=$_POST["txtPassword2"];?>" maxlength="100"></td>
</tr>
<tr>
<td valign="top">ชื่อ-นามสกุล <font color="#FF0000">** </font></td>
<td><input name="txtName" type="text" class="txtbox" id="txtName" value="<?=$_POST["txtName"];?>" size="30" maxlength="150">
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input name="Submit" type="submit" class="button" value="บันทึก">
<input name="Cancel" type="button" class="button" id="Cancel" value="ยกเลิก" onClick="window.location='employee.php';"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table></td>
</tr>
</tbody>
</table>
</form>