include_once("pagebody.php");
pageHeader();
$pageTitle="รายชื่อผู้ใช้";
?>
include_once("clsUmUser.php");
include_once("clsUmWgroup.php");
include_once("clsUmGroup.php");
include_once("clsUmUserGroup.php");
$oC = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB'], $GLOBALS['USER'], $GLOBALS['PASSWORD']);
$oUs = new umuser($oC);
$oGp = new umGroup($oC);
$oUg = new umusergroup($oC);
$oWg = new umwgroup($oC);
$oGp->RSumgroup();
$aGp = array();
while($oGp->GetRecord()){
$aGp += array($oGp->GpID=>$oGp->GpNameT);
}
$oGp->Close();
$oUs->SearchByNameWGroup($loginname, $name, $UsWgID);
?>
//set num row per page
if($nrpp=="")
$oUs->rowPerPage=30;
else
$oUs->rowPerPage=$nrpp;
if ($pg=="") $pg=1;
$oUs->gotoPage($pg);
//$oTbl = new clsTable(array("#","รหัสผู้ใช้","ชื่อ-สกุล","ชื่อผู้ใช้","กลุ่มผู้ใช้","กลุ่มงาน","ดำเนินการ"));
$oTbl = new clsTable(array("#","รหัสผู้ใช้","ชื่อ-นามสกุล","ชื่อเข้าใช้ระบบ","กลุ่มงาน","ดำเนินการ"));
$oTbl->align="center";
$oTbl->headerBgColor="#dddddd";
$i=$oUs->frRowNum+1;
$j=0;
while ($oUs->GetRecord()){
$oTbl->rowStart($i%2);
//$oTbl->addCell($oUs->UsID ,"center");
$j++;
$oTbl->addCell($j ,"center");
$oTbl->addCell($oUs->UsPsCode);
$oTbl->addCell($oUs->UsName);
$oTbl->addCell($oUs->UsLogin);
// $oWg->SearchByKey($oUs->UsWgID);
// $oWg->GetRecord();
//$oTbl->addCell($oWg->WgNameT);
$ss="";
$oUg->RSgroupByUs($oUs->UsID);
while ($oUg->GetRecord()){
$oGp->SearchByKey($oUg->UgGpID);
$oGp->GetRecord();
$ss.=$oGp->GpNameT."
";
}
$oTbl->addCell($ss);
/* $s="UsID . "\">
UsLogin', $oUs->UsID)\" >
UsID . "\">
UsID . "\">
UsID . "\">
UsActive==1)
$s.="images/useractive.png\" ";
else
$s.="images/userlock.gif\" ";
$s.="alt=\"set/unset active\" border=\"0\">";
$oTbl->addCell($s,"center");
$oTbl->rowEnd();
$i++;
}
$oTbl->rowStart(0,$oTbl->footerBgColor);
$oTbl->addCell(" ","","",5);
/*$oTbl->addCell("
","center");
*/
$oTbl->addCell(" ","center");
$oTbl->rowEnd();
$oTbl->rowStart();
$s="";
$mxPage=$oUs->numPages();
for ($i=1; $i<=$mxPage; $i++){
$s.="";
if ($i==$pg)
$s.=" $i ";
else
$s.=" $i ";
$s.=" ";
if ($i % 30 ==0) $s.="
";
}
$oTbl->addCell($s,"center","",6);
$oTbl->rowEnd();
echo $oTbl->output();
//echo "";
////////////////////////
?>
$oUs->Close();
pageFooter();
?>