Hacked By AnonymousFox
Current Path : C:/AppServ/www/stat/ |
|
Current File : C:/AppServ/www/stat/home5.php |
<?
include("lib/config.php");
include("lib/connect.php");
include("lib/session.php");
$sql="select * from ncis_staff where StaffID='$System_Session_User_ID'";
$query=mysql_query($sql);
$row=mysql_fetch_array($query);
function ShowDate($myDate) {
$myDateArray=explode("-",$myDate);
$myDay = sprintf("%d",$myDateArray[2]);
switch($myDateArray[1]) {
case "01" : $myMonth = "ม.ค."; break;
case "02" : $myMonth = "ก.พ."; break;
case "03" : $myMonth = "มี.ค."; break;
case "04" : $myMonth = "เม.ย."; break;
case "05" : $myMonth = "พ.ค."; break;
case "06" : $myMonth = "มิ.ย."; break;
case "07" : $myMonth = "ก.ค."; break;
case "08" : $myMonth = "ส.ค."; break;
case "09" : $myMonth = "ก.ย."; break;
case "10" : $myMonth = "ต.ค."; break;
case "11" : $myMonth = "พ.ย."; break;
case "12" : $myMonth = "ธ.ค."; break;
}
$myYear = sprintf("%d",$myDateArray[0])+543;
return($myDay . " " . $myMonth . " " . $myYear);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>:: ระบบ NCIS ::</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="css/splash.css">
<!--===============================================================================================-->
<style type="text/css">
.inputlogin{
background:#056839;
font-family:Tahoma, Geneva, sans-serif;
font-size:16px;
padding: 5px 10px 5px 10px;
color: #fff;
font-weight: bold;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
border-bottom: 1px solid rgba(0,0,0,0.25);
cursor: pointer;
border-left:none;
border-top:none;
margin:10px 0 10px 0;
}
.inputlogin:hover{
background:#727FB2;
}
</style>
<link rel="stylesheet" href="dist/css/default/zebra_datepicker.min.css" type="text/css">
<link rel="stylesheet" href="examples.css" type="text/css">
</head>
<body>
<div class="pages_container">
<div align="center"><img src="logo_sm.png" width="160" /></div><br />
<h4 align="right"><span class="page_title">ยินดีต้อนรับ !
<?=$System_Session_FullName?> เข้าสู่ระบบ
<input type="submit" name="button" id="button" class="inputlogin" value="ออกจากระบบ" onclick="window.location='system/logout.php'" /></span></h4>
<blockquote><a href="home.php">หน้าหลัก</a> / ระบบการจัดการข้อมูลผู้ใช้งานในระบบ</blockquote><br />
<form action="?" method="post" name="mySearchForm" id="mySearchForm" onsubmit="return false;">
<input name="SystemModuleKey2" type="hidden" id="SystemModuleKey2" value="<?=$inputGroupID?>" />
<input name="SystemMenuID2" type="hidden" id="SystemMenuID2" value="<?=$SystemMenuID?>" />
<input type="hidden" id="GroupID2" name="GroupID2" value="<?=$GroupID?>" />
<tr align="right">
<td colspan="4" align="center" bgcolor="#FFFFFF" class="table_footer"><br />
<table width="786" border="0" align="center" cellpadding="5" cellspacing="0" class="table_footer">
<tr>
<td colspan="3" align="center"><strong>ค้นหาข้อมูล</strong></td>
</tr>
<tr>
<td></td>
<td><strong>หน่วยงาน : </strong></td>
<td>
<input name="toolbarPageSearch3" type="text" class="input_left" id="toolbarPageSearch3" value="<?=$PageSearch3?>" size="20" maxlength="50" />
</td>
</tr>
<tr>
<td></td>
<td width="155"><strong>กลุ่มงาน : </strong></td>
<td width="480"><select name="toolbarPageSearch" id="toolbarPageSearch">
<option value="">------เลือกกลุ่มงาน------</option>
<?
$sql2="select * from ncis_group order by GroupID asc";
$query2=mysql_query($sql2);
while($row2=mysql_fetch_array($query2)){
?>
<option value="<?=$row2[Groupname]?>"><?=$row2[Groupname]?></option>
<? } ?>
</select></td>
</tr>
<tr>
<td></td>
<td><strong>ชื่อ : </strong></td>
<td><input name="toolbarPageSearch2" type="text" class="input_left" id="toolbarPageSearch2" value="<?=$PageSearch2?>" size="20" maxlength="50" /></td>
</tr>
<tr>
<td colspan="3" align="center"><input name="btPageSearch" type="button" class="inputlogin" id="btPageSearch" value="ค้นหาข้อมูล" onclick="
document.myForm.PageSearch.value=document.mySearchForm.toolbarPageSearch.value;
document.myForm.PageSearch2.value=document.mySearchForm.toolbarPageSearch2.value;
document.myForm.PageSearch3.value=document.mySearchForm.toolbarPageSearch3.value;
document.myForm.submit();
" /></td>
</tr>
</table></td></tr>
</form>
<?
## Default Value ############################################
$SystemModule_defaultPageSize = 10;
$SystemModule_defaultPageShow = 1;
$SystemModule_MaxPage = 20;
$SystemModule_ReduceRange = 10; // +,- from current page show
$SystemModule_ASCDESC = "DESC";
$SystemModule_OrderBy = $myModule_Table."_Order";
#########################################################
# Check to set default value #########################
if($PageSize=="") { $PageSize = $SystemModule_defaultPageSize; }
if($PageShow=="") { $PageShow = $SystemModule_defaultPageShow; }
//if($ASCDESC=="") { $ASCDESC = "DESC"; }
$ASCDESC = "DESC";
if($OrderBy=="") { $OrderBy = $myModule_Table."_Order"; }
//$OrderBy = $SystemModule_ID;
if($action=="switchorder") {
if($ASCDESC=="DESC") { $ASCDESC = "ASC"; } else { $ASCDESC="DESC"; }
}
if($PageSearch!="") { $PageSearch=trim($PageSearch); }
if($PageSearch2!="") { $PageSearch2=trim($PageSearch2); }
# Count total record size #########################
if($PageSearch==""&&$PageSearch2==""&&$PageSearch3=="") { //debug($System_Session_Language);
$sql = "SELECT * FROM ncis_staff";
} if($PageSearch!="") {
$sql = "SELECT * FROM ncis_staff WHERE 1 AND No LIKE '%$PageSearch%' ";
}if($PageSearch2!="") {
$sql = "SELECT * FROM ncis_staff WHERE 1 AND No LIKE '%$PageSearch%' AND
Refer LIKE '%$PageSearch2%'";
}if($PageSearch3!="") {
$sql = "SELECT * FROM ncis_staff WHERE 1 AND No LIKE '%$PageSearch%' AND
Refer LIKE '%$PageSearch2%' AND Idrefer LIKE '%$PageSearch3%'";
}
$Query=mysql_query($sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$TotalRecordCount=MYSQL_NUMROWS($Query);
# Find max page size #########################
if($TotalRecordCount>$PageSize) {
$NoOfPage= ceil($TotalRecordCount/$PageSize);
} else {
$NoOfPage=1;
}
# Recover page show into range #########################
if($PageShow>$NoOfPage) { $PageShow=$NoOfPage; }
# Select only paging range #########################
$RecordStart = ($PageShow-1)*$PageSize;
$sql=$sql." ORDER BY StaffID DESC LIMIT $RecordStart , $PageSize";
$Query=mysql_query($sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$RecordCount=MYSQL_NUMROWS($Query);
?>
<table width="100%" height="26" border="0" align="center" cellpadding="0" cellspacing="0" class="table_toolbar">
<form action="?" method="post" name="myToolbarForm" id="myToolbarForm" onSubmit="return false;">
<input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$inputGroupID?>">
<input type="hidden" id="GroupID" name="GroupID" value="<?=$GroupID?>">
<input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
<tr>
<td width="5" align="left" valign="top"> </td>
<td valign="bottom"> <table border="0" cellpadding="2" cellspacing="0" class="toolbar">
<tr>
<td>หน้า </td>
<td>
<?
if($NoOfPage>1) {
?>
<select name="toolbarPageShow" class="select" onChange="document.myForm.PageShow.value=this.value; document.myForm.submit(); ">
<?
if($NoOfPage<$SystemModule_MaxPage) {
// Show page list #########################
for($i=1;$i<=$NoOfPage;$i++) {
echo "<option value=\"$i\"";
if($i==$PageShow) { echo " selected"; }
echo ">$i</option>";
}
} else {
// # If total page count greater than default max page value then reduce page select size #########################
$starti = $PageShow-$SystemModule_ReduceRange;
if($starti<1) { $starti=1; }
$endi = $PageShow+$SystemModule_ReduceRange;
if($endi>$NoOfPage) { $endi=$NoOfPage; }
//#####################
for($i=$starti ;$i<=$endi;$i++) {
echo "<option value=\"$i\"";
if($i==$PageShow) { echo " selected"; }
echo ">$i</option>";
}
}
?>
</select>
<?
} else {
echo "1";
}
?> </td>
<td> จากทั้งหมด
<?=$NoOfPage?> </td>
<td width="10"> </td>
<td>แสดงจำนวน / หน้า </td>
<td> <input name="toolbarPageSize" type="text" class="input_center" id="toolbarPageSize" value="<?=$PageSize?>" size="3" maxlength="3"></td>
<td> <input name="btChangePageSize" type="button" class="inputlogin" id="btChangePageSize" value=" จัดการข้อมูล " onClick="
if(isNaN(document.myToolbarForm.toolbarPageSize.value*1)) {
document.myToolbarForm.toolbarPageSize.value='<?=$PageSize?>';
document.myToolbarForm.toolbarPageSize.focus();
return false;
}
if(document.myToolbarForm.toolbarPageSize.value<=0) {
document.myToolbarForm.toolbarPageSize.value='<?=$PageSize?>';
document.myToolbarForm.toolbarPageSize.focus();
return false;
}
document.myForm.PageSize.value=document.myToolbarForm.toolbarPageSize.value;
document.myForm.submit();
"> </td>
</tr>
</table></td>
<td align="right" valign="bottom"> <table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>จำนวนทั้งหมด
<?=$TotalRecordCount?>
รายการ</td>
<td width="10"> </td>
<? if($PageShow>1) { ?>
<? } else { ?>
<? } ?>
<? if($PageShow>1) { ?>
<? } else { ?>
<? } ?>
<? if($PageShow<$NoOfPage) { ?>
<? } else { ?>
<? } ?>
<? if($PageShow<$NoOfPage) { ?>
<? } else { ?>
<? } ?>
</tr>
</table></td>
<td width="5" align="right" valign="top"> </td>
</tr>
</form>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td bgcolor="#FFFFFF"> <table width="100%" height="24" border="0" cellpadding="3" cellspacing="0" class="table_button_bottom2">
</table>
<table width="100%" border="1" cellpadding="1" cellspacing="1" style="border-collapse:collapse" bordercolor="#CCCCCC">
<form action="?" method="post" name="myForm" id="myForm">
<input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$inputGroupID?>">
<input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
<input name="action" type="hidden" id="action">
<input type="hidden" id="GroupID" name="GroupID" value="<?=$GroupID?>">
<input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
<input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
<input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
<input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
<input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
<input name="PageSearch2" type="hidden" id="PageSearch2" value="<?=$PageSearch2?>">
<input name="PageSearch3" type="hidden" id="PageSearch3" value="<?=$PageSearch3?>">
<input name="inputStartDateSearch" type="hidden" id="inputStartDateSearch" value="<?=$inputStartDateSearch?>">
<input name="inputExpireDateSearch" type="hidden" id="inputExpireDateSearch" value="<?=$inputExpireDateSearch?>">
<input name="SelectStatus" type="hidden" id="SelectStatus">
<input name="SelectMarquee" type="hidden" id="SelectMarquee">
<input name="SelectMove" type="hidden" id="SelectMove">
<tr align="center" bgcolor="#083d69">
<td width="61" height="30" bgcolor="#C6ECD9"><strong>ลำดับ</strong></td>
<td width="171" bgcolor="#C6ECD9"><strong>หน่วยงาน</strong></td>
<td width="163" height="30" bgcolor="#C6ECD9"><font class="TableHead"><strong>กลุ่มงาน</strong></font></td>
<td width="169" bgcolor="#C6ECD9"><strong>ชื่อ - นามสกุล</strong></td>
<td width="113" height="30" bgcolor="#C6ECD9"><strong>สิทธิการใช้งาน</strong></td>
<td width="128" bgcolor="#C6ECD9"><strong>ระยะเวลาการใช้งาน</strong></td>
<td width="143" bgcolor="#C6ECD9"><strong>วันที่ลงทะเบียน</strong></td>
<td width="95" height="30" valign="top" bgcolor="#C6ECD9"><strong>จัดการข้อมูล</strong></td>
</tr>
<?
$RecordCount=mysql_num_rows($Query);
$index=1;
if($RecordCount>0) {
while($index<$RecordCount+1) {
if($myClassRow=="table_row1") { $myClassRow="table_row2"; } else { $myClassRow="table_row1"; }
$Row=MYSQL_FETCH_ARRAY($Query);
?>
<tr class="<?=$myClassRow?>" onMouseOver="this.className='table_rowover'" onMouseOut="this.className='<?=$myClassRow?>'">
<td width="61" height="46" align="center" valign="middle"><?=$index?></td>
<td width="171" height="46" align="center" valign="middle"><span class="text_bold">
<?
$sqlin="select * from ncis_institute where InstID='$Row[InstID]'";
$queryin=mysql_query($sqlin);
$rowin=mysql_fetch_array($queryin);
?>
<?=$rowin[Instnameth]?>
</span></td>
<td height="46" align="center"> <span class="text_bold">
<?
$sqlin="select * from ncis_group where GroupID='$Row[GroID]'";
$queryin=mysql_query($sqlin);
$rowin=mysql_fetch_array($queryin);
?>
<?
$sqlin1="select * from ncis_groupi where Groid='$rowin[Groupname]'";
$queryin1=mysql_query($sqlin1);
$rowin1=mysql_fetch_array($queryin1);
?>
<?=$rowin1[Groname]?>
</span><br></td>
<td height="46" align="center" valign="middle"><span class="text_bold">
<?=$Row[StaffFname]?> <?=$Row[StaffLname]?>
</span></td>
<td width="113" height="46" align="center" valign="middle"><span class="text_bold">
<?
$sqlin="select * from ncis_duty where DueID='$Row[DutyID]'";
$queryin=mysql_query($sqlin);
$rowin=mysql_fetch_array($queryin);
?>
<?=$rowin[DueName]?>
</span></td>
<td width="128" height="46" align="center" valign="middle">
<?
if($Row[DutyID]==5){
echo"30 วัน";
}else{
echo"No Limit";
}
?>
</td>
<td width="143" height="46" align="center" valign="middle"><span class="text_bold">
<?=substr($Row[Datetimeregister],0,10)?>
<br>
<?
if($Row[DutyID]==5){ ?>
<font color="#FF0000"><b>Expire<br>
<?
$prdImptDate =date('Y-m-d'); //วันที่รับสินค้าเข้าคลัง
//คำนวณวันหมดอายุ
$calExpireDate = date ("Y-m-d", strtotime("+30 day", strtotime($prdImptDate)));
echo $calExpireDate; ?></b></font>
<? } ?>
</span></td>
<td height="46" align="center">แก้ไข</td>
</tr>
<?
$index++;
}
} else { ?>
<tr class="table_row1">
<td height="80" colspan="8" align="center"> ไม่พบข้อมูล!</td>
</tr>
<? } ?>
<input name="TotalCheckBoxID" type="hidden" id="TotalCheckBoxID" value="<?=$index-1?>">
</form>
</table>
</td>
</tr>
</table>
<p> </p></td></tr>
</table>
</td>
</tr>
</table>
</div><br />
</body>
</html>
Hacked By AnonymousFox1.0, Coded By AnonymousFox