Database Server
Database Name
User name
Password

RSStudent(); $oC->BeginTrans(); echo "\n"; echo "\n"; $i=0; while ($oS->GetRecord()){ //อ่านทุกคนจากตารางนักศึกษา echo ""; echo "\n"; } //while echo "\n"; echo "
อาจายร์/เจ้าหน้าที่ดำเนินการ
$oS->studentCode :: $oS->studentNameSurname"; $oUm->searchByUserLogin($oS->studentCode); //หาตามรหัสนิสิต if (!$oUm->GetRecord()){ //ถ้าไม่มีใน um $oU->addNewUser($oS->studentCode, $oS->studentNameSurname, 6, 1, $oS->studentCode,$oS->studentCode); echo "เพิ่มใหม่ "; }else{ //มีใน um if ($oS->studentStatus<>7){ //สถานะ อยู่ $sql = "update umuser set UsPassword='" . md5("O]O".$oS->studentCode."O[O") . "', UsName='$oS->studentNameSurname', UsActive=1 where UsLogin='$oS->studentCode'"; $oC->Execute($sql); echo "ปรับปรุงสถานะเป็น active"; }else{ //สถานะ ไม่อยู่ ออก กะเสียน $sql = "update umuser set UsPassword='" . md5("O]O".$oS->studentCode."O[O") . "', UsName='$oS->studentNameSurname', UsActive=0 where UsLogin='$oS->studentCode'"; $oC->Execute($sql); echo "ปรับปรุงสถานะเป็น No active"; } } $i++; echo "

จำนวนทั้งสิ้น $i รายการ
\n"; $oC->CommitTrans(); } ?>