|
|
|
ช่วยหน่อยค่ะ เรื่องจดจำชื่อตอนอ็อคอินค่ะ พอเข้าหน้าเซฟแก้ไขข้อมูลแล้วชื่อมันดันหายไปค่ะ |
|
|
|
|
|
|
|
คือว่าได้ทำหน้าอ็อคอินก่อนเข้าเว็บไซต์ พอเข้ามาถึงหน้าเว็บไวต์ก็ยังคงชื่อล็อคอินไว้ว่า สวัสดีคุณ...
ทีนี้ก้ได้ทำการเปลี่ยนข้อมูลสมาชิกที่หน้าedit_profile.php แล้วกดเซฟซึ่งจะส่งไปยังหน้า save_profile.php
พอเซฟเสร็จแล้ว หน้าsave_profileมันดันไม่ขึ้นว่าคุณ...แล้ว อยากรู้ว่าต้องแก้ที่ตรงไหนอ่ะค่ะ ขอบคุณค่ะ
edit_profile.php
Code (PHP)
<?
@session_start();
if($_SESSION['User_id'] == "")
{
echo "Please Login!";
exit();
}
mysql_connect("localhost","root","543210");
mysql_select_db("EHR_DB");
$strSQL = "SELECT * FROM User_account WHERE User_id = '".$_SESSION['User_id']."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
$strSQL2 = "SELECT * FROM Officer WHERE User_id = '".$_SESSION['User_id']."' ";
$objQuery2 = mysql_query($strSQL2);
$objResult2 = mysql_fetch_array($objQuery2);
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>E-hr</title>
<style type="text/css">
<!--
#apDiv1 {
margin:0 auto;
width:800px;
height:950px;
z-index:1;
}
#apDiv2 {
position:absolute;
width:800px;
height:252px;
z-index:1;
top: 16px;
background-color: #99FFFF;
}
#apDiv3 {
position:absolute;
width:800px;
height:40px;
z-index:7;
top: 264px;
background-color: #66E0FF;
}
#apDiv4 {
position:absolute;
width:200px;
height:698px;
z-index:3;
top: 40px;
background-color: #BBEEFF;
}
#apDiv5 {
position:absolute;
width:599px;
height:698px;
z-index:4;
left: 200px;
top: 40px;
background-color: #CCFFFF;
}
#apDiv6 {
position:absolute;
width:800px;
height:95px;
z-index:5;
left: 0px;
top: 738px;
background-color: #66E0FF;
}
body {
background-image: url(images/bg.png);
}
#apDiv7 {
position:absolute;
width:135px;
height:116px;
z-index:1;
left: 31px;
top: 19px;
}
#apDiv8 {
position:absolute;
width:149px;
height:115px;
z-index:7;
left: 28px;
top: 157px;
}
#apDiv9 {
position:absolute;
width:546px;
height:624px;
z-index:1;
left: 29px;
top: 34px;
}
#apDiv10 {
position:absolute;
width:509px;
height:63px;
z-index:1;
left: 148px;
top: 19px;
font-family:Verdana, Geneva, sans-serif;
}
#apDiv40 {
position:absolute;
width:250px;
height:63px;
z-index:1;
left: 534px;
top: 16px;
font-family:Verdana, Geneva, sans-serif;
}
#apDiv10 a{
text-decoration:none;
color:#FFF;
}
#apDiv10 a:hover,a:visited{
text-decoration:underline;
color:#FFF;
}
-->
</style>
</head>
<body>
<div id="apDiv1">
<div id="apDiv2"></img>header
<div id="apDiv40">
<div align="left">
ยินดีต้อนรับ คุณ
<?=$objResult["User_id"];?>
<br> <br>
<a href="edit_profile.php">แก้ไขข้อมูลส่วนตัว</a><br>
<a href="logout.php">ออกจากระบบ</a>
</div>
</div>
</div>
<div id="apDiv3">
<!-- Begin Vista-Buttons.com -->
<link href="hor-files/styles_iik27.css" type="text/css" rel="stylesheet"/>
<ul id="vbUL_dik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="report.php" title="ข้อมูลการลาของพนักงาน" target="_self">ข้อมูลการลาของพนักงาน</a></li></ul>
<ul id="vbUL_7ik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="manage.php" title="ข้อมูลผู้ใช้ระบบ" target="_self">ข้อมูลผู้ใช้ระบบ</a></li>
<li><a href="depart.php" title="ข้อมูลแผนก" target="_self">ข้อมูลแผนก</a></li>
<li><a href="posit.php" title="ข้อมูลตำแหน่งงาน" target="_self">ข้อมูลตำแหน่งงาน</a></li></ul>
<script type="text/javascript" src="hor-files/sciik27.js"></script>
<table id="vista-buttons.com:idiik27" width=0 cellpadding=0 cellspacing=0 border=0><tr><td style="padding-right:0px" title ="">
<a href="InOut.php" onMouseOver='xpe("iik27o");' onMouseOut='xpe("iik27n");' onMouseDown='xpe("iik27c");'><img id="xpi_iik27" src="hor-files/btiik27_0.gif" name=vbiik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="absence.php" onMouseOver='xpe("1ik27o");' onMouseOut='xpe("1ik27n");' onMouseDown='xpe("1ik27c");'><img id="xpi_1ik27" src="hor-files/bt1ik27_0.gif" name=vb1ik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="upload.php" onMouseOver='xpe("cik27o");' onMouseOut='xpe("cik27n");' onMouseDown='xpe("cik27c");'><img id="xpi_cik27" src="hor-files/btcik27_0.gif" name=vbcik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="report.php" onMouseOver='xpe("dik27o");xpshow("dik27",0,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("dik27c");'><img id="xpi_dik27" src="hor-files/btdik27_0.gif" name=vbdik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="manage" onMouseOver='xpe("7ik27o");xpshow("7ik27",0,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("7ik27c");'><img id="xpi_7ik27" src="hor-files/bt7ik27_0.gif" name=vb7ik27 width="120" height="40" border=0 alt=""></a></td></tr></table>
<!-- End Vista-Buttons.com -->
<div id="apDiv4">
<div id="apDiv7"><center>
<!-- Begin Vista-Buttons.com -->
<link href="ver-files/styles_iik27.css" type="text/css" rel="stylesheet"/>
<ul id="vbUL_dik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="report.php" title="ข้อมูลการลาของพนักงาน" target="_self">ข้อมูลการลาของพนักงาน</a></li></ul>
<ul id="vbUL_7ik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="manage.php" title="ข้อมูลผู้ใช้ระบบ" target="_self">ข้อมูลผู้ใช้ระบบ</a></li>
<li><a href="depart.php" title="ข้อมูลแผนก" target="_self">ข้อมูลแผนก</a></li>
<li><a href="posit.php" title="ข้อมูลตำแหน่งงาน" target="_self">ข้อมูลตำแหน่งงาน</a></li></ul>
<script type="text/javascript" src="ver-files/sciik27.js"></script>
<table id="vista-buttons.com:idiik27" width=0 cellpadding=0 cellspacing=0 border=0><tr><td style="padding-bottom:0px" title ="">
<a href="InOut.php" onMouseOver='xpe("iik27o");' onMouseOut='xpe("iik27n");' onMouseDown='xpe("iik27c");'><img id="xpi_iik27" src="ver-files/btiik27_0.gif" name=vbiik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="absence,php" onMouseOver='xpe("1ik27o");' onMouseOut='xpe("1ik27n");' onMouseDown='xpe("1ik27c");'><img id="xpi_1ik27" src="ver-files/bt1ik27_0.gif" name=vb1ik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="upload.php" onMouseOver='xpe("cik27o");' onMouseOut='xpe("cik27n");' onMouseDown='xpe("cik27c");'><img id="xpi_cik27" src="ver-files/btcik27_0.gif" name=vbcik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="report.php" onMouseOver='xpe("dik27o");xpshow("dik27",1,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("dik27c");'><img id="xpi_dik27" src="ver-files/btdik27_0.gif" name=vbdik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="manage" onMouseOver='xpe("7ik27o");xpshow("7ik27",1,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("7ik27c");'><img id="xpi_7ik27" src="ver-files/bt7ik27_0.gif" name=vb7ik27 width="120" height="40" border=0 alt=""></a></td></tr></table>
<!-- End Vista-Buttons.com -->
</center></div>
</div>
<div id="apDiv5">
<div id="apDiv9">
<form name="form1" method="post" action="save_profile.php">
แก้ไขข้อมูลส่วนตัวของคุณ <br>
<table width="400" border="1" style="width: 400px">
<tbody>
<tr>
<td width="125"> UserID</td>
<td width="180">
<?=$objResult["User_id"];?>
</td>
</tr>
<tr>
</tr>
<tr>
<td> Password</td>
<td><input name="User_pass" type="password" id="User_pass" value="<?=$objResult["User_pass"];?>">
</td>
</tr>
<tr>
<td> Password</td>
<td><input name="User_pass2" type="password" id="User_pass2" value="<?=$objResult["User_pass"];?>">
</td>
</tr>
<tr>
<td> Status</td>
<td>
<?=$objResult["User_level"];?>
</td>
</tr>
<tr>
<td> OfficerID</td>
<td><?=$objResult2["Off_id"];?></td>
</tr>
<tr>
<td> Firstame</td>
<td><input name="Fname" type="text" id="Fname" value="<?=$objResult2["Fname"];?>"></td>
</tr>
<tr>
<td> Lastname</td>
<td><input name="Lname" type="text" id="Lname" value="<?=$objResult2["Lname"];?>"></td>
</tr>
<tr>
<td> Sex</td>
<td><input name="Sex" type="text" id="Sex" value="<?=$objResult2["Sex"];?>"></td>
</tr>
<tr>
<td> Salary</td>
<td><?=$objResult2["Salary"];?></td>
</tr>
<tr>
<td> Address</td>
<td><input name="Address" type="text" id="Address" value="<?=$objResult2["Address"];?>"></td>
</tr>
<tr>
<td> Email</td>
<td><input name="Email" type="text" id="Email" value="<?=$objResult2["Email"];?>"></td>
</tr>
<tr>
<td> Telephone</td>
<td><input name="Tel" type="text" id="Tel" value="<?=$objResult2["Tel"];?>"></td>
</tr>
<tr>
<td> Speacial Ability</td>
<td><input name="Special_ability" type="text" id="Special_ability" value="<?=$objResult2["Special_ability"];?>"></td>
</tr>
<tr>
<td> Start_date</td>
<td><?=$objResult2["Start_date"];?></td>
</tr>
<tr>
<td> End_date</td>
<td><?=$objResult2["End_date"];?>"</td>
</tr>
<tr>
<td> Skill</td>
<td><input name="Skill" type="text" id="Skill" value="<?=$objResult2["Skill"];?>"></td>
</tr>
<tr>
<td> Research</td>
<td><input name="Research" type="text" id="Research" value="<?=$objResult2["Research"];?>"></td>
</tr>
<tr>
<td> Training</td>
<td><input name="Training" type="text" id="Training" value="<?=$objResult2["Training"];?>"></td>
</tr>
<tr>
<td> Education</td>
<td><input name="Education" type="text" id="Education" value="<?=$objResult2["Education"];?>"></td>
</tr>
</tbody>
</table>
<br>
<input type="submit" name="Submit" value="Save">
</form>
</div>
</div>
<div id="apDiv6">
<div id="apDiv10"><br />
<p align="center" style="font-size:12px;color:#FFF">
copyright©2012 designed by TNI Developer</p></div>
</div>
</div>
</body>
</html>
save_profile.php
Code (PHP)
<?
@session_start();
if($_SESSION['User_id'] == "")
{
echo "Please Login!";
exit();
}
mysql_connect("localhost","root","543210");
mysql_select_db("EHR_DB");
$password=$_REQUEST["User_pass"];
$fname=$_REQUEST["Fname"];
$lname=$_REQUEST["Lname"];
$sex=$_REQUEST["Sex"];
$address=$_REQUEST["Address"];
$email=$_REQUEST["Email"];
$tel=$_REQUEST["Tel"];
$ability=$_REQUEST["Special_ability"];
$skill=$_REQUEST["Skill"];
$research=$_REQUEST["Research"];
$training=$_REQUEST["Training"];
$education=$_REQUEST["Education"];
if($_POST["User_pass"] != $_POST["User_pass2"])
{
echo "Password not Match!";
exit();
}
$strSQL = "UPDATE User_account SET User_pass = '$password' WHERE User_id = '".$_SESSION["User_id"]."' ";
$objQuery = mysql_query($strSQL);
$strSQL2 = "UPDATE Officer SET Fname='$fname',Lname='$lname',Sex='$sex',Address='$address',Email='$email',Tel='$tel',
Special_ability='$ability',Skill='$skill',Research='$research',Training='$training',Education='$education' WHERE User_id = '".$_SESSION["User_id"]."' ";
$objQuery2 = mysql_query($strSQL2);
mysql_close();
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>E-hr</title>
<style type="text/css">
<!--
#apDiv1 {
margin:0 auto;
width:800px;
height:950px;
z-index:1;
}
#apDiv2 {
position:absolute;
width:800px;
height:252px;
z-index:1;
top: 16px;
background-color: #99FFFF;
}
#apDiv3 {
position:absolute;
width:800px;
height:40px;
z-index:7;
top: 264px;
background-color: #66E0FF;
}
#apDiv4 {
position:absolute;
width:200px;
height:698px;
z-index:3;
top: 40px;
background-color: #BBEEFF;
}
#apDiv5 {
position:absolute;
width:599px;
height:698px;
z-index:4;
left: 200px;
top: 40px;
background-color: #CCFFFF;
}
#apDiv6 {
position:absolute;
width:800px;
height:95px;
z-index:5;
left: 0px;
top: 738px;
background-color: #66E0FF;
}
body {
background-image: url(images/bg.png);
}
#apDiv7 {
position:absolute;
width:135px;
height:116px;
z-index:1;
left: 31px;
top: 19px;
}
#apDiv8 {
position:absolute;
width:149px;
height:115px;
z-index:7;
left: 28px;
top: 157px;
}
#apDiv9 {
position:absolute;
width:546px;
height:624px;
z-index:1;
left: 29px;
top: 34px;
}
#apDiv10 {
position:absolute;
width:509px;
height:63px;
z-index:1;
left: 148px;
top: 19px;
font-family:Verdana, Geneva, sans-serif;
}
#apDiv40 {
position:absolute;
width:250px;
height:63px;
z-index:1;
left: 534px;
top: 16px;
font-family:Verdana, Geneva, sans-serif;
}
#apDiv10 a{
text-decoration:none;
color:#FFF;
}
#apDiv10 a:hover,a:visited{
text-decoration:underline;
color:#FFF;
}
-->
</style>
</head>
<body>
<div id="apDiv1">
<div id="apDiv2"></img>header
<div id="apDiv40">
<div align="left">
ยินดีต้อนรับ คุณ
<?=$objResult["User_id"];?>
<br> <br>
<a href="edit_profile.php">แก้ไขข้อมูลส่วนตัว</a><br>
<a href="logout.php">ออกจากระบบ</a>
</div>
</div>
</div>
<div id="apDiv3">
<!-- Begin Vista-Buttons.com -->
<link href="hor-files/styles_iik27.css" type="text/css" rel="stylesheet"/>
<ul id="vbUL_dik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="report.php" title="ข้อมูลการลาของพนักงาน" target="_self">ข้อมูลการลาของพนักงาน</a></li></ul>
<ul id="vbUL_7ik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="manage.php" title="ข้อมูลผู้ใช้ระบบ" target="_self">ข้อมูลผู้ใช้ระบบ</a></li>
<li><a href="depart.php" title="ข้อมูลแผนก" target="_self">ข้อมูลแผนก</a></li>
<li><a href="posit.php" title="ข้อมูลตำแหน่งงาน" target="_self">ข้อมูลตำแหน่งงาน</a></li></ul>
<script type="text/javascript" src="hor-files/sciik27.js"></script>
<table id="vista-buttons.com:idiik27" width=0 cellpadding=0 cellspacing=0 border=0><tr><td style="padding-right:0px" title ="">
<a href="InOut.php" onMouseOver='xpe("iik27o");' onMouseOut='xpe("iik27n");' onMouseDown='xpe("iik27c");'><img id="xpi_iik27" src="hor-files/btiik27_0.gif" name=vbiik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="absence.php" onMouseOver='xpe("1ik27o");' onMouseOut='xpe("1ik27n");' onMouseDown='xpe("1ik27c");'><img id="xpi_1ik27" src="hor-files/bt1ik27_0.gif" name=vb1ik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="upload.php" onMouseOver='xpe("cik27o");' onMouseOut='xpe("cik27n");' onMouseDown='xpe("cik27c");'><img id="xpi_cik27" src="hor-files/btcik27_0.gif" name=vbcik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="report.php" onMouseOver='xpe("dik27o");xpshow("dik27",0,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("dik27c");'><img id="xpi_dik27" src="hor-files/btdik27_0.gif" name=vbdik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="manage" onMouseOver='xpe("7ik27o");xpshow("7ik27",0,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("7ik27c");'><img id="xpi_7ik27" src="hor-files/bt7ik27_0.gif" name=vb7ik27 width="120" height="40" border=0 alt=""></a></td></tr></table>
<!-- End Vista-Buttons.com -->
<div id="apDiv4">
<div id="apDiv7"><center>
<!-- Begin Vista-Buttons.com -->
<link href="ver-files/styles_iik27.css" type="text/css" rel="stylesheet"/>
<ul id="vbUL_dik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="report.php" title="ข้อมูลการลาของพนักงาน" target="_self">ข้อมูลการลาของพนักงาน</a></li></ul>
<ul id="vbUL_7ik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="manage.php" title="ข้อมูลผู้ใช้ระบบ" target="_self">ข้อมูลผู้ใช้ระบบ</a></li>
<li><a href="depart.php" title="ข้อมูลแผนก" target="_self">ข้อมูลแผนก</a></li>
<li><a href="posit.php" title="ข้อมูลตำแหน่งงาน" target="_self">ข้อมูลตำแหน่งงาน</a></li></ul>
<script type="text/javascript" src="ver-files/sciik27.js"></script>
<table id="vista-buttons.com:idiik27" width=0 cellpadding=0 cellspacing=0 border=0><tr><td style="padding-bottom:0px" title ="">
<a href="InOut.php" onMouseOver='xpe("iik27o");' onMouseOut='xpe("iik27n");' onMouseDown='xpe("iik27c");'><img id="xpi_iik27" src="ver-files/btiik27_0.gif" name=vbiik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="absence,php" onMouseOver='xpe("1ik27o");' onMouseOut='xpe("1ik27n");' onMouseDown='xpe("1ik27c");'><img id="xpi_1ik27" src="ver-files/bt1ik27_0.gif" name=vb1ik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="upload.php" onMouseOver='xpe("cik27o");' onMouseOut='xpe("cik27n");' onMouseDown='xpe("cik27c");'><img id="xpi_cik27" src="ver-files/btcik27_0.gif" name=vbcik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="report.php" onMouseOver='xpe("dik27o");xpshow("dik27",1,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("dik27c");'><img id="xpi_dik27" src="ver-files/btdik27_0.gif" name=vbdik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="manage" onMouseOver='xpe("7ik27o");xpshow("7ik27",1,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("7ik27c");'><img id="xpi_7ik27" src="ver-files/bt7ik27_0.gif" name=vb7ik27 width="120" height="40" border=0 alt=""></a></td></tr></table>
<!-- End Vista-Buttons.com -->
</center></div>
</div>
<div id="apDiv5">
<div id="apDiv9">
<p>บันทึกข้อมูลเรียบร้อยแล้ว</p>
<p><a href="admin_page.php">กลับไปหน้าหลัก</a></p>
</div>
</div>
<div id="apDiv6">
<div id="apDiv10"><br />
<p align="center" style="font-size:12px;color:#FFF">
copyright©2011 designed by TNI Developer</p>
</div>
</div>
</div>
</body>
</html>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2012-02-26 13:19:29 |
By :
TheCatzika |
View :
905 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Session ถ้าไม่ลบมันจะไม่หายครับ ลอง echo ค่าดูครับ ว่ามีหรือไม่
|
|
|
|
|
Date :
2012-02-26 20:13:10 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ยินดีต้อนรับ คุณ
<?=$objResult["User_id"];?>
ทำได้แล้วค่ะ ต้องเปลี่ยนเป็น <?=$_SESSION['User_id'];?>
Code (PHP)
<?
@session_start();
if($_SESSION['User_id'] == "")
{
echo "Please Login!";
exit();
}
if($_SESSION['User_level'] != "A")
{
echo "This page for Admin only!";
exit();
}
$con=mysql_connect("localhost","root","543210");
if(!$con){
die("not connect database:".mysql_error());
}
mysql_select_db("EHR_DB",$con);
$strSQL = "SELECT * FROM User_account WHERE User_id = '".$_SESSION['User_id']."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>E-hr</title>
<style type="text/css">
<!--
#apDiv1 {
margin:0 auto;
width:800px;
height:950px;
z-index:1;
}
#apDiv2 {
position:absolute;
width:800px;
height:252px;
z-index:1;
top: 16px;
background-color: #99FFFF;
}
#apDiv3 {
position:absolute;
width:800px;
height:40px;
z-index:7;
top: 264px;
background-color: #66E0FF;
}
#apDiv4 {
position:absolute;
width:200px;
height:698px;
z-index:3;
top: 40px;
background-color: #BBEEFF;
}
#apDiv5 {
position:absolute;
width:599px;
height:698px;
z-index:4;
left: 200px;
top: 40px;
background-color: #CCFFFF;
}
#apDiv6 {
position:absolute;
width:800px;
height:95px;
z-index:5;
left: 0px;
top: 738px;
background-color: #66E0FF;
}
body {
background-image: url(images/bg.png);
}
#apDiv7 {
position:absolute;
width:135px;
height:116px;
z-index:1;
left: 31px;
top: 36px;
}
#apDiv8 {
position:absolute;
width:149px;
height:115px;
z-index:7;
left: 28px;
top: 157px;
}
#apDiv9 {
position:absolute;
width:546px;
height:624px;
z-index:1;
left: 29px;
top: 34px;
}
#apDiv10 {
position:absolute;
width:509px;
height:63px;
z-index:1;
left: 148px;
top: 19px;
font-family:Verdana, Geneva, sans-serif;
}
#apDiv40 {
position:absolute;
width:250px;
height:63px;
z-index:1;
left: 534px;
top: 16px;
font-family:Verdana, Geneva, sans-serif;
}
#apDiv10 a{
text-decoration:none;
color:#FFF;
}
#apDiv10 a:hover,a:visited{
text-decoration:underline;
color:#FFF;
}
-->
</style>
</head>
<body>
<div id="apDiv1">
<div id="apDiv2"></img>header
<div id="apDiv40">
<div align="left">
ยินดีต้อนรับ คุณ
<?=$_SESSION['User_id'];?>
<br> <br>
<a href="edit_profile.php">แก้ไขข้อมูลส่วนตัว</a><br>
<a href="logout.php">ออกจากระบบ</a>
</div>
</div>
</div>
<div id="apDiv3">
<!-- Begin Vista-Buttons.com -->
<link href="hor-files/styles_iik27.css" type="text/css" rel="stylesheet"/>
<ul id="vbUL_dik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="report.php" title="ข้อมูลการลาของพนักงาน" target="_self">ข้อมูลการลาของพนักงาน</a></li></ul>
<ul id="vbUL_7ik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="manage.php" title="ข้อมูลผู้ใช้ระบบ" target="_self">ข้อมูลผู้ใช้ระบบ</a></li>
<li><a href="depart.php" title="ข้อมูลแผนก" target="_self">ข้อมูลแผนก</a></li>
<li><a href="posit.php" title="ข้อมูลตำแหน่งงาน" target="_self">ข้อมูลตำแหน่งงาน</a></li></ul>
<script type="text/javascript" src="hor-files/sciik27.js"></script>
<table id="vista-buttons.com:idiik27" width=0 cellpadding=0 cellspacing=0 border=0><tr><td style="padding-right:0px" title ="">
<a href="InOut.php" onMouseOver='xpe("iik27o");' onMouseOut='xpe("iik27n");' onMouseDown='xpe("iik27c");'><img id="xpi_iik27" src="hor-files/btiik27_0.gif" name=vbiik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="absence.php" onMouseOver='xpe("1ik27o");' onMouseOut='xpe("1ik27n");' onMouseDown='xpe("1ik27c");'><img id="xpi_1ik27" src="hor-files/bt1ik27_0.gif" name=vb1ik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="upload.php" onMouseOver='xpe("cik27o");' onMouseOut='xpe("cik27n");' onMouseDown='xpe("cik27c");'><img id="xpi_cik27" src="hor-files/btcik27_0.gif" name=vbcik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="report.php" onMouseOver='xpe("dik27o");xpshow("dik27",0,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("dik27c");'><img id="xpi_dik27" src="hor-files/btdik27_0.gif" name=vbdik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="manage" onMouseOver='xpe("7ik27o");xpshow("7ik27",0,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("7ik27c");'><img id="xpi_7ik27" src="hor-files/bt7ik27_0.gif" name=vb7ik27 width="120" height="40" border=0 alt=""></a></td></tr></table>
<!-- End Vista-Buttons.com -->
<div id="apDiv4">
<div id="apDiv7"><center>
<!-- Begin Vista-Buttons.com -->
<link href="ver-files/styles_iik27.css" type="text/css" rel="stylesheet"/>
<ul id="vbUL_dik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="report.php" title="ข้อมูลการลาของพนักงาน" target="_self">ข้อมูลการลาของพนักงาน</a></li></ul>
<ul id="vbUL_7ik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="manage.php" title="ข้อมูลผู้ใช้ระบบ" target="_self">ข้อมูลผู้ใช้ระบบ</a></li>
<li><a href="depart.php" title="ข้อมูลแผนก" target="_self">ข้อมูลแผนก</a></li>
<li><a href="posit.php" title="ข้อมูลตำแหน่งงาน" target="_self">ข้อมูลตำแหน่งงาน</a></li></ul>
<script type="text/javascript" src="ver-files/sciik27.js"></script>
<table id="vista-buttons.com:idiik27" width=0 cellpadding=0 cellspacing=0 border=0><tr><td style="padding-bottom:0px" title ="">
<a href="InOut.php" onMouseOver='xpe("iik27o");' onMouseOut='xpe("iik27n");' onMouseDown='xpe("iik27c");'><img id="xpi_iik27" src="ver-files/btiik27_0.gif" name=vbiik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="absence,php" onMouseOver='xpe("1ik27o");' onMouseOut='xpe("1ik27n");' onMouseDown='xpe("1ik27c");'><img id="xpi_1ik27" src="ver-files/bt1ik27_0.gif" name=vb1ik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="upload.php" onMouseOver='xpe("cik27o");' onMouseOut='xpe("cik27n");' onMouseDown='xpe("cik27c");'><img id="xpi_cik27" src="ver-files/btcik27_0.gif" name=vbcik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="report.php" onMouseOver='xpe("dik27o");xpshow("dik27",1,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("dik27c");'><img id="xpi_dik27" src="ver-files/btdik27_0.gif" name=vbdik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="manage" onMouseOver='xpe("7ik27o");xpshow("7ik27",1,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("7ik27c");'><img id="xpi_7ik27" src="ver-files/bt7ik27_0.gif" name=vb7ik27 width="120" height="40" border=0 alt=""></a></td></tr></table>
<!-- End Vista-Buttons.com -->
</center></div>
</div>
<div id="apDiv5">
<div id="apDiv9">
<?
session_start();
$sql="select * from position";
$result=mysql_query($sql);
echo "<table border=1>
<tr>
<td></td>
<td></td>
<td>รหัสตำแหน่ง</td>
<td>รหัสแผนก</td>
<td>ชื่อตำแหน่ง</td>
</tr>";
while($row=mysql_fetch_array($result)){
echo "<tr>
<td><center>
<a href=update_posit.php?Dept_id=$row[Position_id]&Dept_id=$row[Dept_id]&Position_name=$row[Position_name]>แก้ไข</a>
</center></td>
<td><center>
<a href=delete_posit.php?Dept_id=$row[Position_id]&Dept_id=$row[Dept_id]&Position_name=$row[Position_name]>ลบ</a>
</center></td>
<td>
<center>
$row[Position_id]
</center>
</td>
<td>
<center>
$row[Dept_id]
</center>
</td>
<td>
<center>
$row[Position_name]
</center>
</td>
</tr>";
}
echo "</table>";
echo "<br><br>";
echo "เพิ่มรายการตำแหน่ง";
echo "<br>";
echo "<table><form method=post action=add_posit.php>
Department ID:";
?>
<select name="dept" id="dept">
<?php
session_start();
$q="select * from department ";
$qr=mysql_query($q);
while($rs=mysql_fetch_array($qr)){
?>
<option value="<?=$rs['Dept_id']?>"><?=$rs['Dept_name']?></option>
<?php } ?>
</select>
<?
session_start();
echo "<br>
Position name: <input type=text name=Position_name>
<br>
<input type=submit value=add>
<input type=reset value=cancel>
</form></table>";
?>
</div>
</div>
<div id="apDiv6">
<div id="apDiv10"><br />
<p align="center" style="font-size:12px;color:#FFF">
copyright©2012 designed by TNI Developer</p>
</div>
</div>
</div>
</body>
</html>
Code (PHP)
<?
@session_start();
if($_SESSION['User_id'] == "")
{
echo "Please Login!";
exit();
}
if($_SESSION['User_level'] != "A")
{
echo "This page for Admin only!";
exit();
}
$con=mysql_connect("localhost","root","543210");
if(!$con){
die("not connect database:".mysql_error());
}
mysql_select_db("EHR_DB",$con);
$strSQL = "SELECT * FROM User_account WHERE User_id = '".$_SESSION['User_id']."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>E-hr</title>
<style type="text/css">
<!--
#apDiv1 {
margin:0 auto;
width:800px;
height:950px;
z-index:1;
}
#apDiv2 {
position:absolute;
width:800px;
height:252px;
z-index:1;
top: 16px;
background-color: #99FFFF;
}
#apDiv3 {
position:absolute;
width:800px;
height:40px;
z-index:7;
top: 264px;
background-color: #66E0FF;
}
#apDiv4 {
position:absolute;
width:200px;
height:698px;
z-index:3;
top: 40px;
background-color: #BBEEFF;
}
#apDiv5 {
position:absolute;
width:599px;
height:698px;
z-index:4;
left: 200px;
top: 40px;
background-color: #CCFFFF;
}
#apDiv6 {
position:absolute;
width:800px;
height:95px;
z-index:5;
left: 0px;
top: 738px;
background-color: #66E0FF;
}
body {
background-image: url(images/bg.png);
}
#apDiv7 {
position:absolute;
width:135px;
height:116px;
z-index:1;
left: 31px;
top: 36px;
}
#apDiv8 {
position:absolute;
width:149px;
height:115px;
z-index:7;
left: 28px;
top: 157px;
}
#apDiv9 {
position:absolute;
width:546px;
height:624px;
z-index:1;
left: 29px;
top: 34px;
}
#apDiv10 {
position:absolute;
width:509px;
height:63px;
z-index:1;
left: 148px;
top: 19px;
font-family:Verdana, Geneva, sans-serif;
}
#apDiv40 {
position:absolute;
width:250px;
height:63px;
z-index:1;
left: 534px;
top: 16px;
font-family:Verdana, Geneva, sans-serif;
}
#apDiv10 a{
text-decoration:none;
color:#FFF;
}
#apDiv10 a:hover,a:visited{
text-decoration:underline;
color:#FFF;
}
-->
</style>
</head>
<body>
<div id="apDiv1">
<div id="apDiv2"></img>header
<div id="apDiv40">
<div align="left">
ยินดีต้อนรับ คุณ
<?=$_SESSION['User_id'];?>
<br> <br>
<a href="edit_profile.php">แก้ไขข้อมูลส่วนตัว</a><br>
<a href="logout.php">ออกจากระบบ</a>
</div>
</div>
</div>
<div id="apDiv3">
<!-- Begin Vista-Buttons.com -->
<link href="hor-files/styles_iik27.css" type="text/css" rel="stylesheet"/>
<ul id="vbUL_dik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="report.php" title="ข้อมูลการลาของพนักงาน" target="_self">ข้อมูลการลาของพนักงาน</a></li></ul>
<ul id="vbUL_7ik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="manage.php" title="ข้อมูลผู้ใช้ระบบ" target="_self">ข้อมูลผู้ใช้ระบบ</a></li>
<li><a href="depart.php" title="ข้อมูลแผนก" target="_self">ข้อมูลแผนก</a></li>
<li><a href="posit.php" title="ข้อมูลตำแหน่งงาน" target="_self">ข้อมูลตำแหน่งงาน</a></li></ul>
<script type="text/javascript" src="hor-files/sciik27.js"></script>
<table id="vista-buttons.com:idiik27" width=0 cellpadding=0 cellspacing=0 border=0><tr><td style="padding-right:0px" title ="">
<a href="InOut.php" onMouseOver='xpe("iik27o");' onMouseOut='xpe("iik27n");' onMouseDown='xpe("iik27c");'><img id="xpi_iik27" src="hor-files/btiik27_0.gif" name=vbiik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="absence.php" onMouseOver='xpe("1ik27o");' onMouseOut='xpe("1ik27n");' onMouseDown='xpe("1ik27c");'><img id="xpi_1ik27" src="hor-files/bt1ik27_0.gif" name=vb1ik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="upload.php" onMouseOver='xpe("cik27o");' onMouseOut='xpe("cik27n");' onMouseDown='xpe("cik27c");'><img id="xpi_cik27" src="hor-files/btcik27_0.gif" name=vbcik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="report.php" onMouseOver='xpe("dik27o");xpshow("dik27",0,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("dik27c");'><img id="xpi_dik27" src="hor-files/btdik27_0.gif" name=vbdik27 width="120" height="40" border=0 alt=""></a></td><td style="padding-right:0px" title ="">
<a href="manage" onMouseOver='xpe("7ik27o");xpshow("7ik27",0,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("7ik27c");'><img id="xpi_7ik27" src="hor-files/bt7ik27_0.gif" name=vb7ik27 width="120" height="40" border=0 alt=""></a></td></tr></table>
<!-- End Vista-Buttons.com -->
<div id="apDiv4">
<div id="apDiv7"><center>
<!-- Begin Vista-Buttons.com -->
<link href="ver-files/styles_iik27.css" type="text/css" rel="stylesheet"/>
<ul id="vbUL_dik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="report.php" title="ข้อมูลการลาของพนักงาน" target="_self">ข้อมูลการลาของพนักงาน</a></li></ul>
<ul id="vbUL_7ik27" class="vbULiik27" style="visibility:hidden;">
<li><a href="manage.php" title="ข้อมูลผู้ใช้ระบบ" target="_self">ข้อมูลผู้ใช้ระบบ</a></li>
<li><a href="depart.php" title="ข้อมูลแผนก" target="_self">ข้อมูลแผนก</a></li>
<li><a href="posit.php" title="ข้อมูลตำแหน่งงาน" target="_self">ข้อมูลตำแหน่งงาน</a></li></ul>
<script type="text/javascript" src="ver-files/sciik27.js"></script>
<table id="vista-buttons.com:idiik27" width=0 cellpadding=0 cellspacing=0 border=0><tr><td style="padding-bottom:0px" title ="">
<a href="InOut.php" onMouseOver='xpe("iik27o");' onMouseOut='xpe("iik27n");' onMouseDown='xpe("iik27c");'><img id="xpi_iik27" src="ver-files/btiik27_0.gif" name=vbiik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="absence,php" onMouseOver='xpe("1ik27o");' onMouseOut='xpe("1ik27n");' onMouseDown='xpe("1ik27c");'><img id="xpi_1ik27" src="ver-files/bt1ik27_0.gif" name=vb1ik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="upload.php" onMouseOver='xpe("cik27o");' onMouseOut='xpe("cik27n");' onMouseDown='xpe("cik27c");'><img id="xpi_cik27" src="ver-files/btcik27_0.gif" name=vbcik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="report.php" onMouseOver='xpe("dik27o");xpshow("dik27",1,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("dik27c");'><img id="xpi_dik27" src="ver-files/btdik27_0.gif" name=vbdik27 width="120" height="40" border=0 alt=""></a></td></tr><tr><td style="padding-bottom:0px" title ="">
<a href="manage" onMouseOver='xpe("7ik27o");xpshow("7ik27",1,this);xpsmover(this);' onMouseOut='xpsmout(this);' onMouseDown='xpe("7ik27c");'><img id="xpi_7ik27" src="ver-files/bt7ik27_0.gif" name=vb7ik27 width="120" height="40" border=0 alt=""></a></td></tr></table>
<!-- End Vista-Buttons.com -->
</center></div>
</div>
<div id="apDiv5">
<div id="apDiv9">
<?
$dept=$_POST["dept"];
$sql="insert into position(Dept_id,Position_name) values('$dept','$position_name')";
$result=mysql_query($sql);
if($result)
{
echo "เพิ่มรายการสำเร็จ";
echo "<br>";
echo "<a href=posit.php>กลับไป</a>";
}
else
{
echo "ไม่สามารถเพิ่มรายได้";
echo "<br>";
echo "<a href=posit.php>กลับไป</a>";
}
?>
</div>
</div>
<div id="apDiv6">
<div id="apDiv10"><br />
<p align="center" style="font-size:12px;color:#FFF">
copyright©2012 designed by TNI Developer</p>
</div>
</div>
</div>
</body>
</html>
มันไม่เพิ่มรายให้อ่ะค่ะ ไม่ทราบว่าผิดตรงไหนรึป่าวคะ
|
|
|
|
|
Date :
2012-02-26 22:11:22 |
By :
TheCatzika |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|