Viewing file: umShowLog.php (3.61 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? include_once("pagebody.php"); pageHeader(); $pageTitle="การเข้าใช้ระบบงาน"; echo "<table width=100% class=\"pageTitleBgColor\" align=\"center\">\n"; echo "<tr><td align=center>$pageTitle</td></tr>\n"; echo "</table>"; ?> <!--your code here--------------------------------------------------------------------------> <? if ($frDate=="") $frDate=date('d/m/Y'); if ($toDate=="") $toDate=date('d/m/Y'); ?> <br> <p align=center> <form name=form1 method=post> <table bgcolor=#eeeeee> <tr align=left> <td>ระหว่างวันที่</td> <td><script>DateInput('frDate', true, 'DD/MM/YYYY','<?=$frDate?>');</script></td> <td>ถึง</td> <td><script>DateInput('toDate', true, 'DD/MM/YYYY','<?=$toDate?>');</script></td> </tr> <tr align=left> <td>รหัสผู้ใช้</td> <td colspan="3"><input type="text" name=login value="<?=$login?>"></td> </tr> <tr> <td colspan=4 align="center"><input type="submit" name="submit" value="Search"></td> </tr> </table> </form> </p> <? if ($pg<>"" or $submit=="Search"){ include_once("functions.php"); include_once("clsUmLog.php"); include_once("clsUmUser.php"); include_once("clsUmMenu.php"); include_once("clsUmSystem.php"); $oC = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB'], $GLOBALS['USER'], $GLOBALS['PASSWORD']); $oL = new umlog($oC); $oUs = new umuser($oC); $oMn = new ummenu($oC); $oSt = new umsystem($oC); $frDt=dmyE2ymdO($frDate); $toDt=dmyE2ymdO($toDate); $cond="and left(UlDt,10) between '$frDt' and '$toDt' "; $login = trim($login); if ($login<>""){ $cond.="and UsLogin='$login' "; } $oL->RSumlogCond($cond); $numRow=$oL->GetRowSelected(); //set num row per page, must change object name as well if($submit=="Search") $pg=1; if($nrpp=="") $oL->rowPerPage=$GLOBALS['rowsPerPage']; else $oL->rowPerPage=$nrpp; $oL->gotoPage($pg); // paging ?> <table border="0" align="center" cellspacing="1" class="TableBodyBgColor" cellpadding="2"> <caption align="right" >พบ <?=$numRow?> รายการ</caption> <tr class="TableHeaderBgColor"> <th>#</th> <th>วันที่</th> <th>เวลา</th> <th>รหัสผู้ใช้</th> <th>ระบบงาน : เมนู</th> <!-- <th>เวลา</th>--> <th>IP</th> <th>SQL</th> </tr> <? // paging $i=0 + ($pg-1)*$oL->rowPerPage; // paging while ($oL->GetRecord()){ $i++; if ($i % 2){ echo "<tr bgcolor=#ffffff valign=top>"; }else{ echo "<tr bgcolor=#eeffee valign=top>"; } echo "<td align=center>$i</td>"; echo "<td>" . ymd2dmy(substr($oL->UlDt,0,10)) . "</td>"; echo "<td>" . substr($oL->UlDt,-8) . "</td>"; $oUs->SearchByKey($oL->UlUsID); $oUs->GetRecord(); echo "<td>" . $oL->UlUsID . ":" . $oUs->UsLogin . "</td>"; $oMn->SearchByKey($oL->UlMnID); $oMn->GetRecord(); $oSt->SearchByKey($oMn->MnStID); $oSt->GetRecord(); echo "<td>" . $oSt->StNameT . " : " . $oMn->MnNameT . "</td>"; // echo "<td>" . $oL->UlFrTime . "</td>"; echo "<td>" . $oL->UlIP . "</td>"; echo "<td>" . $oL->UlCmd . "</td>"; echo "</tr>\n"; } $oL->Close(); echo "<tr align=center bgcolor=#ffffff><td colspan=7>"; //Show page number // paging $s=""; $mxPage=$oL->numPages(); for ($i=1; $i<=$mxPage; $i++){ $s.="<a href=umShowLog.php?pg=$i&nrpp=$nrpp&frDate=$frDate&toDate=$toDate&login=$login>"; if ($i==$pg) $s.=" <b>$i</b> "; else $s.=" $i "; $s.="</a> "; if ($i % $GLOBALS['rowsPerPage'] ==0) $s.="<br>"; } echo $s; // paging echo "</td></tr>"; ?> </table> <br> <? } //if ($pg<>"".... ?> <!---------------------------------------------------------------------> <? pageFooter(); ?> <!---------------------------------------------------------------------> <!--put javascript here--> <script language="javascript">
</script>
|