Viewing file: add_user3.php (4.38 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
session_start();
include_once('config.php');
chkLogin();
getFullName($_SESSION[uid], $_SESSION[gid]);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="style.css" rel="stylesheet" type="text/css">
<title>-== : ยินดีต้อนรับระบบ Intranet BCNU : ==-</title>
</head>
<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">
<table width="755" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="center"><?php include("header.php");?></td>
</tr>
<tr>
<td colspan="2" background="images/bg_table.png" height="30"><div align="right" class="f3">
ยินดีต้อนรับ คุณ <?=getFullName($_SESSION[gid]); ?>
</div></td>
</tr>
<tr>
<td width="30%" bgcolor="#FFEECC"> </td>
<td bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#FFEECC"><?php include("menu_admin.php");?></td>
<td valign="top" bgcolor="#FFFFFF">
<?php connDB(); ?>
<?php
if ($submit) {
$pwdCrypt = crypt($pwd);
$sql="insert into person (uid, password, prefix, fname, lname, address, email, gid) values
('$username','$pwdCrypt','$prefix','$fname','$lname','$address','$email','$level')";
$result=mysql_query($sql);
echo "<script>alert('บันทึกข้อมูลเรียบร้อยแล้ว');window.location.href='add_user.php' ;</script>";
} else {
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E3F0FC">
<tr>
<td height="25" colspan="2"><div align="center" class="f7">Add User </div></td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF" class="f7"><div align="right"> ชื่อเข้าระบบ </div></td>
<td height="30" bgcolor="#FFFFFF"><input name="username" type="text" id="username"></td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF" class="f7"><div align="right">รหัสผ่าน </div></td>
<td height="30" bgcolor="#FFFFFF"><input name="pwd" type="text" id="pwd"></td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF" class="f7"><div align="right">คำนำหน้าชื่อ </div></td>
<td height="30" bgcolor="#FFFFFF"><select name="prefix" id="prefix">
<option>นาย</option>
<option>นาง</option>
<option>นางสาว</option>
</select> </td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF" class="f7"><div align="right">ชื่อ </div></td>
<td height="30" bgcolor="#FFFFFF"><input name="fname" type="text" id="fname"></td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF" class="f7"><div align="right">นามสกุล </div></td>
<td height="30" bgcolor="#FFFFFF"><input name="lname" type="text" id="lname"></td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF" class="f7"><div align="right">ที่อยู่ </div></td>
<td height="30" bgcolor="#FFFFFF"><input name="address" type="text" id="address"></td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF" class="f7"><div align="right">อี-เมลล์ </div></td>
<td height="30" bgcolor="#FFFFFF"><input name="email" type="text" id="email"></td>
</tr>
<tr>
<td width="50%" height="30" bgcolor="#FFFFFF" class="f7"><div align="right">ระดับผู้ใช้งาน </div></td>
<td width="50%" height="30" bgcolor="#FFFFFF"><select name="level" id="level">
<option>1</option>
<option>2</option>
</select><span class="f6"> 1. ผู้แลระบบ 2.ผู้ใช้งานทั่วไป</span></td>
</tr>
<tr>
<td height="50" colspan="2" bgcolor="#FFFFFF" align="center"><input name="submit" type="submit" id="submit" value="Add User"></td>
</tr>
</table></form><? } ?></td>
</tr>
<tr>
<td bgcolor="#FFEECC"> </td>
<td bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td bgcolor="#FFEECC"> </td>
<td bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td bgcolor="#FFEECC"> </td>
<td bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td bgcolor="#FFEECC"> </td>
<td bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td colspan="2" align="center"><?php include("footer.php");?></td>
</tr>
</table>
</body>
</html>
|