Viewing file: AbsentDetail.php (7.63 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" );
/** Chart */
include ("../includes/charts.php");
/** Create Database Object */
$dbObj = new DBConn;
/** Config Table for This Page */
$myTable = "history_absent_tb";
$myTablePK = "Year";
//=== history_absent_tb
$query = " SELECT * FROM $myTable WHERE Absent_code='$Absent_code' AND Teacher_code='$Teacher_code' AND Year='$Year' ";
$result = $dbObj->execQuery($query);
//$rs = $dbObj->fetchArray($result);
$numrows = $dbObj->_numrows;
} # else
?>
<meta http-equiv="Content-Type" content="text/html; charset=TIS-620" />
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<body>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="10"></td>
</tr>
</table>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="600" align="center">
<fieldset><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5"></td>
</tr>
</table>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25" align="center" bgcolor="#F0F0F0"><span class="PATRON11"><font color="#FF0000">รายละเอียดวันลา</font></span></td>
</tr>
</table>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border-top:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC">
<tr bgcolor="#E6E6E6">
<td width="40" height="23" align="center" bgcolor="#F8F8F8"><strong>No.</strong></td>
<td width="92" align="center" bgcolor="#F8F8F8" style="border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC"><strong>ปีงบประมาณ</strong></td>
<td width="130" align="center" bgcolor="#F8F8F8"><strong>วัน เดือน ปี ที่ลา</strong></td>
<td width="132" align="center" bgcolor="#F8F8F8" style="border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC"><strong>ถึง วัน เดือน ปี</strong></td>
<td width="105" align="center" bgcolor="#F8F8F8"><strong>ประเภทวันลา</strong></td>
<td width="93" align="center" bgcolor="#F8F8F8" style="border-left:1px solid #CCCCCC;"><strong>จำนวนวันลา</strong></td>
</tr>
<?php
$no = 1;
while( $row = $dbObj->fetchArray($result) ) {
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" : "#FFFFFF";
?>
<tr bgcolor="<?=$bgColor;?>" >
<td height="21" align="center" style="border-top:1px solid #CCCCCC;"><?=$no;?></td>
<td align="center" bordercolor="#EEEEEE" style="border-top:1px solid #CCCCCC; border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC;"><?php echo $row['Year'];?></td>
<td align="right" bordercolor="#EEEEEE" style="border-top:1px solid #CCCCCC;" class="PADDING-RIGHT-15"><?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";
?></td>
<td align="right" bordercolor="#EEEEEE" style="border-top:1px solid #CCCCCC; border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC;" class="PADDING-RIGHT-15"><?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";
?></td>
<td align="center" bordercolor="#EEEEEE" style="border-top:1px solid #CCCCCC;"><?php
$Absent_code = $row["Absent_code"];
$sql = " SELECT * FROM history_absent01_tb WHERE Absent_code='$Absent_code' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rss = mysql_fetch_array($result1);
mysql_free_result($result1);
echo "$rss[Absent_type]";
?></td>
<td align="center" style="border-top:1px solid #CCCCCC; border-left:1px solid #CCCCCC;"><?php echo number_format($row['Absent_times'],2,'.',','); ?></td>
</tr>
<?php
$no++;
} # while
?>
</table>
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right" class="TEXT-CLIMSON10"> </td>
<td> </td>
</tr>
<tr>
<td align="right" class="TEXT-CLIMSON10">รวมจำนวนวันที่ใช้ไป</td>
<td align="right" class="PADDING-RIGHT-30"><?php
$sql = " SELECT SUM(Absent_times) AS SumB1 FROM history_absent_tb WHERE Teacher_code='$Teacher_code' AND Absent_code='$Absent_code' ";
$result2 = mysql_query($sql) or die("Error".mysql_error());
$rss2 = mysql_fetch_array($result2);
mysql_free_result($result2);
echo number_format($rss2['SumB1'],2,'.',',');
?></td>
</tr>
<tr>
<td align="right" class="TEXT-CLIMSON10">วันลาตามสิทธิ์</td>
<td align="right" class="PADDING-RIGHT-30"><?php
$sql2 = " SELECT * FROM personal_tb WHERE Teacher_code='$Teacher_code' ";
$result3 = mysql_query($sql2) or die("Error".mysql_error());
$rss3 = mysql_fetch_array($result3);
mysql_free_result($result3);
echo number_format($rss3['Absent_01'],2,'.',',');
?></td>
</tr>
<tr>
<td width="85%" align="right" class="TEXT-CLIMSON10">คงเหลือวันลา</td>
<td width="15%" align="right" class="PADDING-RIGHT-30"><?php
$remain = $rss3['Absent_01'] - $rss2['SumB1'] ;
echo number_format($remain,2,'.',',');
?></td>
</tr>
<tr>
<td height="10" colspan="2" align="center"></td>
</tr>
<tr>
<td colspan="2" align="center">ทั้งหมด <strong><?php echo $numrows; ?></strong> รายการ</td>
</tr>
<tr>
<td height="10" colspan="2" align="center"></td>
</tr>
</table>
</fieldset>
<br />
<input type="button" name="close2" value="ปิดหน้าต่าง" onclick="window.close();" class="CURSOR-HAND" /></td>
</tr>
</table>
</body>
</html>
<?php
/** Free Resource */
$dbObj->freeresult($result);
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?>
|