Viewing file: DetailFormA_cb.php (21.43 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" );
require_once( "../include/FunctionDB.php" );
/** Create Database Object */
$dbObj = new DBConn;
//=== SESSION
$Username = $valid_user;
/** Config Table for This Page */
$myTable1 = "personal_tb";
$myTable2 = "formaoffice";
$myTable3 = "project_tb";
$myTable4 = "training_tb";
/** Table --> personal_tb */
$query = " SELECT * FROM $myTable1 WHERE Username='$Username' ";
$result = $dbObj->execQuery($query);
$rss = $dbObj->fetchArray($result);
$Teacher_code = $rss['Teacher_code'];
/** Table --> tech_plan_tb */
$query1 = " SELECT * FROM $myTable2 WHERE codeId='$codeId' ";
$result1 = $dbObj->execQuery($query1);
$rs1 = $dbObj->fetchArray($result1);
/** Table --> techplan_method_tb */
$query2 = " SELECT * FROM $myTable3 WHERE codeId='$codeId' ";
$result2 = $dbObj->execQuery($query2);
$rs2 = $dbObj->fetchArray($result2);
/** Table --> tech_spec_tb */
$query3 = " SELECT * FROM $myTable4 WHERE Training_code='$Training_code' ";
$result3 = $dbObj->execQuery($query3);
$rs3 = $dbObj->fetchArray($result3);
} # else
?>
<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>
<style type="text/css">
<!--
.style1 {
font-size: 14px;
font-family: Tahoma;
}
.style2 {
font-size: 14px;
font-weight: bold;
font-family: Tahoma;
}
.style5 {font-size: 14px; font-family: Tahoma; color: #FF0000; }
.style7 {font-size: 14px}
.style11 {font-size: 14px; color: #000000; }
.style12 {color: #000000}
.style21 {font-size: 14px}
-->
</style>
<table width="704" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="704">
<fieldset>
<table width="666" align="center" cellpadding="0" cellspacing="0">
<tr height="31">
<td colspan="2" rowspan="2" class="PATRON11"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><span class="style21"><img src="../picture/krud.jpg" width="87" height="86" border="0" align="absmiddle" /></span></font></td>
<td height="31" colspan="3" class="PATRON11"> บันทึกข้อความ</td>
<td height="31" align="center" class="PATRON11"> </td>
</tr>
<tr height="31">
<td height="31" align="center" class="PATRON11"> </td>
<td height="31" align="center" class="PATRON11"> </td>
<td height="31" align="center" class="PATRON11"> </td>
<td height="31" align="center" class="PATRON11"> </td>
</tr>
<tr height="29">
<td height="29" colspan="6" l="l">ส่วนราชการ <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>
</tr>
<tr>
<td height="29" colspan="2" align="left">ที่ <font color="#0000FF" size="2" face="Tahoma">
<input type="text" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<? echo $rs1['maNo'];?>" size="15" />
</font></td>
<td width="150" height="29" align="left"> </td>
<td height="29" align="left"> </td>
<td height="29" colspan="2" align="left"><font color="#000000" size="2" face="Tahoma">วันที่
</font><font color="#0000FF" size="2" face="Tahoma">
<input name="Date" type="text" id="Date" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="10" value=" <?php
$sday = $rs1[Date];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
//////////////////
// $yearthai = $day ;
$m = getThaiSubMonth($month);
echo"$day"." "."$m"." "."$year";
?>" />
</font></td>
</tr>
<tr height="29">
<td height="29" colspan="3" 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" value="ขออนุมัติเดินทางไปราชการ" size="20" />
</font></td>
<td width="36"></td>
<td width="218"></td>
<td width="76"></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="127" height="24"></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="Name4" type="text" id="Name4" 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="Name2" type="text" id="Name2" 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="Name3" 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="style1">สถาบันพระบรมราชชนก</span></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" value="<?=$rs1['Training_name'];?>" size="60" />
</font></td>
</tr>
<tr height="29">
<td height="26" colspan="6" align="left"><span class="style7">เพื่อ.</span><font size="2" face="Tahoma">
<input type="radio" name="Training_type" <?php if (!(strcmp("$rs3[Training_type]","1"))){echo "checked";} ?> value="1" />
</font><span class="style7"> การอบรม</span><font size="2" face="Tahoma">
<input type="radio" name="Training_type" <?php if (!(strcmp("$rs3[Training_type]","2"))){echo "checked";} ?> value="2" />
</font><span class="style7"> การศึกษาดูงาน</span><font size="2" face="Tahoma">
<input type="radio" name="Training_type" <?php if (!(strcmp("$rs3[Training_type]","3"))){echo "checked";} ?> value="3" />
</font><span class="style7">ประชุม</span><font size="2" face="Tahoma">
<input type="radio" name="Training_type" <?php if (!(strcmp("$rs3[Training_type]","4"))){echo "checked";} ?> value="4" />
</font><span class="style7">สัมมนา</span> <font size="2" face="Tahoma">
<input type="radio" name="Training_type" <?php if (!(strcmp("$rs3[Training_type]","5"))){echo "checked";} ?> value="6" />
</font><span class="style7">นิเทศงาน </span><font size="2" face="Tahoma">
<input type="radio" name="Training_type" <?php if (!(strcmp("$rs3[Training_type]","7"))){echo "checked";} ?> value="7" />
</font><span class="style7">การเป็นวิทยากร</span></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"> ประเภท
<input name="Training_std" type="radio" <?php if (!(strcmp("$rs3[Training_std]","Y"))){echo "checked";} ?> value="Y" />
พัฒนาตามสายงาน
<input name="Training_std" type="radio" <?php if (!(strcmp("$rs3[Training_std]","N"))){echo "checked";} ?> value="N" />
พัฒนาตนเอง</td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"><label>อ้างตามหนังสือราชการเลขที่</label>
<font size="2" face="Tahoma">
<?php
// $ProjectId = $rs1["ProjectId"];
// $sql = "Select * From project_tb Where ProjectId='$ProjectId' ";
// $result2 = mysql_query($sql) or die("Error".mysql_error());
// $rs2 = mysql_fetch_array($result2);
//echo "$rs2[Orderlist]";
?>
</font><font color="#0000FF" size="2" face="Tahoma">
<input name="No_in" type="text" id="No_in" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<? echo $rs1[No_in];?>" size="35" />
<input name="Status" type="text" id="Status" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<? echo $rs1[Status];?>" size="20" />
</font></td>
</tr>
<tr height="29">
<td height="23" colspan="6" align="left">อ้างตามแผนดำเนินการ ข้อที่ <font size="2" face="Tahoma">
<?php
$ProjectId = $rs1["ProjectId"];
$sql = "Select * From project_tb Where ProjectId='$ProjectId' ";
$result2 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result2);
//echo "$rs2[Orderlist]";
?>
</font><font color="#0000FF" size="2" face="Tahoma">
<input name="Orderlist" type="text" id="Orderlist" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?php echo $rs2[Orderlist];?>" size="3" />
รายละเอียด
<input name="Project_plan" type="text" id="Project_plan" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?php echo $rs2[Project_plan];?>" size="40" />
</font></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"><font color="#0000FF" size="2" face="Tahoma"><span class="style11">ปี งบประมาณ</span></font>
<input name="Year_std" type="text" id="Year_std" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rs1['Year_std'];?>" size="3" />
<font face="Tahoma"><span class="style11">จำนวนเงินที่ขอใช้ </span></font><font color="#0000FF" size="2" face="Tahoma">
<input name="Budget_use" type="text" id="Budget_use" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rs1['Budget_use'];?>" size="10" />
</font> บาท <font face="Tahoma"><span class="style7"><strong> </strong></span><span class="style11">จำนวนเงินทั้งหมดที่ใช้ตามแผน</span></font><font color="#0000FF" size="2" face="Tahoma">
<input name="Budget_use" type="text" id="Budget_use" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<? $sql = " SELECT SUM(Budget_use) AS SumB1 FROM project_tb WHERE ProjectId='$rs1[ProjectId]' " ;
$result11 = mysql_query($sql);
$rs11 = mysql_fetch_array($result11);
echo number_format($rs11['SumB1'],2,'.',','); ?> " size="10" />
บาท
</font></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"><font face="Tahoma"><span class="style11">จำนวนเงินทั้งหมดที่ตั้งไว้ตามแผน</span></font> <font color="#0000FF" size="2" face="Tahoma" > <input name="Budget_use2" type="text" id="Budget_use2" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<? $sql = " SELECT * FROM project_type_tb WHERE ProjectId='$rs1[ProjectId]' " ;
$result22 = mysql_query($sql);
$rs22 = mysql_fetch_array($result22);
echo number_format($rs22['Budget_use'],2,'.',','); ?> " size="10" />
บาท
</font><font face="Tahoma"><font face="Tahoma"><span class="style11">คงเหลือเงินทั้งหมดตามแผน</span></font><font color="#0000FF" size="2" face="Tahoma" >
<input name="Budget_use3" type="text" id="Budget_use3" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<? $Sum3 = $rs22['Budget_use'] - $rs11['SumB1'] ;
echo number_format($Sum3,2,'.',','); ?> " size="10" />
บาท
</font></font></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"><font color="#000000" size="2" face="Tahoma">วันที่ </font><font color="#0000FF" size="2" face="Tahoma">
<input name="Date_start" type="text" id="Date_start" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="10" value=" <?php
$sday = $rs1[Date_start];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
//////////////////
// $yearthai = $day ;
$m = getThaiSubMonth($month);
echo"$day"." "."$m"." "."$year";
?>" />
</font> ถึงวันที่ <font color="#0000FF" size="2" face="Tahoma">
<input name="Date_finish" type="text" id="Date_finish" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="10" value=" <?php
$sday = $rs1[Date_finish];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
//////////////////
// $yearthai = $day ;
$m = getThaiSubMonth($month);
echo"$day"." "."$m"." "."$year";
?>" />
</font>มีกำหนด<font color="#0000FF" size="2" face="Tahoma">
<input name="Day" type="text" id="Day" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rs1['Day'];?>" size="3" maxlength="3" />
</font>วัน</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" colspan="2" align="left"> </td>
<td> </td>
<td colspan="2">ลงชื่อ .........................................</td>
<td></td>
</tr>
<tr height="29">
<td height="29"> </td>
<td width="57"> </td>
<td> </td>
<td colspan="2" align="center">(<font color="#003366" size="2" face="Tahoma"><? echo $rss[First_name]?> <? echo $rss[Teacher_name]?> <? echo $rss[Teacher_lastname]?></font>) </td>
<td></td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left"> </td>
<td colspan="2">ตำแหน่ง<font color="#0000FF" size="2" face="Tahoma">
<input name="Name6" type="text" id="Name6" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="25" 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>
<td></td>
</tr>
<tr height="29">
<td height="29" colspan="2" align="left"><label>
<input name="Flag1" type="checkbox" id="Flag1" value="1" disabled="disabled" />
อนุญาต
<input name="Flag1" type="checkbox" id="Flag1" value="2" disabled="disabled" />
ไม่อนุญาต</label></td>
<td align="left"> </td>
<td colspan="3" align="left"> </td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left">ลงชื่อ..................................หัวหน้าภาค/ฝ่าย.</td>
<td colspan="3" align="left"> </td>
</tr>
<tr height="29">
<td height="29" colspan="2" align="center">(<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>) </td>
<td align="left"> </td>
<td align="left"><div align="center">คำสั่ง</div></td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left"><font face="Tahoma"><span class="style7">ตำแหน่ง</span></font><font color="#0000FF" size="2" face="Tahoma">
<input name="Name5" 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>
<td align="left"> </td>
<td align="left"><input name="Flag2" type="checkbox" id="Flag2" <?php if ( !strcmp($rs1["Flag2"],"อนุมัติ") ) { echo "checked"; } ?> value="1" disabled="disabled" />
อนมัติ
<input name="Flag2" type="checkbox" id="Flag2" <?php if ( !strcmp($rs1["Flag2"],"ไม่อนุมัติ") ) { echo "checked"; } ?> value="2" disabled="disabled" />
ไม่อนุมัติ</td>
<td align="left"> </td>
</tr>
<tr height="29">
<td height="29" colspan="2" align="left"> </td>
<td align="left"> </td>
<td colspan="2" align="left">ลงชื่อ.........................................……..</td>
<td align="left"> </td>
</tr>
<tr height="29">
<td height="28" colspan="2" align="left"> </td>
<td align="left"> </td>
<td colspan="2" align="left">ตำแหน่ง. .....................................</td>
<td align="left"> </td>
</tr>
<tr height="29">
<td height="29" colspan="2" align="left"> </td>
<td align="left"> </td>
<td colspan="2" align="left"> วันที่..........เดือน......................พ.ศ..........…</td>
<td align="left"> </td>
</tr>
</table>
<p> </p>
</fieldset>
</td>
</tr>
</table>
|