| Viewing file:  AbsentList.php (9.03 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 *, prefixName as First_name FROM personal_tb LEFT JOIN prefix ON personal_tb.First_name = prefix.prefixId WHERE Teacher_code='$Teacher_code' ";
 $result0 = $dbObj->execQuery($query);
 $rss = $dbObj->fetchArray($result0);
 
 
 } # else
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
 <link href="../css/default.css" rel="stylesheet" type="text/css" />
 <script language="javascript" src="../js/utilities.js"></script>
 <script language="Javascript" src="../charts/charts.js"></script>
 <title>ข้อมูลสำหรับผู้บริหาร : รายงานเกี่ยวกับวันลา - ข้อมูลประวัติการลา</title>
 </head>
 
 <body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0">
 <?php
 include("../templates/incHeader.php");
 ?>
 <table width="1003" border="0" cellspacing="0" cellpadding="0">
 <tr>
 <td width="203" align="left" valign="top" style="padding:10px 0px 0px 5px"><?php include("./_incMainMenu.php");?></td>
 <td width="800" align="center" valign="top" style="padding:10px 0px 5px 10px"><fieldset><table width="780" border="0" cellspacing="0" cellpadding="0">
 <form id="myForm" name="myForm" method="post" action="<?=$PHP_SELF;?>?page=<?=$page;?>">
 <tr>
 <td height="5"></td>
 </tr>
 <tr>
 <td height="30" background="../images/background/bg-head-topic-w780.gif" class="PADDING-LEFT-10"><strong><a href="index.php">หน้าหลัก</a></strong> <strong>» <a href="Menu_Manage.php">รายงานเกี่ยวกับวันลา</a> » <a href="AbsentByYear.php?Teacher_code=<?=$Teacher_code;?>">ข้อมูลประวัติการลา</a> » <span class="NOTE">ประวัติการลา</span></strong></td>
 </tr>
 <tr>
 <td> </td>
 </tr>
 <tr>
 <td height="370" align="center" valign="top">
 <?php
 //===  history_absent_tb
 $query = " SELECT *  FROM $myTable   WHERE Teacher_code='$Teacher_code'  GROUP BY  $myTablePK ";
 $result = $dbObj->execQuery($query);
 $rs = $dbObj->fetchArray($result);
 ?>
 <table width="75%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF" style="background-color:#eeeeee; border:0px solid gray">
 <tr>
 <td height="25" colspan="3" align="center" bgcolor="#F0F0F0" class="PATRON11">ประวัติการลา <span class="TEXT-HEADER11-BLUE"><?php echo $rss['First_name']; ?><?php echo $rss['Teacher_name']; ?> <? echo $rss['Teacher_lastname']; ?></span>  ประจำปีงบประมาณ <span class="TEXT-HEADER11-BLUE"><?php echo $Year; ?></span></td>
 </tr>
 <tr bgcolor="#F8F8F8">
 <td height="22" colspan="2" align="left" bordercolor="#999966" class="PADDING-LEFT-10"><strong>ประเภทการลา</strong></td>
 <td width="50%" bordercolor="#999966" align="center"><strong>จำนวน (ระเบียน)</strong></td>
 </tr>
 <tr bgcolor="#F9FBFB">
 <td width="5%" height="20" align="right"> </td>
 <td width="45%" align="left" class="PADDING-LEFT-5"><?php
 $query = " SELECT *  FROM  history_absent_tb  WHERE Teacher_code='$Teacher_code'  AND  Year='$Year'  AND  Absent_code='01' ";
 $result1 = $dbObj->execQuery($query);
 $countnum1 = $dbObj->_numrows;
 $dbObj->freeresult($result1);
 if( $countnum1 > 0 ) {
 ?><a href="javascript:;" onclick="NewWindow('AbsentDetail.php?Absent_code=01&Teacher_code=<?=$rs['Teacher_code'];?>&Year=<?=$Year;?>','AbsentDetail','700','350','yes');">ข้อมูลลากิจ</a><?php } else { ?>ข้อมูลลากิจ<?php } ?></td>
 <td align="center"><?php echo $countnum1; ?></td>
 </tr>
 <tr bgcolor="#FFFFFF">
 <td height="20" align="right"> </td>
 <td align="left" class="PADDING-LEFT-5"><?php
 $query = " SELECT *  FROM  history_absent_tb  WHERE Teacher_code='$Teacher_code'  AND  Year='$Year'  AND  Absent_code='02' ";
 $result2 = $dbObj->execQuery($query);
 $countnum2 = $dbObj->_numrows;
 $dbObj->freeresult($result2);
 if( $countnum2 > 0 ) {
 ?><a href="javascript:;" onclick="NewWindow('AbsentDetail.php?Absent_code=02&Teacher_code=<?=$rs['Teacher_code'];?>&Year=<?=$Year;?>','AbsentDetail','700','350','yes');">ข้อมูลลาป่วย</a><?php } else { ?>ข้อมูลลาป่วย<?php } ?></td>
 <td align="center"><?php echo $countnum2; ?></td>
 </tr>
 <tr bgcolor="#F9FBFB">
 <td height="20" align="right"> </td>
 <td align="left" class="PADDING-LEFT-5"><?php
 $query = " SELECT *  FROM  history_absent_tb  WHERE Teacher_code='$Teacher_code'  AND  Year='$Year'  AND  Absent_code='03' ";
 $result3 = $dbObj->execQuery($query);
 $countnum3 = $dbObj->_numrows;
 $dbObj->freeresult($result3);
 if( $countnum3 > 0 ) {
 ?><a href="javascript:;" onclick="NewWindow('AbsentDetail.php?Absent_code=03&Teacher_code=<?=$rs['Teacher_code'];?>&Year=<?=$Year;?>','AbsentDetail','700','350','yes');">ข้อมูลลาพักผ่อน</a><?php } else { ?>ข้อมูลลาพักผ่อน<?php } ?></td>
 <td align="center"><?php echo $countnum3; ?></td>
 </tr>
 <tr bgcolor="#FFFFFF">
 <td height="20" align="right"> </td>
 <td align="left" class="PADDING-LEFT-5"><?php
 $query = " SELECT *  FROM  history_absent_tb  WHERE Teacher_code='$Teacher_code'  AND  Year='$Year'  AND  Absent_code='04' ";
 $result4 = $dbObj->execQuery($query);
 $countnum4 = $dbObj->_numrows;
 $dbObj->freeresult($result4);
 if( $countnum4 > 0 ) {
 ?><a href="javascript:;" onclick="NewWindow('AbsentDetail.php?Absent_code=04&Teacher_code=<?=$rs['Teacher_code'];?>&Year=<?=$Year;?>','AbsentDetail','700','350','yes');">ข้อมูลลาคลอด</a><?php } else { ?>ข้อมูลลาคลอด<?php } ?></td>
 <td align="center"><?php echo $countnum4; ?></td>
 </tr>
 <tr bgcolor="#F9FBFB">
 <td height="20" align="right"> </td>
 <td align="left" class="PADDING-LEFT-5"><?php
 $query = " SELECT *  FROM  history_absent_tb  WHERE Teacher_code='$Teacher_code'  AND  Year='$Year'  AND  Absent_code='05' ";
 $result5 = $dbObj->execQuery($query);
 $countnum5 = $dbObj->_numrows;
 $dbObj->freeresult($result5);
 if( $countnum5 > 0 ) {
 ?><a href="javascript:;" onclick="NewWindow('AbsentDetail.php?Absent_code=05&Teacher_code=<?=$rs['Teacher_code'];?>&Year=<?=$Year;?>','AbsentDetail','700','350','yes');">ข้อมูลลาอุปสมบท</a><?php } else { ?>ข้อมูลลาอุปสมบท<?php } ?></td>
 <td align="center"><?php echo $countnum5; ?></td>
 </tr>
 <tr bgcolor="#FFFFFF">
 <td height="20" align="right"> </td>
 <td align="left" class="PADDING-LEFT-5"><?php
 $query = " SELECT *  FROM  history_absent_tb  WHERE Teacher_code='$Teacher_code'  AND  Year='$Year'  AND  Absent_code='06' ";
 $result6 = $dbObj->execQuery($query);
 $countnum6 = $dbObj->_numrows;
 $dbObj->freeresult($result6);
 if( $countnum6 > 0 ) {
 ?><a href="javascript:;" onclick="NewWindow('AbsentDetail.php?Absent_code=06&Teacher_code=<?=$rs['Teacher_code'];?>&Year=<?=$Year;?>','AbsentDetail','700','350','yes');">ข้อมูลลาปฏิบัติธรรม</a><?php } else { ?>ข้อมูลลาปฏิบัติธรรม<?php } ?></td>
 <td align="center"><?php echo $countnum6; ?></td>
 </tr>
 </table>
 </td>
 </tr>
 <tr>
 <td> </td>
 </tr></form>
 </table>
 </fieldset></td>
 </tr>
 </table>
 <?php include("../templates/incFooter.php"); ?>
 </body>
 </html>
 <?php
 /**  Free Resource */
 //$dbObj->freeresult($result);
 
 /**  Close the Database  */
 $dbObj->disconn();
 
 /**  Unset Class  */
 unset($dbObj);
 ?>
 |