Viewing file: umShowUser.php (4.83 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--------------------------------------------------------------------------> <br> <? 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();
$loginname = $_REQUEST['loginname']; $name = $_REQUEST['name']; $UsWgID = $_REQUEST['UsWgID']; $oUs->SearchByNameWGroup($loginname, $name, $UsWgID); ?> <form id='form1' action=umShowUser.php id ='form1' method='POST'> <table class="TableBodyBgColor" cellspacing=0 cellpadding=0 align=center border=0> <tr valign="middle" align="center"> <td ><b> ค้นหา</b> ชื่อ-นามสกุล</td> <td><input type="text" name="name" value="<?=$name?>"> </td> <td > ชื่อเข้าใช้ระบบ</td> <td><input type="text" name="loginname" value="<?=$loginname?>"> </td> <td > กลุ่มผู้ใช้</td> <td><? echo $oWg->selectHTML("UsWgID", $UsWgID)?> </td> <td colspan=4 align=center> <input type=submit value=" ค้นหา " align=center></td> </tr> </table> </form> <? //set num row per page $oUs->rowPerPage=($nrpp=="")? 30 : $nrpp ;
//if (! session_is_registered ("currpg")){ //session_register("currpg");
$pg = $_GET['pg']; 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; $j=$oUs->rowPerPage*($pg-1)+1; while ($oUs->GetRecord()){ $oTbl->rowStart($i%2); //$oTbl->addCell($oUs->UsID ,"center"); $oTbl->addCell($j ,"center"); $oTbl->addCell($oUs->UsPsCode); $oTbl->addCell($oUs->UsName); $oTbl->addCell($oUs->UsLogin); $j++; // $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.="<a href=\"umPermission.php?UsID=" . $oUs->UsID . "&UgGpID=" . $oUg->UgGpID . "\" title=\"กำหนดสิทธิ์การใช้รายคน\">".$oGp->GpNameT."</a><br>"; } $oTbl->addCell($ss); /*$s="<a href=\"umEditUser.php?UsID=" . $oUs->UsID . "\"><img src=\"images/edit.gif\" alt=\"แก้ไข\" border=\"0\"></a> <a href='#' onClick=\"doDelete(document.form1, '$oUs->UsLogin', $oUs->UsID)\" ><img src=\"images/del.gif\" alt=\"ลบ\" border=\"0\"></a> <a href=\"umPermission1.php?UsID=" . $oUs->UsID . "\"><img src=\"images/menu.gif\" alt=\"กำหนดสิทธิ์การใช้รายคน\" border=\"0\"></a> <img src=\"";*/ $s="<a href=\"umEditUser.php?UsID=" . $oUs->UsID . "\"><img src=\"images/edit.gif\" alt=\"แก้ไข\" border=\"0\"></a> <a href='#' onClick=\"doDelete(document.form1, '$oUs->UsLogin', $oUs->UsID)\" ><img src=\"images/del.gif\" alt=\"ลบ\" border=\"0\"></a> <img src=\""; if ($oUs->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("<a href=\"umAddUser.php\"> <img src=\"images/new.gif\" alt=\"เพิ่มระบบงาน\" border=\"0\"></a>","center"); $oTbl->rowEnd(); $oTbl->rowStart(); $s=""; $mxPage=$oUs->numPages(); for ($i=1; $i<=$mxPage; $i++){ $s.="<a href=umShowUser.php?pg=$i&nrpp=$nrpp&name=$name&PsDptID=$PsDptID&loginname=$loginname&UsWgID=$UsWgID>"; if ($i==$pg) $s.=" <b>$i</b> "; else $s.=" $i "; $s.="</a> "; if ($i % 30 ==0) $s.="<br>"; } $oTbl->addCell($s,"center","",6); $oTbl->rowEnd(); echo $oTbl->output();
//echo "<tr class=TableFooterBgColor>"; //echo "<td colspan=\"4\"> </td>"; //echo "<td colspan=\"4\" align=\"center\"><a href=\"umAddSystem.php\"><img src=\"images/new.gif\" alt=\"เพิ่มระบบงาน\" border=\"0\"></a></td>"; //echo "</tr>";
//////////////////////// ?> </br> <!---------------------------------------------------------------------> <? $oUs->Close(); pageFooter(); ?> <!---------------------------------------------------------------------> <!--put javascript here--> <script language="javascript"> function doDelete(f,txt,ID){ if (confirm('ต้องการลบผู้ใช้ ' + ID + ':' + txt + ' ใช่หรือไม่') ) { window.location="processUmUser.php?method=delete&UsID=" +ID; } }
//document.form1.login.focus(); </script>
|