Viewing file: AbsentDetail.php (7.49 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
session_start();
/** Define Validate Access */
define( '_VALID_ACCESS', 1 );
/** Check Session User Login */
if( !session_is_registered("valid_user") && !session_is_registered("Priority") ) {
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-874\" />";
echo "<p style=padding-top:115px><p align=center><br /><font color=red><strong>กรุณาทำการ Login ก่อน</strong></font></p></p>";
echo "<meta http-equiv=\"refresh\" content=\"1; URL=../login.php\" />";
exit();
}
else {
/** Configuration */
require_once( "../configuration.php" );
require_once( $_Config_absolute_path . "/includes/framework.php" );
require_once( "../include/Function.php" );
/** Create Database Object */
$dbObj = new DBConn;
/** Config Table for This Page */
$myTable1 = "personal_tb";
$myTable2 = "history_absent_tb";
$Username = $valid_user;
//=== personal_tb
$sql = " SELECT * FROM personal_tb WHERE Username='$Username' ";
$res= mysql_query($sql);
$rs = mysql_fetch_array($res);
$strSQL = " SELECT * FROM history_absent_tb WHERE Absent_code='$Absent_code' AND Teacher_code='$Teacher_code' AND Year='$Year' ";
$result = mysql_query($strSQL);
$num = mysql_num_rows($result);
} # else
?>
<meta http-equiv="Content-Type" content="text/html; charset=TIS-620">
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/utilities.js"></script>
</br>
<table width="614" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="614"><fieldset>
<form id="form1" name="form1" method="post" action="">
<table width="86%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="BORDER-TOP-LEFT-RIGHT" style="background-color:#EEE; border:0px solid gray">
<tr bgcolor="#CCCCFF">
<td height="25" colspan="3" align="center" bgcolor="#FFFFFF" ><font color="#000000" face="Tahoma">รายละเอียดวันลา</font><font size="2" face="Tahoma">
<?php
$sql = "Select * From history_absent Where Absent_code='$Absent_code'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rss = mysql_fetch_array($result1);
echo "$rss[Absent_type] $rss[Teacher_lastname]";
?>
</a> ปีงบประมาณ </a><?=$Year;?></a></td>
</tr>
<tr bgcolor="#E6E6E6">
<td width="42" align="center" bgcolor="#eeeeee" class="style3" style="border:1px solid gray"><font color="#000000" face="Tahoma">No.</font></td>
<td width="261" align="center" bgcolor="#eeeeee" class="style3" style="border:1px solid gray"><font color="#000000" face="Tahoma"> วัน เดือน ปี </font></td>
<td width="77" align="center" bgcolor="#eeeeee" class="style3" style="border:1px solid gray"><font color="#000000" face="Tahoma">จำนวนวันที่ลา</font></td>
</tr>
<?php
while( $row = $dbObj->fetchArray($result) ) {
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" : "#FFFFFF";
$sum += $countnum;
?>
<tr bgcolor="#F7F7F7" >
<td align="center" bgcolor="#FFFFFF" ><strong><font color="#996600" size="1" face="Tahoma">
<?=$no;?>
</font></strong></td>
<td align="center" bordercolor="#EEEEEE" bgcolor="#FFFFFF" ><div align="center"><font color="#003366" size="2" face="Tahoma"> </font><font color="#990099" size="2" face="Tahoma"><a href="InstructorList.php?Project_code=<?=$row["Project_code"]?>"title="Click to see Detail" class="d"> </a></font><font color="#003366" size="2" face="Tahoma"> </font><font color="#003366" size="2" face="Tahoma">
<?php
$sday = $row[Date_start];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
$m = getThaiSubMonth($month);
echo"$day"." "."$m"." "."$year";
?> -
<?php
$sday = $row[Date_finish];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
$m = getThaiSubMonth($month);
echo"$day"." "."$m"." "."$year";
?>
</font><font color="#990099" size="2" face="Tahoma"><a href="InstructorList.php?Orderlist_2=<?=$row["Orderlist_2"]?>"title="Click to see Detail" class="d"></a></font><font color="#003366" size="2" face="Tahoma"> </font><font color="#990099" size="2" face="Tahoma"><a href="ProjectList1.php?Orderlist_2=<?=$row["Orderlist_2"]?>"title="Click to see Detail" class="d"> </a></font><font color="#003366" size="2" face="Tahoma"> </font></div></td>
<td bgcolor="#FFFFFF" ><div align="right"><font color="#993333" size="2" face="Tahoma"> <?echo number_format($row['Absent_times'],2,'.',','); ?> </font></div></td>
</tr>
<?php
} # while
?>
<tr bgcolor="#FFFFFF">
<td colspan="3" align="center" bgcolor="#FFFFFF" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right" bgcolor="#FFFFFF"><span class="style4">รวมจำนวนวันที่ใช้ไป</span></td>
<td bgcolor="#FFFFFF"><div align="right"><strong><font color="#993333" size="2" face="Tahoma">
<?php
$sql1 = "Select Sum(Absent_times) as SumB1 From history_absent_tb Where Year='$Year' and Teacher_code='$Teacher_code' and Absent_code='$Absent_code' ";
$result1 = mysql_query($sql1) or die("Erro".mysql_error());
$rss1 = mysql_fetch_array($result1);
echo number_format($rss1[SumB1],2,'.',',');
//echo"$rss1[SumC1]";
?>
</font></strong></div></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="style4">วันลาตามสิทธิ์</td>
<td bgcolor="#FFFFFF">
<?php echo"$rs[15]";?>
</a></td>
</tr>
<tr>
<td width="89%" align="right" bgcolor="#FFFFFF" class="style4">คงเหลือวันลา</td>
<td width="11%" bgcolor="#FFFFFF"><div align="right"><font color="#FF0000" size="2" face="Tahoma">
<?php
$Delete3 = $rss2[Absent_01] - $rss1[SumB1] ;
echo number_format($Delete3,2,'.',',');
// echo"$Del4";
?>
</font></div></td>
</tr>
</table></td>
</tr>
<tr bgcolor="#CCCCFF">
<td colspan="3" align="center" bgcolor="#FFFFFF" >ทั้งหมด <? echo $num; ?> รายการ</td>
</tr>
<tr bgcolor="#CCCCFF">
<td colspan="3" align="center" bgcolor="#FFFFFF" > </td>
</tr>
</table>
</form>
</fieldset></td>
</tr>
<tr>
<td height="35" align="center"><input type="button" name="close" value="ปิดหน้าต่าง" onclick="window.close()" /></td>
</tr>
</table>
<?php
/** Free Resource */
$dbObj->freeresult($result);
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?>
|