Viewing file: AddAccName_old.php (20.89 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" );
include("../include/Function.php");
/** Create Database Object */
$dbObj = new DBConn;
/** Config Table for This Page */
$myTable = "accessories_tb";
$myTable1 ="accessories_type_tb";
$myTableFK = "AccId";
$query = " SELECT * FROM $myTable WHERE AccId ='$AccId' ";
$result0 = $dbObj->execQuery($query);
$rs = $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" />
<title>MIS -- Administrator</title>
<script type="text/javascript" src="../js/utilities.js"></script>
<style type="text/css">
<!--
.style1 {
color: royalblue;
font-weight: bold;
}
.style2 {color: royalblue}
.style3 {color: royalblue; font-size: 14px; }
.style4 {color: royalblue; font-size: 14px; font-weight: bold; }
.style31 {color: royalblue; font-size: 14px; }
.style11 { color: royalblue;
font-weight: bold;
}
-->
</style>
</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"><?php
?>
<fieldset>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="2"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form id="myForm" name="myForm" method="post" enctype="multipart/form-data" action="InsertAcc.php" onSubmit="return checkData();" >
<tr>
<td width="70%" height="30" align="left" background="../images/background/bg-head-topic.gif" class="PADDING-LEFT-10"><strong><span class="style2"><a href="index.php"><span class="PADDING-LEFT-10"><span class="style1">หน้าหลัก</span></span></a> </span>» <span class="style2"><a href="AccByName">ข้อมูลครุภัณฑ์หน่วยงาน</a> </span>» <span class="style2"> เพิ่มข้อมูลมูลครุภัณฑ์</span></strong></td>
<td width="30%" align="right" class="PADDING-LEFT-10 PADDING-RIGHT-15"> </td>
</tr>
<tr>
<td height="385" colspan="2" align="center" valign="top">
<table width="760" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td height="10"></td>
</tr>
<tr>
<td height="10"><span class="PADDING-TOP-10"><img src="../images/icons/arrow-circle-225-left.png" width="16" height="16" border="0" align="absmiddle" /> <a href="javascript:;" onclick="window.history.back();"><strong>‹ ย้อนกลับ</strong></a></span></td>
</tr>
<tr>
<td height="10"> </td>
</tr>
</table>
<table width="638" border="0" align="center" cellpadding="0" cellspacing="2" class="BORDER-GREY">
<tr>
<th height="16" colspan="2" align="center" bgcolor="#FFFFFF" class="style2" scope="col"> </th>
</tr>
<tr>
<th height="31" colspan="2" align="center" bgcolor="#FFFFFF" class="style2" scope="col"><span style="padding-left:3px">
<input type="radio" name="Dura" id="Propagate" value="Y" <?php if( $_GET['Propagate'] == "Y" ) echo 'checked'; ?> onclick="checkAssign1(this,myForm.Acc_code),checkAssign1(this,myForm.Acc_no)" />
ครุภัณฑ์
<input type="radio" name="Dura" id="Propagate" value="N" <?php if( $_GET['Propagate'] == "N" ) echo 'checked'; ?> />
วัสดุ/อะไหล่</span></th>
</tr>
<tr>
<th width="184" height="22" align="center" bgcolor="#FFFFFF" class="style2" scope="col"><font face="Tahoma">รหัสครุภัณฑ์วิทยาลัย</font></th>
<th width="449" bgcolor="#FFFFFF" scope="col"><div align="left" class="style3"><font color="#006633" face="Tahoma">
<input name="Acc_no" type="text" id="Acc_no" value="<?=$rs['Acc_no'];?>" size="30" disabled="disabled" />
</font></div></th>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">เลขที่หรือรหัสครุภัณฑ์<br /> (ตามทะเบียนคุมทรัพสิน)</font></td>
<td bgcolor="#FFFFFF"><input name="Acc_code" type="text" id="Acc_code" value="<?=$rs['Acc_code'];?>" size="30" disabled="disabled" /></td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">รายการหรือชื่อครุภัณฑ์</font></td>
<td bgcolor="#FFFFFF"><input name="Acc_name" type="text" id="Acc_name" value="<?=$rs['Acc_name'];?>" size="50" /></td>
</tr>
<tr>
<td height="28" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">รุ่น/แบบ</font></td>
<td bgcolor="#FFFFFF"><input name="Acc_module" type="text" class="input " id="Acc_module" value="<?=$rs['Acc_module'];?>" size="30" /></td>
</tr>
<tr>
<td height="22" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">ประเภทครุภัณฑ์</font></td>
<td bgcolor="#FFFFFF"><a href="AddAccType.php"><font face="Tahoma"><font face="Tahoma"><font color="#003366" size="2" face="Tahoma">
<select name="Acc_type_code" id="Acc_type_code" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" >
<?php
$strSQL3 = " SELECT * FROM accessories_type_tb ";
$result3 = mysql_query($strSQL3);
while( $rs3 = mysql_fetch_array($result3) ) {
?>
<option value="<?=$rs3['Acc_type_code'];?>" <?php if( $rs3['Acc_type_code']==$rs['Acc_type_code'] ) echo 'selected'; ?>>
<?=$rs3['Acc_type'];?>
</option>
<?php
} # while
?>
</select>
</font></font></font></a></td>
</tr>
<tr>
<td height="22" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">แหล่งเงิน</font></td>
<td bgcolor="#FFFFFF"><a href="AddAccType.php"><font face="Tahoma"><font face="Tahoma"><font color="#003366" size="2" face="Tahoma">
<select name="MoneyS_C" id="MoneyS_C" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" >
<?php
$strSQL1 = " SELECT * FROM money_source_tb ";
$result1 = mysql_query($strSQL1);
while( $rs1 = mysql_fetch_array($result1) ) {
?>
<option value="<?=$rs1['MoneyS_C'];?>" <?php if( $rs1['MoneyS_C']==$rs['MoneyS_C'] ) echo 'selected'; ?>>
<?=$rs1['MoneyS_M'];?>
</option>
<?php
} # while
?>
</select>
</font></font></font></a></td>
</tr>
<tr>
<td height="22" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">วิธีการที่ได้มา</font></td>
<td bgcolor="#FFFFFF"><select name="Fix_detail" id="Fix_detail">
<option value="สอบราคา" <?php if($rs['Fix_detail']=="สอบราคา"){ echo "selected" ; } ?> >สอบราคา </option>
<option value="ตกลงราคา" <?php if($rs['Fix_detail']=="ตกลงราคา"){ echo "selected" ; } ?> >ตกลงราคา </option>
<option value="อิเล็คทรอนิคส์" <?php if($rs['Fix_detail']=="อิเล็คทรอนิคส์"){ echo "selected" ; } ?> >อิเล็คทรอนิคส์ </option>
<option value="ประกวดราคา" <?php if($rs['Fix_detail']=="ประกวดราคา"){ echo "selected" ; } ?> >ประกวดราคา </option>
<option value="วิธีพิเศษ" <?php if($rs['Fix_detail']=="วิธีพิเศษ"){ echo "selected" ; } ?> >วิธีพิเศษ </option>
<option value="วิธีกรณีพิเศษ" <?php if($rs['Fix_detail']=="วิธีกรณีพิเศษ"){ echo "selected" ; } ?> >วิธีกรณีพิเศษ </option>
<option value="รับบริจาค" <?php if($rs['Fix_detail']=="รับบริจาค"){ echo "selected" ; } ?> >รับบริจาค </option>
</select></td>
</tr>
<tr>
<td height="24" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">วันที่จัดซื้อ</font></td>
<td bgcolor="#FFFFFF" class="style1"><span class="style11">
<select name="mDate" id="mDate" class="select" >
<?php
$Date = $rs[Date_buy];
$yearthai = explode("-",$Date);
$mDate = intval($yearthai[2]);
$mMonth = intval($yearthai[1]);
$mYear = intval($yearthai[0]);
for($i=0;$i<=31;$i++)
{
if( $i == 0)
echo"\n\t<option value=\"$mDate\" selected>$mDate</option>\n ";
else
echo"\n\t<option value=\"$i\">$i</option>\n ";
}
// getDay1to31();
?>
</select>
เดือน
<select name="mMonth" id="mMonth" class="select" >
<?php
$Date = $rs[Date_buy];
$yearthai = explode("-",$Date);
$mDate= intval($yearthai[2]);
$Month = intval($yearthai[1]);
$mYear = intval($yearthai[0]);
$mMonth = $Month;
$CMonth = TxtThaiMonth($Month);
for($i=-1;$i<=11;$i++)
{
$a = $i+1;
if( $a == 0)
echo"\n\t<option value=\"$mMonth\" selected>$CMonth</option>\n ";
else
echo"\n\t<option value=\"$a\">$ThaiMonth[$i]</option>\n ";
}
// getThaiMonth();
?>
</select>
</font><font color="#0000FF" size="2" face="Tahoma"> </font><font color="#000000" size="2" face="Tahoma">ปี พ.ศ.</font><font color="#000000" face="Tahoma">
<input name="mYear" type="text" class="input" id="mYear" value="<? echo $mYear ?>" size="3" maxlength="4" />
</font></span></td>
</tr>
<tr>
<td height="22" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">จำนวนปีของครุภัณฑ์</font></td>
<td bgcolor="#FFFFFF" class="style1"><span class="style3"><font face="Tahoma"><span class="style31">
<input name="Year" type="text" class="input" id="Year" value="<?=$rs['Year'];?>" size="3" maxlength="4" />
ปี</span></font></span></td>
</tr>
<tr>
<td height="22" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">ราคาที่จัดซื้อ/หน่วย</font></td>
<td bgcolor="#FFFFFF" class="style1"><span class="style3">
<input name="Price" type="text" class="input" id="Price" value="<?=$rs['Price'];?>" size="7" maxlength="8" />
<font face="Tahoma">บาท</font></span></td>
</tr>
<tr>
<td height="24" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">วันที่หมดอายุการใช้งาน</font></td>
<td bgcolor="#FFFFFF" class="style1"><span class="style3"><font color="#000000" face="Tahoma">
<select name="mDate1" id="mDate1" class="select" onkeypress="return handleEnter(this, event)" >
<? getDay1to31();?>
</select>
</font class="style2"><font face="Tahoma">เดือน</font><font color="#000000" face="Tahoma">
<select name="mMonth1" id="mMonth1" class="select" onkeypress="return handleEnter(this, event)">
<? getThaiMonth();?>
</select>
</font><font face="Tahoma"> ปี พ.ศ</font><font color="#0000FF" size="2" face="Tahoma">
<select name="mYear1" id="mYear1">
<?php
$curr_year = date("Y")+543;
$prev_year = $curr_year-9;
$next_year = $curr_year+30;
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></span></td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">จำแนกเป็นครุภัณฑ์</font></td>
<td bgcolor="#FFFFFF" class="style1"><span class="style11">
<select name="Fund" id="Fund">
<option value="มูลค่าสูงกว่า 5000" <?php if($rs['Fund']=="มูลค่าสูงกว่า 5000"){ echo "selected" ; } ?> >มูลค่าสูงกว่า 5000 </option>
<option value="มูลค่าต่ำกว่า 5000" <?php if($rs['Fund']=="มูลค่าต่ำกว่า 5000"){ echo "selected" ; } ?> >มูลค่าต่ำกว่า 5000 </option>
<option value="หมดอายุการใช้งาน" <?php if($rs['Fund']=="หมดอายุการใช้งาน"){ echo "selected" ; } ?> >หมดอายุการใช้งาน </option>
</select>
</span></td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">หน่วยงาน /ฝ่าย</font></td>
<td bgcolor="#FFFFFF"><strong><font color="#003366" face="Tahoma"><a href="AddAccType.php"><font face="Tahoma"><font face="Tahoma"><font color="#003366" size="2" face="Tahoma">
<select name="Faculty_code" id="Faculty_code" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" >
<?php
$strSQL2 = " SELECT * FROM faculty_tb ";
$result2 = mysql_query($strSQL2);
while( $rs2 = mysql_fetch_array($result2) ) {
?>
<option value="<?=$rs2['Faculty_code'];?>" <?php if( $rs2['Faculty_code']==$rs['Faculty_code'] ) echo 'selected'; ?>>
<?=$rs2['Faculty_name'];?>
</option>
<?php
} # while
?>
</select>
</font></font></font></a></font></strong></td>
</tr>
<tr>
<td height="22" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">ใช้ประจำที่/สถานที่จัดเก็บ</font></td>
<td bgcolor="#FFFFFF"><font color="#003366" size="2" face="Tahoma"><strong><font size="2" face="Tahoma"><strong><font color="#003366" face="Tahoma"><a href="AddAccType.php"><font face="Tahoma"><font face="Tahoma"><font color="#003366" size="2" face="Tahoma">
<select name="RoomId" id="RoomId" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" >
<?php
$strSQL4 = " SELECT * FROM room_tb ";
$result4 = mysql_query($strSQL4);
while( $rs4 = mysql_fetch_array($result4) ) {
?>
<option value="<?=$rs4['code'];?>" <?php if( $rs4['code']==$rs['RoomId'] ) echo 'selected'; ?> >
<?=$rs4['Room_code'];?>
<?=$rs4['Room_name'];?>
</option>
<?php
} # while
?>
</select>
</font></font></font></a></font></strong></font></strong></font></td>
</tr>
<tr>
<td height="35" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">ลักษณะคุณสมบัติของครุภัณฑ์</font></td>
<td bgcolor="#FFFFFF"><span class="style3">
<textarea name="Statistic" cols="50" rows="3" id="Statistic"><?=$rs['Statistic'];?>
</textarea>
</span></td>
</tr>
<tr>
<td height="27" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">เลขที่เอกสารที่ได้มา</font></td>
<td bgcolor="#FFFFFF"><input name="In_document" type="text" class="input " id="In_document" value="<?=$rs['In_document'];?>" size="30" /></td>
</tr>
<tr>
<td height="27" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">หลักฐานการจ่ายเงิน</font></td>
<td bgcolor="#FFFFFF"><input name="Price_document" type="text" class="input " id="Price_document" value="<?=$rs['Price_document'];?>" size="30" /></td>
</tr>
<tr>
<td height="27" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">รายการที่เปลี่ยนแปลง</font></td>
<td bgcolor="#FFFFFF"><input name="Modify_detail" type="text" class="input " id="Modify_detail" value="<?=$rs['Modify_detail'];?>" size="30" /></td>
</tr>
<tr>
<td height="27" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">เลขที่เอกสารที่เปลี่ยนแปลง</font></td>
<td bgcolor="#FFFFFF"><input name="Modify_document" type="text" class="input " id="Modify_document" value="<?=$rs['Modify_document'];?>" size="30" /></td>
</tr>
<tr>
<td height="27" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">ชื่อผู้ขาย / บริจาค </font></td>
<td bgcolor="#FFFFFF"><input name="Name" type="text" class="input " id="Name" value="<?=$rs['Name'];?>" size="40" /></td>
</tr>
<tr>
<td height="16" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">ที่อยู่ผู้ขาย</font></td>
<td bgcolor="#FFFFFF"><span class="style31">
<textarea name="Address" cols="50" rows="3" id="Address"><?=$rs['Address'];?>
</textarea>
</span></td>
</tr>
<tr>
<td height="22" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">โทรศัพท์</font></td>
<td bgcolor="#FFFFFF"><input name="Phone" type="text" class="input " id="Phone" value="<?=$rs['Phone'];?>" size="10" /></td>
</tr>
<tr>
<td height="16" bgcolor="#FFFFFF" class="style2"> </td>
<td bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="24" align="center" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">อัปโหลดภาพ</font></td>
<td align="left" bgcolor="#FFFFFF"><div align="Left">
<input name="Img1" type="file" id="Img1" onchange="browse()" />
</div></td>
</tr>
</table>
<br />
<br /><input type="submit" name="add" value="บันทึกข้อมูล" onclick="return(checkFormat())" />
<input type="reset" name="clear" value="เคลียร์ข้อมูล" />
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<?php if( $numrows > 0 ) { ?>
<?php } #if ?></td>
</tr>
</table>
<br /></td></tr>
</form>
</table>
</fieldset></td>
</tr>
</table>
<?php include("../templates/incFooter.php"); ?>
</body>
</html>
<?php
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?>
|