Hacked By AnonymousFox
Current Path : C:/AppServ/www/stat/ |
|
Current File : C:/AppServ/www/stat/1edit.php |
<?
include"connect.php";
include("function.php");
include("register_global.php");
$Id=$_GET["Id"];
$sql="select * from staff where Id='$Id'";
$query=mysql_query($sql);
$row=mysql_fetch_array($query);
?>
<!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" />
<title>:: Application เก็บสถิติข้อมูลบุคลากร ::</title>
<link href="../register_thaimed/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
background-color: #CCCCCC;
}
-->
</style>
<!-- import the calendar script -->
<link rel="stylesheet" type="text/css" href="../register_thaimed/myCalendarStyle.css">
<script type="text/javascript" src="../register_thaimed/calendar/lib/calendar.js"></script>
<script type="text/javascript" src="../register_thaimed/calendar/lib/lang/calendar-th.js"></script>
<script type="text/javascript" src="../register_thaimed/calendar/lib/loadcalendar.js"></script>
<style type="text/css">
<!--
.style31 { font-size: 16px;
font-weight: bold;
}
.style31 { font-size: 16px;
font-weight: bold;
}
.inputlogin {
background:#056839;
font-family:Tahoma, Geneva, sans-serif;
font-size:16px;
padding: 5px 10px 5px 10px;
color: #fff;
font-weight: bold;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
border-bottom: 1px solid rgba(0,0,0,0.25);
cursor: pointer;
border-left:none;
border-top:none;
margin:10px 0 10px 0;
}
-->
</style>
<script language="javascript">
function show_table(id) {
if(id == 1) { // ถ้าเลือก radio button 1 ให้โชว์ table 1 และ ซ่อน table 2
document.getElementById("table1").style.display = "";
document.getElementById("table2").style.display = "none";
} else if(id == 2) { // ถ้าเลือก radio button 2 ให้โชว์ table 2 และ ซ่อน table 1
document.getElementById("table1").style.display = "none";
document.getElementById("table2").style.display = "";
}else if(id == 3) { // ถ้าเลือก radio button 2 ให้โชว์ table 2 และ ซ่อน table 1
document.getElementById("table1").style.display = "none";
document.getElementById("table2").style.display = "";
}else if(id == 4) { // ถ้าเลือก radio button 2 ให้โชว์ table 2 และ ซ่อน table 1
document.getElementById("table1").style.display = "none";
document.getElementById("table2").style.display = "";
}
}
function show_table1(id) {
if(id == 1) { // ถ้าเลือก radio button 1 ให้โชว์ table 1 และ ซ่อน table 2
document.getElementById("tableo").style.display = "none";
} else if(id == 2) { // ถ้าเลือก radio button 2 ให้โชว์ table 2 และ ซ่อน table 1
document.getElementById("tableo").style.display = "none";
}else if(id == 3) { // ถ้าเลือก radio button 2 ให้โชว์ table 2 และ ซ่อน table 1
document.getElementById("tableo").style.display = "none";
}else if(id == 4) { // ถ้าเลือก radio button 2 ให้โชว์ table 2 และ ซ่อน table 1
document.getElementById("tableo").style.display = "";
document.getElementById('inputOther').focus();
}
}
function show_table3(id) {
if(id == 1) { // ถ้าเลือก radio button 1 ให้โชว์ table 1 และ ซ่อน table 2
document.getElementById("tableo1").style.display = "none";
} else if(id == 2) { // ถ้าเลือก radio button 2 ให้โชว์ table 2 และ ซ่อน table 1
document.getElementById("tableo1").style.display = "none";
}
}
function show_tableadd(id) {
if(id == 1) { // ถ้าเลือก radio button 1 ให้โชว์ table 1 และ ซ่อน table 2
document.getElementById("tableadd1").style.display = "none";
}
if(id == 2) { // ถ้าเลือก radio button 1 ให้โชว์ table 1 และ ซ่อน table 2
document.getElementById("tableadd1").style.display = "";
}
}
function CheckNum(){
if (event.keyCode < 48 || event.keyCode > 57){
event.returnValue = false;
}
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="49%" height="100" align="right" bgcolor="#C6ECD9"><img src="logo.png" width="120" height="120" onclick="window.location='datalist.php'" style="cursor:pointer" /></td>
<td width="51%" align="left" bgcolor="#C6ECD9"><span class="style31"><strong>Application เก็บสถิติข้อมูลบุคลากร</strong></span></td>
</tr>
<tr>
<td colspan="2" align="center" valign="top" bgcolor="#B9CADA"><br />
<table width="98%" border="1" align="center" style="border-collapse:collapse" bordercolor="#8EADBF" cellpadding="10">
<tr>
<td width="83%" valign="top" bgcolor="#FFFFFF"><p>
<div align="center"><input type="submit" name="button22" id="button22" class="inputlogin" value="กลับหน้าหลัก" onclick="window.location='menu.php'" /></div>
</p>
<? ###################################################
if($action=="add") {
$sqlchk="update staff set Prefix='$inputPrefix$inputOther',Name='$inputfname',Lname='$inputsurname',Position='$inputposition',Level='$inputlevel',Gwork='$inputgroup',Dept='$inputdept',Part='$inputr$inputro' where Id='$Idedit'";
$querychk=mysql_query($sqlchk);
echo"<br />
<br />
<br />
<br /><table width=400 height=100 border=1 bordercolor=#C6ECD9 align=center cellpadding=0 cellspacing=0 bgcolor=#EFEFEF>
<tr>
<td height=100><div align=center><span class=table_footer style1><br>
ระบบได้บันทึกข้อมูลเรียบร้อยแล้ว</span><br>
<br />
<br />
<form id=form1 name=form1 method=post action=2.php>
<input type=image src=btn-submit.gif name=Image15112 width=57 height=20 border=0 id=Image15 style=cursor:pointer; />
</form>
<br>
</div></td>
</tr>
</table>"; ?><br />
<br />
<br />
<br /><? } else { ?>
<table border="1" bordercolor="#003300" style="border-collapse:collapse" width="90%" align="center" cellpadding="10" >
<form method="post" name="myForm" id="myForm" enctype="multipart/form-data" >
<input name="action" id="action" type="hidden" value="add" />
<input name="Idedit" id="Idedit" type="hidden" value="<?=$Id?>" />
<tr>
<td colspan="2" valign="top" bgcolor="#C6ECD9"><div align="center"><strong><a href="1.php">แก้ไขประวัติ</a></strong></div></td>
</tr>
<tr>
<td width="22%" valign="top"><div align="left">
<p><strong>คำนำหน้า</strong></p>
</div></td>
<td width="78%"><table border="0">
<tr>
<td><input name="inputPrefix" type="radio" value="1" onclick="show_table1(this.value);" <? if($row[Prefix]=="1"){?> checked="checked" <? } ?>/>
<span class="mytext_bold">นาย</span>
<input name="inputPrefix" type="radio" value="2" onclick="show_table1(this.value);" <? if($row[Prefix]=="2"){?> checked="checked" <? } ?>/>
<span class="mytext_bold">นางสาว</span>
<input name="inputPrefix" type="radio" value="3" onclick="show_table1(this.value);" <? if($row[Prefix]=="3"){?> checked="checked" <? } ?>/>
นาง
<input name="inputPrefix" type="radio" value="4" onclick="show_table1(this.value);" <? if($row[Prefix]=="4"){?> checked="checked" <? } ?>/>
อื่น ๆ</td>
<td align="left"><table width="100%" border="0" id="tableo" style="display:none">
<tr>
<td><input type="text" name="inputOther" id="inputOther" <? if($row[Prefix]=="อื่น ๆ"){?>value="<?=$row[Prefix]?>"<? } ?> /></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td><div align="left">
<p><strong>ชื่อ</strong></p>
</div></td>
<td><div align="left">
<input name="inputfname" type="text" id="inputfname" style="border:1px; padding:1px;border-style: solid ; border-color: #dbdee1;" value="<?=$row[Name]?>" />
</div></td>
</tr>
<tr>
<td><div align="left"><strong>นามสกุล</strong></div></td>
<td><div align="left">
<input name="inputsurname" type="text" id="inputsurname" style="border:1px; padding:1px;border-style: solid ; border-color: #dbdee1;" value="<?=$row[Lname]?>" />
</div></td>
</tr>
<tr>
<td><div align="left"><strong>ตำแหน่ง</strong></div></td>
<td><input name="inputposition" type="text" id="inputposition" style="border:1px; padding:1px;border-style: solid ; border-color: #dbdee1;" value="<?=$row[Position]?>" /></td>
</tr>
<tr>
<td><div align="left"><strong>ระดับ</strong></div></td>
<td><input name="inputlevel" type="text" id="inputlevel" style="border:1px; padding:1px;border-style: solid ; border-color: #dbdee1;" value="<?=$row[Level]?>" /></td>
</tr>
<tr>
<td><div align="left"><strong>กลุ่มงาน</strong></div></td>
<td><input name="inputgroup" type="text" id="inputgroup" style="border:1px; padding:1px;border-style: solid ; border-color: #dbdee1;" value="<?=$row[Gwork]?>" /></td>
</tr>
<tr>
<td><div align="left"><strong>ฝ่าย</strong></div></td>
<td><input name="inputdept" type="text" id="inputdept" style="border:1px; padding:1px;border-style: solid ; border-color: #dbdee1;" value="<?=$row[Dept]?>" /></td>
</tr>
<tr>
<td><div align="left"><strong>สังกัดส่วนราชการ</strong></div></td>
<td><strong>
<input name="inputr" type="text" id="inputr" style="border:1px; padding:1px;border-style: solid ; border-color: #dbdee1;" value="<?=$row[Part]?>" />
อื่น ๆ
<input name="inputro" type="text" id="inputro" style="border:1px; padding:1px;border-style: solid ; border-color: #dbdee1;" />
</strong></td>
</tr>
<tr>
<td colspan="2"><div align="center"><br />
<input type="submit" name="button2" id="button2" class="inputlogin" value="บันทึกข้อมูล">
<br />
<br />
</div></td>
</tr>
</form>
</table>
<? } ?>
</td>
</tr>
</table>
<br /></td>
</tr>
</table>
</body>
</html>
Hacked By AnonymousFox1.0, Coded By AnonymousFox