Viewing file: Add_His_Absent.php (10.04 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;
//=== SESSION
$Username = $valid_user;
/** Config Table for This Page */
$myTable1 = "personal_tb";
/** Table --> personal_tb */
$query1 = " SELECT * FROM $myTable1 WHERE Username='$Username' ";
$result1 = $dbObj->execQuery($query1);
$rss = $dbObj->fetchArray($result1);
$Teacher_code = $rss['Teacher_code'];
} # 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">
function checkData() {
var formObj = document.myForm;
if( (formObj.Absent_code.value == "0" ) && (formObj.Absent_times.value == "" ) && (formObj.Date_start.value == "" ) ) { alert("กรุณากรอกข้อมูลให้ครบด้วยค่ะ" ); formObj.Absent_code.style.backgroundColor='#F1F9FC'; formObj.Absent_code.focus(); return false; }
else if(formObj.Absent_code.value == "" ) { alert("กรุณาเลือก ประเภทการลา"); formObj.Absent_code.style.backgroundColor='#F1F9FC'; formObj.Absent_code.focus(); return false; }
else if(formObj.Absent_times.value == "" ) { alert("กรุณากรอก จำนวนวันลา"); formObj.Absent_times.style.backgroundColor='#F1F9FC'; formObj.Absent_times.focus(); return false; }
else if(formObj.Date_start.value == "" ) { alert("กรุณากรอก วันที่เริ่มลา"); formObj.Date_start.style.backgroundColor='#F1F9FC'; formObj.Date_start.focus(); return false; }
else if(formObj.Date_finish.value == "" ) { alert("กรุณากรอก วันที่สิ้นสุดการลา"); formObj.Date_finish.style.backgroundColor='#F1F9FC'; formObj.Date_finish.focus(); return false; }
else return true ;
}
</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" height="440" 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="Insert_Absent.php" onSubmit="return checkData()">
<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_History.php?Teacher_code=<?=$Teacher_code;?>">ข้อมูลประวัติส่วนตัว</a> » <a href="AbsentByYear.php?Teacher_code=<?=$Teacher_code;?>">ข้อมูลการลารายปี</a> » <span class="NOTE">เพิ่มข้อมูลการลา</span></strong></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="center">
<table width="750" border="0" align="center" cellpadding="1" cellspacing="1" style="background-color:#eeeeee; border:0px solid gray">
<tr>
<td height="30" colspan="2" align="center" bgcolor="#F8F8F8" class="PATRON11">เพิ่มข้อมูลการลา <span class="TEXT-HEADER11-BLUE">อ.<? echo $rss['Teacher_name'] ?> <? echo $rss['Teacher_lastname'] ?></span></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="18%" align="right" bgcolor="#FFFFFF" class="PADDING-RIGHT-10">ชื่อ - นามสกุล</td>
<td bgcolor="#FFFFFF" class="PADDING-LEFT-10"><font color="#003366" size="2" face="Tahoma"><? echo $rss['First_name']?> <? echo $rss['Teacher_name'];?> <? echo $rss['Teacher_lastname'];?></font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" align="right" bgcolor="#FFFFFF" class="PADDING-RIGHT-10"><span class="TEXT-RED10">*</span> ปีงบประมาณ</td>
<td bgcolor="#FFFFFF" class="PADDING-LEFT-10">
<?php
$CurrYear = date("Y")+543;
$Prev5Year = $CurrYear-4;
?>
<select name="SelectYear" class="TEXT-DARK-BLUE10" id="SelectYear">
<option value="0">--- เลือก ---</option>
<?php for( $i=$Prev5Year; $i<$CurrYear; $i++ ) { ?>
<option value="<?=$i;?>"><?=$i;?></option>
<?php } # for ?>
<option value="<?=$CurrYear;?>" <?php if( $CurrYear == date("Y")+543 ) echo 'selected'; ?>><?=$CurrYear;?></option>
</select></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="29" align="right" bgcolor="#FFFFFF" class="PADDING-RIGHT-10"><span class="TEXT-RED10">*</span> ประเภทการลา</td>
<td bgcolor="#FFFFFF" class="PADDING-LEFT-10"><select name="Absent_code" id="Absent_code" class="TEXT-DARK-BLUE10">
<option value="0">--- เลือก ---</option>
<?php
$strSQL3 = " SELECT * FROM history_absent01_tb "; //Where Absent_code='$Absent_code' ";
$result3 = mysql_query($strSQL3);
while( $rs3 = mysql_fetch_array($result3) ) {
echo"<option value=\"$rs3[Absent_code]\" >$rs3[Absent_type]</option>\n";
}
?>
</select></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="29" align="right" bgcolor="#FFFFFF" class="PADDING-RIGHT-10"> <span class="TEXT-RED10">*</span> จำนวนวันลา</td>
<td bgcolor="#FFFFFF" class="PADDING-LEFT-10"><input name="Absent_times" type="text" id="Absent_times" size="5" maxlength="2" style="text-align:center" /> วัน</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="29" align="right" bgcolor="#FFFFFF" class="PADDING-RIGHT-10"><span class="TEXT-RED10">*</span> เริ่มลา จากวันที่</td>
<td width="82%" bgcolor="#FFFFFF" class="PADDING-LEFT-10"><input name="Date_start" type="text" style="text-align:center" id="Date_start" size="10" />
<script type="text/javascript" src="../includes/popcalendar.js"></script>
<script language='JavaScript'>
if (!document.layers) {
document.write("<img src='../images/ew_calendar.gif' width='16' height='15' style='cursor:hand;' onclick='popUpCalendar(this, myForm.Date_start, \"yyyy-mm-dd\")'>")
}
</script>
<span class="TEXT-ORANGE9"><-- คลิ๊ก</span></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="right" bgcolor="#FFFFFF" class="PADDING-RIGHT-10"><span class="TEXT-RED10">*</span> ถึงวันที่</td>
<td bgcolor="#FFFFFF" class="PADDING-LEFT-10"><input name="Date_finish" type="text" style="text-align:center" id="Date_finish" size="10" />
<script type="text/javascript" src="../includes/popcalendar.js"></script>
<script language='JavaScript'>
if (!document.layers) {
document.write("<img src='../images/ew_calendar.gif' width='16' height='15' style='cursor:hand;' onclick='popUpCalendar(this, myForm.Date_finish, \"yyyy-mm-dd\")'>")
}
</script>
<span class="TEXT-ORANGE9"><-- คลิ๊ก</span></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="right" bgcolor="#FFFFFF" class="PADDING-RIGHT-10">การนับ</td>
<td bgcolor="#FFFFFF" class="PADDING-LEFT-5"><input name="Unit_count" type="radio" id="Unit_count" value="นับครั้ง" checked="checked" />
นับครั้ง
<input type="radio" name="Unit_count" id="Unit_count" value="ไม่นับครั้ง" />
ไม่นับครั้ง</td>
</tr>
<tr>
<td height="45" align="center" bgcolor="#FFFFFF"> </td>
<td height="45" align="left" bgcolor="#FFFFFF"><input type="hidden" name="Teacher_code" value="<? echo $Teacher_code; ?>" />
<input type="hidden" name="Year" value="<? echo $Year; ?>" />
<input type="submit" name="Submit" value="บันทึก" class="WIDTH60 CURSOR-HAND" />
<input type="reset" name="Submit" value="รีเซ็ต" class="WIDTH60 CURSOR-HAND" />
<input type="button" name="Button" value="ยกเลิก" class="WIDTH60 CURSOR-HAND" onclick="location.href='AbsentList.php?Teacher_code=<?=$Teacher_code;?>&Year=<?=$Year;?>'" /></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($result1);
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?>
|