Viewing file: umEditUser.php (3.91 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? include_once("pagebody.php"); pageHeader(); $pageTitle="แก้ไขข้อมูลผู้ใช้งานระบบ"; ?> <table width=100% class="pageTitleBgColor" align="center"> <tr><td align=center><? echo $pageTitle; ?></td></tr> </table> <!--your code here--------------------------------------------------------------------------> <? include_once("clsUmQuestion.php"); include_once("clsUmUser.php"); include_once("clsUmGroup.php"); include_once("clsUmUserGroup.php"); include_once("clsUmWgroup.php"); $oC = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB'], $GLOBALS['USER'], $GLOBALS['PASSWORD']); $oUs = new umuser($oC); $oGp = new umgroup($oC); $oQ = new umquestion($oC); $oUg = new umusergroup($oC); $oWg = new umwgroup($oC); $oTbl = new clsTable(); $oTbl->align="center";
$oUs->SearchByKey($UsID); $oUs->GetRecord(); ?> <br> <form name="form1" method=post action="processUmUser.php"> <input type="hidden"name="method" value="edit"> <? $oTbl->addRow(array("","<input type=hidden name=UsID value=$UsID>")); $oTbl->addRow(array("รหัสผู้ใช้","<input type=\"text\" name=\"UsPsCode\" value=\"$oUs->UsPsCode\" readonly=readonly>*(รหัสบุคลากร/รหัสนักศึกษา)")); $oTbl->addRow(array("ชื่อ-สกุล","<input type=\"text\" name=\"UsName\" value=\"$oUs->UsName\" size=\"30\" maxlength=\"50\">")); $oTbl->addRow(array("กลุ่มผู้ใช้",$oWg->selectHTML("UsWgID", $oUs->UsWgID)."*")); $oTbl->addRow(array("ชื่อผู้ใช้","<input type=text name=UsLogin value=$oUs->UsLogin readonly=readonly size=\"30\" maxlength=\"20\">* ห้ามแก้ไข")); $oTbl->addRow(array("รหัสผ่าน"," <input type=\"hidden\" name=\"oldMd5UsPassword\" value=\"$oUs->UsPassword\"> <input type=\"password\" name=\"UsPassword\" value=\"PaSsWoRd\" size=\"30\" maxlength=\"20\">* ไม่เกิน 20 ตัวอักษร")); $oTbl->addRow(array("ยืนยันรหัสผ่าน","<input type=\"password\" name=\"ConfirmPassword\" value=\"PaSsWoRd\" size=\"30\" maxlength=\"20\">* ไม่เกิน 20 ตัวอักษร")); $oTbl->addRow(array("เลือกคำถามส่วนตัว",$oQ->selectHTML("UsQsID", $oUs->UsQsID))); $oTbl->addRow(array("คำตอบ","<input type=\"text\" name=\"UsAnswer\" value=\"$oUs->UsAnswer\" size=\"40\" maxlength=\"40\">*")); $oTbl->addRow(array("e-mail","<input type=\"text\" name=\"UsEmail\" value=\"$oUs->UsEmail\" size=\"40\" maxlength=\"40\">*")); $oTbl->addRow(array("หมายเหตุ","<textarea name=\"UsDesc\" rows=\"5\" cols=\"40\">$oUs->UsDesc</TextArea>")); $chk = ($oUs->UsActive==1) ? "checked": ""; $oTbl->addRow(array("","<input type=checkbox name=UsActive $chk>Active")); $chk = ($oUs->UsAdmin==1) ? "checked": ""; $oTbl->addRow(array("","<input type=checkbox name=UsAdmin $chk>Administrator")); $oTbl->rowStart(1, "#eeeeee"); $oTbl->addCell("กลุ่มระบบงาน"); $oGp->RSumgroupOrderStID(); while ($oGp->GetRecord()){ $s.="<input type=checkbox name=GpID[] value=".$oGp->GpID; $oUg->SearchByKey($oGp->GpID,$oUs->UsID); if ($oUg->GetRowSelected()>0) $s.=" checked"; $s.=">$oGp->GpNameT<br>\n"; } $oTbl->addCell($s); $oTbl->rowEnd();
$oTbl->addRow(array("","<input type=\"button\" value=\"บันทึก\" onclick=\"doSave(form1)\">")); //$oTbl->addRow(array("","")); echo $oTbl->output(); ?> </form> <br> <!---------------------------------------------------------------------> <? pageFooter(); ?> <!---------------------------------------------------------------------> <!--put javascript here--> <script language="javascript"> function doSave(f){ //if (IsEmpty(f.UsPsCode, "กรุณาป้อนรหัสผู้ใช้")) return 0; if (IsEmpty(f.UsWgID, "กรุณาเลืกกลุ่มผู้ใช้")) return 0; if (IsEmpty(f.UsLogin, "กรุณาป้อน ชื่อล๊อกอิน")) return 0; if (IsEmpty(f.UsPassword, "กรุณาป้อน รหัสผ่าน")) return 0; if (IsEmpty(f.ConfirmPassword, "กรุณาป้อน ยืนยันรหัสผ่าน")) return 0; if (f.UsPassword.value!=f.ConfirmPassword.value){ alert('รหัสผ่านไม่เหมือนกัน'); return 0; } if (IsEmpty(f.UsQsID, "กรุณาเลือกคำถาม")) return 0; if (IsEmpty(f.UsAnswer, "กรุณาป้อน คำตอบ")) return 0; if (IsEmpty(f.UsEmail, "กรุณาป้อน อีเมล์")) return 0;
f.submit(); } function selectDate(fld){ return 1; } //document.form1.StNameT.focus();
</script>
|