Viewing file: AddFormCar1.php (26.21 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( "../includes/Function.php" );
require_once( "../includes/FunctionDB.php" );
/** Create Database Object */
$dbObj = new DBConn;
/** Config Table for This Page */
$myTable = "personal_tb";
$myTable1 = "budget_year_tb";
$myTable2 = "formcaroffice";
///////////////////
$query = " SELECT * FROM $myTable WHERE Teacher_code='$Teacher_code' ";
$result = $dbObj->execQuery($query);
$rss = $dbObj->fetchArray($result);
/////-----------///
$query1 = " SELECT * FROM $myTable1 ";
$result1 = $dbObj->execQuery($query1);
$rs = $dbObj->fetchObject($result1);
///////--------//
$query2 = " SELECT * FROM $myTable2 ";
$result2 = $dbObj->execQuery($query2);
$rs2 = $dbObj->fetchObject($result2);
} # 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" />
<title>MIS -- Teacher</title>
<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.pc;
if( (formObj.No_in.value == "" ) && (formObj.Day.value == "" ) ) { alert("กรุณากรอกข้อมูลให้ครบด้วยค่ะ" ); formObj.No_in.style.backgroundColor='#F1F9FC'; formObj.No_in.focus(); return false; }
else if(formObj.No_in.value == "" ) { alert("กรุณากรอก เลขที่หนังสือ"); formObj.No_in.style.backgroundColor='#F1F9FC'; formObj.No_in.focus(); return false;}
else if(formObj.Day.value == "" ) { alert("กรุณากรอก จำนวนวัน"); formObj.Day.style.backgroundColor='#F1F9FC'; formObj.Day.focus(); return false;}
else if(formObj.Budget_year.value == "" ) { alert("กรุณากรอก ปีงบประมาณ"); formObj.Budget_year.style.backgroundColor='#F1F9FC'; formObj.Budget_year.focus(); return false;}
else return true ;
}
</script>
<script language="JavaScript" type="text/JavaScript">
function browse()
{
pc.Filetex.src =pc.Filetex.value;
}
</script>
<style type="text/css">
<!--
.style11 {font-size: 14px;
font-family: Tahoma;
}
-->
</style>
</head>
<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0">
<?php
include("../templates/incHeaderCar.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="765" border="0" cellspacing="0" cellpadding="0">
<form id="pc" name="pc" method="post" action="InsertFormCar.php" onsubmit="return checkData();">
<tr>
<td width="765"> </td>
</tr>
<tr>
<td height="30" background="../images/background/bg-head-topic-w780.gif" class="PADDING-LEFT-10"><strong><a href="index.php">หน้าหลัก</a> » <a href="FormCarList.php?Teacher_code=<?=$Teacher_code;?>">แบบฟอร์มบันทึกขอใช้รถยนต์</a> » <span class="NOTE">ใบขออนุมัติการใช้รถยนต์</span></strong></td>
</tr>
<td align="center"><table width="721" border="0" cellpadding="0" cellspacing="2">
<tr height="31">
<td height="17" colspan="6" align="center" class="PATRON11">ใบขออนุมัติใช้รถยนต์ของทางราชการ</td>
</tr>
<tr height="29">
<td height="18" colspan="6">เขียนที่ <font size="2" face="Tahoma">
<?php
$collegeCode = $rss["collegeCode"];
$sql = "Select * From college Where collegeStatus ='1'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[collegeName] ";
?>
</font></td>
<input name="Teacher_code" type="hidden" id="Teacher_code" value="<? echo $rss["Teacher_code"]?>" />
</tr>
<tr height="29">
<td height="24" colspan="6" align="center"> <span class="style1">วันที่</span> <span class="style5">*</span>
<select name="mDate" id="mDate" class="select" >
<? getDay1to31();?>
</select>
เดือน
<select name="mMonth" id="mMonth" class="select" >
<? getThaiMonth();?>
</select>
ปี ค.ศ.<font color="#0000FF" size="2" face="Tahoma">
<select name="mYear" id="mYear3">
<?php
$curr_year = date("Y");
$prev_year = $curr_year-2;
$next_year = $curr_year+3;
for( $i=$prev_year; $i<=$next_year; $i++ ) {
?>
<option value="<?=$i;?>" <?php if( $i==$curr_year ) echo 'selected'; elseif( $i==$Budget_Year ) echo 'selected'; ?>>
<?=$i;?>
</option>
<?php
} # for
?>
</select>
</font></td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left">เรื่อง <font color="#0000FF" size="2" face="Tahoma">
<input name="Da " type="text" id="Da " style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="ขอใช้รถยนต์ราชการ" size="20" />
</font></td>
<td width="34"></td>
<td width="248"></td>
<td width="56"></td>
</tr>
<tr height="29">
<td height="29" colspan="5" align="left">เรียน ผู้อำนวยการ <font size="2" face="Tahoma">
<?php
$collegeCode = $rss["collegeCode"];
$sql = "Select * From college Where collegeStatus ='1'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[collegeName] ";
?>
</font></td>
<td></td>
</tr>
<tr height="29">
<td width="108" height="25"></td>
<td colspan="5" align="left">ข้าพเจ้า.<font color="#0000FF" size="2" face="Tahoma">
<input name="Name" type="text" id="Name" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="30" value="<? echo $rss[First_name]?> <? echo $rss[Teacher_name]?> <? echo $rss[Teacher_lastname]?> " />
</font> ตำแหน่ง.<font color="#0000FF" size="2" face="Tahoma">
<input name="Name2" type="text" id="Name2" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="20" value=" <? $PositionId = $rss["PositionId"];
$sql = "Select * From position_tb Where PositionId ='$PositionId' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[Position_name] ";?>
" />
</font></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">สังกัด<font color="#0000FF" size="2" face="Tahoma">
<input name="Name3" type="text" id="Name3" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="20" value="<?php $Faculty_code = $rss["Faculty_code"];
$sql = "Select * From faculty_tb Where Faculty_code='$Faculty_code'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[Faculty_name] "; ?>" />
</font><font color="#0000FF" size="2" face="Tahoma">
<input name="Name3" type="text" id="Name4" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="40" value="<?php
$collegeCode = $rss["collegeCode"];
$sql = "Select * From college Where collegeStatus ='1'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[collegeName] "; ?> " />
</font><span class="style11">สถาบันพระบรมราชชนก</span></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"><label>ขออนุญาตไปราชการที่<font color="#0000FF" size="2" face="Tahoma">
<input name="makeWord" type="text" id="makeWord" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="45" />
</font><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" onclick="MM_openBrWindow('bookCodeCar.php?Faculty_code=<? echo $rss["Faculty_code"]?>','Detail','scrollbars=yes,width=820,height=280')"><a href="#" ><img src="../picture/search.gif" width="15" height="19" border="0" align="absmiddle" /></a></font><font color="#0000FF" size="2" face="Tahoma">
<input name="code" type="hidden" id="code" />
</font><font face="Tahoma">จังหวัด<font color="#003366" size="2" face="Tahoma"></font><font face="Tahoma"><font color="#003366" size="2" face="Tahoma">
<select name="provinceId" id="provinceId" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" >
<?php
$strSQL3 = " SELECT * FROM province ";
$result3 = mysql_query($strSQL3);
while( $rs3 = mysql_fetch_array($result3) ) {
?>
<option value="<?=$rs3['provinceId'];?>" <?php if( $rs3['provinceId']==$rs2['provinceId'] ) echo 'selected'; ?>>
<?=$rs3['provinceName'];?>
</option>
<?php
} # while
?>
</select>
</font></font></font></label></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">เรื่อง<font color="#0000FF" size="2" face="Tahoma">
<input name="Training_name" type="text" id="Training_name" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="70" />
</font><font face="Tahoma"><font face="Tahoma"><font color="#003366" size="2" face="Tahoma"> </font></font></font><font color="#0000FF" size="2" face="Tahoma"> </font> <font face="Tahoma"><span class="style14">ผู้ร่วมเดินทาง </span></font><font color="#0000FF" size="2" face="Tahoma">
<input name="Make" type="text" id="Make" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="2" />
</font><font face="Tahoma">คน</font></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">หมายเหตุ<font color="#0000FF" size="2" face="Tahoma">
<input name="Detail" type="text" id="Detail" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="70" />
</font></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">ประเภทในการขอใช้รถยนต์
<input type="radio" name="Training_type" value="1" />
การอบรม
<input type="radio" name="Training_type" value="2" />
การศึกษาดูงาน
<input type="radio" name="Training_type" value="3" checked="checked" />
ประชุม
<input type="radio" name="Training_type" value="4" />
สัมมนา
<input type="radio" name="Training_type" value="7" />
วิทยากร
<input type="radio" name="Training_type" value="6" />
นิเทศงาน
<input type="radio" name="Training_type" value="8" />
อื่นๆ</td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"><label> สถานะการเดินทาง
<input name="object" type="radio" id="object" value="1" />
ค้างคืน
<input name="object" type="radio" id="object" value="2" />
ไปกลับ
<input name="object" type="radio" id="object" value="3" />
ส่งอย่างเดียว <font color="#0000FF" size="2" face="Tahoma"><span class="style1">ปีงบประมาณ<span class="style5">*</span></span>
<input name="Budget_year" type="text" id="Budget_year" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rs->Budget_year;?>" size="3" />
</font></label></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"><label>
<input name="PersonIn" type="checkbox" id="PersonIn" value="รับวิทยากร" <?php if( $_GET['PersonIn'] == "รับวิทยากร" ) echo 'checked'; ?> onclick="checkAssign1(this,pc.Personly)" />
รับวิทยากร ชื่อ
<input name="Personly" type="text" id="Personly" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$_GET['Personly'];?>" size="35" disabled="disabled" />
</label></td>
<input name="ProjectId" type="hidden" id="ProjectId" />
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"><label> <font color="#0000FF" size="2" face="Tahoma"> </font> สถานที่<font color="#0000FF" size="2" face="Tahoma">
<input name="Place" type="text" id="Place" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$_GET['Place'];?>" size="50" />
</font>โทรศัพท์<font color="#0000FF" size="2" face="Tahoma">
<input name="TelNo" type="text" id="TelNo" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="10" maxlength="9" />
</font></label></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">ในวันที่<font color="#000000">
<select name="mDate2" id="select3" class="select" >
<? getDay1to31(); ?>
</select>
เดือน
<select name="mMonth2" id="select4" class="select" >
<? getThaiMonth(); ?>
</select>
ปี ค.ศ. </font><font color="#0000FF" size="2" face="Tahoma">
<select name="mYear2" id="mYear">
<?php
$curr_year = date("Y");
$prev_year = $curr_year-2;
$next_year = $curr_year+3;
for( $i=$prev_year; $i<=$next_year; $i++ ) {
?>
<option value="<?=$i;?>" <?php if( $i==$curr_year ) echo 'selected'; elseif( $i==$Budget_Year ) echo 'selected'; ?>>
<?=$i;?>
</option>
<?php
} # for
?>
</select>
</font><font color="#000000"> </font> ถึงวันที่<font color="#000000">
<select name="mDate3" id="mDate2" class="select" >
<? getDay1to31(); ?>
</select>
เดือน
<select name="mMonth3" id="select2" class="select" >
<? getThaiMonth(); ?>
</select>
ปี ค.ศ. </font><font color="#0000FF" size="2" face="Tahoma">
<select name="mYear3" id="mYear2">
<?php
$curr_year = date("Y");
$prev_year = $curr_year-2;
$next_year = $curr_year+3;
for( $i=$prev_year; $i<=$next_year; $i++ ) {
?>
<option value="<?=$i;?>" <?php if( $i==$curr_year ) echo 'selected'; elseif( $i==$Budget_Year ) echo 'selected'; ?>>
<?=$i;?>
</option>
<?php
} # for
?>
</select>
</font></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"><p>โดย
<label>
<input type="radio" name="usecar" value="1" />
</label>
ใช้ พขร
<label>
<input type="radio" name="usecar" value="0" />
</label>
ไม่ใช้ พขร ตั้งแต่เวลา<font color="#0000FF" size="2" face="Tahoma">
<input name="Time_start" type="text" id="Time_start" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="4" maxlength="5" />
</font>น. ถึงเวลา <font color="#0000FF" size="2" face="Tahoma">
<input name="Time_finish" type="text" id="Time_finish" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="4" maxlength="5" />
</font>น. </p></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"> </td>
</tr>
<tr height="29">
<td height="29"></td>
<td width="101"></td>
<td width="160"></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr height="31">
<td height="31"> </td>
<td> </td>
<td></td>
<td colspan="3" align="left">
<div align="center"><span class="style1">ขอแสดงความนับถือ</span></div></td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left"> </td>
<td></td>
<td></td>
<td></td>
</tr>
<tr height="31">
<td height="31" align="left"> </td>
<td> </td>
<td> </td>
<td> </td>
<td>(ลงชื่อ).................................................</td>
<td></td>
</tr>
<tr height="29">
<td height="29"> </td>
<td> </td>
<td> </td>
<td></td>
<td align="center">(<font color="#003366" size="2" face="Tahoma">..<? echo $rss[First_name]?> <? echo $rss[Teacher_name]?> <? echo $rss[Teacher_lastname]?></font>..)
<input name="Teacher_code" type="hidden" id="Teacher_code" value="<? echo $rss[Teacher_code];?>" /></td>
<td></td>
</tr>
<tr height="31">
<td height="31"> </td>
<td> </td>
<td> </td>
<td colspan="3" align="left"><span class="style13">ความเห็นหัวหน้าฝ่าย/ภาค</span></td>
</tr>
<tr height="29">
<td height="28" colspan="2"><strong> </strong>จึงเรียนมาเพื่อโปรดอนุมัติ</td>
<td></td>
<td colspan="3"><div align="center">.<font color="#0000FF" size="2" face="Tahoma">
<input name="Info_name" type="text" id="Info_name" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="30" />
</font></div></td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left"> </td>
<td></td>
<td></td>
<td></td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left">ลงชื่อ............................................ผู้จัดยานพาหนะ </td>
<td></td>
<td>..............................................</td>
<td></td>
</tr>
<tr height="29">
<td height="29" colspan="2" align="center">(.........................................) </td>
<td align="left"> </td>
<td colspan="3" align="left"> (ลงชื่อ)....<font size="2" face="Tahoma">
<?php
//$Teacher_code = $rss["TeacherId"];
$sql = "Select * From personal_tb Where Faculty_code ='$Faculty_code' and TeacherId='1' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[First_name]$rs2[Teacher_name] $rs2[Teacher_lastname]";
?>
</font>........
<input name="TeacherId" type="hidden" id="TeacherId" value="<? echo $rs2["Teacher_code"]?>" /></td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left">ลงชื่อ่........................................หัวหน้ายานพาหนะ </td>
<td colspan="3" align="left">ตำแหน่ง.<font color="#0000FF" size="2" face="Tahoma">
<input name="Name4" type="text" id="Name5" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="25" value=" <? $PositionId = $rs2["PositionId"];
$sql = "Select * From position_tb Where PositionId ='$PositionId' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[Position_name] ";?>
" />
</font></td>
</tr>
<tr height="29">
<td height="29" colspan="2" align="center">(.........................................) </td>
<td></td>
<td colspan="3" align="left">วันที่..........เดือน..........................พ.ศ............
.</td>
</tr>
<tr height="29">
<td height="29"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr height="31">
<td height="31"></td>
<td></td>
<td></td>
<td align="left"><div align="center">คำสั่ง</div></td>
<td></td>
<td></td>
</tr>
<tr height="29">
<td height="29"></td>
<td></td>
<td></td>
<td align="left"></td>
<td colspan="2" align="left"><label>
<input type="checkbox" name="checkbox" value="checkbox" />
</label>
อนมัติ
<input type="checkbox" name="checkbox2" value="checkbox" />
ไม่อนุมัติ</td>
</tr>
<tr height="29">
<td height="29"></td>
<td></td>
<td></td>
<td></td>
<td colspan="2" align="left"> </td>
</tr>
<tr height="29">
<td height="29"></td>
<td></td>
<td></td>
<td colspan="3" align="left"> (ลงชื่อ)......................................................
..</td>
</tr>
<tr height="29">
<td height="29"></td>
<td></td>
<td></td>
<td colspan="3" align="left">(ตำแหน่ง)............................................................
.</td>
</tr>
<tr height="29">
<td height="29"></td>
<td></td>
<td></td>
<td colspan="3" align="left">วันที่..........เดือน..........................พ.ศ............
.</td>
</tr>
<tr height="31">
<td height="10" colspan="6" align="center"> </td>
</tr>
<tr height="31">
<td height="31" colspan="6" align="center"><input type="submit" name="Submit" value="บันทึก" class="WIDTH60 CURSOR-HAND" />
<input type="reset" name="Reset" value="รีเซ็ต" class="WIDTH60 CURSOR-HAND" />
<input type="button" name="Button" value="ยกเลิก" class="WIDTH60 CURSOR-HAND" onclick="location.href=FormCarList.php?Teacher_code=<?=$Teacher_code;?>'" /></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);
?>
|