Viewing file: FrmEditAcc.php (37.46 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;
/** 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><?=$_Config_sitename;?></title>
<script type="text/javascript" src="../js/utilities.js"></script>
<script language="JavaScript">
function resutName(sell_id)
{
switch(sell_id)
{
<?
$strSQL = "SELECT * FROM accessories_sell ORDER BY sell_id ASC";
$objQuery = mysql_query($strSQL);
while($objResult = mysql_fetch_array($objQuery))
{
?>
case "<?=$objResult["sell_id"];?>":
myForm.Address.value = "<?=$objResult["sell_address"];?>";
myForm.Phone.value = "<?=$objResult["sell_tel"];?>";
break;
<?
}
?>
default:
myForm.Address.value = "<?=$objResult["sell_address"];?>";
myForm.Phone.value = "<?=$objResult["sell_tel"];?>";
}
}
</script>
<script language="JavaScript" type="text/JavaScript">
function browse()
{
myForm.Img1.src = myForm.Img1.value;
}
</script>
</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="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="EditAcc.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="AccList.php?Faculty_code=<?=$rs['Faculty_code'];?>">เมนูคุรุภัณฑ์</a> </span>» <span class="style2"><a href="AccDetail.php?AccId=<?=$rs['AccId'];?>">ข้อมูลครุภัณฑ์</a> </span>» <span class="style2"><a href="AddAccName.php?AccId=<?=$rs['AccId'];?>">บันทึกข้อมูลครุภัณฑ์</a> </span>» <span class="NOTE">แก้ไขข้อมูลครุภัณฑ์</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>
<? if ($rs['Dura'] == "Y" ) { ?>
<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">
<input type="radio" name="Dura" id="Dura" <?php if( $rs['Dura'] == "Y" ) echo 'checked'; ?> value="Y" />
ครุภัณฑ์
<input type="radio" name="Dura" id="Dura" <?php if( $rs['Dura'] == "N" ) echo 'checked'; ?> value="N" />
วัสดุ/อะไหล่</a></th>
</tr>
<tr>
<td width="264" align="right" bgcolor="#FFFFFF" class="style2"><table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td width="264" height="30" align="right" bgcolor="#FFFFFF" class="style2"><b>รหัสครุภัณฑ์วิทยาลัย</b> : </td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="style2">ปีงบประมาณ : </td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">วันที่หมดอายุการใช้งาน : </font></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">จำแนกเป็นครุภัณฑ์ : </font></td>
</tr>
<tr>
<td height="27" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">เลขที่เอกสารที่ได้มา : </font></td>
</tr>
<tr>
<td height="27" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">หลักฐานการจ่ายเงิน : </font></td>
</tr>
<tr>
<td height="27" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">รายการที่เปลี่ยนแปลง : </font></td>
</tr>
<tr>
<td height="27" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">เลขที่เอกสารที่เปลี่ยนแปลง : </font></td>
</tr>
</table></td>
<td colspan="2" bgcolor="#FFFFFF" scope="col">
<input name="Acc_no" type="text" id="Acc_no" value="<?=$rs['Acc_no'];?>" size="30" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FFFFFF" class="style1"></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="style2">
<input name="Year" type="text" class="input" id="Year" value="<?=$rs['Year'];?>" size="4" maxlength="4" />
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="style1"><span class="style3"><font color="#000000" face="Tahoma">
<select name="mDate1" id="mDate1" class="select" >
<?php
$query = " SELECT * FROM $myTable1 WHERE Acc_type_code='$rs[Acc_type_code]' ";
$result1 = $dbObj->execQuery($query);
$rss = $dbObj->fetchArray($result1);
$Date = $rs[Date_buy];
$yearthai = explode("-",$Date);
$mDate = intval($yearthai[2]);
$mMonth = intval($yearthai[1]);
$mYear = intval($yearthai[0] + $rss ['Year'] );
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="mMonth1" id="mMonth1" class="select" >
<?php
$Date = $rs[Date_buy];
$yearthai = explode("-",$Date);
$mDate= intval($yearthai[2]);
$Month = intval($yearthai[1]);
$mYear = intval($yearthai[0] + $rss ['Year'] );
$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><a>ปี พ.ศ.
<input name="mYear1" type="text" class="input" id="mYear1" value="<? echo $mYear ?>" size="3" maxlength="4" /><a></a></a></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF" class="style2">
<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>
<option value="บริจาค" <?php if($rs['Fund']=="บริจาค"){ echo "selected" ; } ?> >บริจาค</option>
<option value="จำหน่าย" <?php if($rs['Fund']=="จำหน่าย"){ echo "selected" ; } ?> >จำหน่าย</option>
</select>
</td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF" class="style2"><input name="In_document" type="text" class="input " id="In_document" value="<?=$rs['In_document'];?>" size="30" /></td>
</tr>
<tr>
<td height="29" bgcolor="#FFFFFF" class="style2"><input name="Price_document" type="text" class="input " id="Price_document" value="<?=$rs['Price_document'];?>" size="30" /></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF" class="style2"><input name="Modify_detail" type="text" class="input " id="Modify_detail" value="<?=$rs['Modify_detail'];?>" size="30" /></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF" class="style2"><input name="Modify_document" type="text" class="input " id="Modify_document" value="<?=$rs['Modify_document'];?>" size="30" /></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="style2">เลขที่หรือรหัสครุภัณฑ์ <br /> (ตามทะเบียนคุมทรัพสิน) : </td>
<td bgcolor="#FFFFFF"><input name="Acc_code" type="text" id="Acc_code" value="<?=$rs['Acc_code'];?>" size="30" /></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="style2">รายการหรือชื่อครุภัณฑ์ : </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="right" bgcolor="#FFFFFF" class="style2">รุ่น/แบบ : </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="right" bgcolor="#FFFFFF" class="style2">ประเภทครุภัณฑ์ : </td>
<td bgcolor="#FFFFFF"><a href="AddAccType.php">
<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="right" bgcolor="#FFFFFF" class="style2">แหล่งเงิน : </td>
<td bgcolor="#FFFFFF"><a href="AddAccType.php">
<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="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">วิธีการที่ได้มา : </font></td>
<td bgcolor="#FFFFFF"><label>
<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>
</label></td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">วันที่จัดซื้อ : </font></td>
<td bgcolor="#FFFFFF" class="style1"><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 color="#000000" size="2" face="Tahoma" class="style2">ปี พ.ศ.</font><font color="#000000" face="Tahoma">
<input name="mYear" type="text" class="input" id="mYear" value="<? echo $mYear ?>" size="3" maxlength="4" />
</font></td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">ราคาที่จัดซื้อ/หน่วย : </font></td>
<td bgcolor="#FFFFFF" class="style1"><span class="style31"><span class="style11">
<input name="Price" type="text" class="input" id="Price" value="<?=$rs['Price'];?>" size="10" maxlength="10" />
<font face="Tahoma">บาท</font></span></span></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">หน่วยงาน /ฝ่าย : </font></td>
<td bgcolor="#FFFFFF"><span class="style3"><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>
<span class="style11"></span></font></font></font></a></font></strong></span></td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">ใช้ประจำที่/สถานที่จัดเก็บ : </font></td>
<td bgcolor="#FFFFFF"><a href="AddAccType.php">
<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>
</a></td>
</tr>
<tr>
<td height="35" align="right" bgcolor="#FFFFFF" class="style2">สถานะการใช้งาน : </td>
<td bgcolor="#FFFFFF"><input name="Status" type="checkbox" id="Status" value="Y" <?php if( $rs['Status'] == "Y" ) echo 'checked'; ?> />
ใช้งานอยู่
<input name="Status" type="checkbox" id="Status" value="N" <?php if( $rs['Status'] == "N" ) echo 'checked'; ?> />
ยกเลิกการใช้งาน</td>
</tr>
<tr>
<td height="35" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">ลักษณะคุณสมบัติของครุภัณฑ์ : </font></td>
<td bgcolor="#FFFFFF"><span class="style3">
<textarea name="Statistic" cols="50" rows="5" id="Statistic"><?=$rs['Statistic'];?>
</textarea>
</span></td>
</tr>
<tr>
<td height="27" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">ชื่อผู้ขาย / บริจาค : </font></td>
<td bgcolor="#FFFFFF">
<select name="Sell_id" OnChange="resutName(this.value);">
<?
$strSQL = " SELECT * FROM accessories_sell AS sell LEFT JOIN accessories_tb AS tb ON sell.sell_id=tb.sell_id GROUP BY sell.sell_id;";
$objQuery = mysql_query($strSQL);
while($objResult1 = mysql_fetch_array($objQuery))
{
?>
<option value="<?=$objResult1["sell_id"];?>"
<?php if( $objResult1["sell_id"]==$rs["sell_id"] )
{
echo 'selected';
}
else if ($objResult1["sell_id"]=" ")
{
echo ' กรุณาเลือกชื่อผู้ขาย / บริจาค';
}?>> <?=$objResult1["sell_name"];?></option>
<?
}
?>
</select>
</td>
</tr>
<tr>
<td height="16" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">ที่อยู่ผู้ขาย : </font></td>
<td bgcolor="#FFFFFF"><span class="style31">
<input name="Address" type="text" size="50" value="<?=$objResult["sell_address"];?>" disabled="disabled">
</span></td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">โทรศัพท์ : </font></td>
<td bgcolor="#FFFFFF"><input name="Phone" type="text" class="input " id="Phone" value="<?=$objResult["sell_tel"];?>" size="10" disabled="disabled" /></td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">อัปโหลดภาพ : </font></td>
<td align="left" bgcolor="#FFFFFF">
<input name="Img1" type="file" id="Img1" onchange="browse()" />
</td>
</tr>
</table>
<? }
else { ?>
<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">
<input type="radio" name="Dura" id="Dura" <?php if( $rs['Dura'] == "Y" ) echo 'checked'; ?> value="Y" />
ครุภัณฑ์
<input type="radio" name="Dura" id="Dura" <?php if( $rs['Dura'] == "N" ) echo 'checked'; ?> value="N" />
วัสดุ/อะไหล่</a></th>
</tr>
<tr>
<td align="right" 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" /></td>
</tr>
<tr>
<td align="right" 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="right" 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="right" 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="right" 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="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">วิธีการที่ได้มา : </font></td>
<td bgcolor="#FFFFFF"><label>
<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>
</label></td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">วันที่จัดซื้อ : </font></td>
<td bgcolor="#FFFFFF" class="style1"><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 color="#000000" size="2" face="Tahoma" class="style2">ปี พ.ศ.</font><font color="#000000" face="Tahoma">
<input name="mYear" type="text" class="input" id="mYear" value="<? echo $mYear ?>" size="3" maxlength="4" />
</font></td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#FFFFFF" class="style2">ปีงบประมาณ : </td>
<td bgcolor="#FFFFFF" class="style1"><span class="style2">
<input name="Year" type="text" class="input" id="Year" value="<?=$rs['Year'];?>" size="4" maxlength="4" />
</span></td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">ราคาที่จัดซื้อ/หน่วย : </font></td>
<td bgcolor="#FFFFFF" class="style1"><span class="style31"><span class="style11">
<input name="Price" type="text" class="input" id="Price" value="<?=$rs['Price'];?>" size="7" maxlength="8" />
<font face="Tahoma">บาท</font></span></span></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">หน่วยงาน /ฝ่าย : </font></td>
<td bgcolor="#FFFFFF"><span class="style3"><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>
<span class="style11"></span></font></font></font></a></font></strong></span></td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#FFFFFF" class="style2">ใช้ประจำที่/สถานที่จัดเก็บ : </td>
<td bgcolor="#FFFFFF"><a href="AddAccType.php">
<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>
</a></td>
</tr>
<tr>
<td height="35" align="right" bgcolor="#FFFFFF" class="style2">สถานะการใช้งาน : </td>
<td bgcolor="#FFFFFF"><input name="Status" type="checkbox" id="Status" value="Y" <?php if( $rs['Status'] == "Y" ) echo 'checked'; ?> />
ใช้งานอยู่
<input name="Status" type="checkbox" id="Status" value="N" <?php if( $rs['Status'] == "N" ) echo 'checked'; ?> />
ยกเลิกการใช้งาน</td>
</tr>
<tr>
<td height="35" align="right" bgcolor="#FFFFFF" class="style2">ลักษณะคุณสมบัติของครุภัณฑ์ : </td>
<td bgcolor="#FFFFFF"><span class="style3">
<textarea name="Statistic" cols="50" rows="3" id="Statistic"><?=$rs['Statistic'];?>
</textarea>
</td>
</tr>
<tr>
<td height="27" align="right" bgcolor="#FFFFFF" class="style2">ชื่อผู้ขาย / บริจาค : </td>
<td bgcolor="#FFFFFF">
<select name="Sell_id" OnChange="resutName(this.value);">
<?
$strSQL = " SELECT * FROM accessories_sell AS sell LEFT JOIN accessories_tb AS tb ON sell.sell_id=tb.sell_id GROUP BY sell.sell_id;";
$objQuery = mysql_query($strSQL);
while($objResult1 = mysql_fetch_array($objQuery))
{
?>
<option value="<?=$objResult1["sell_id"];?>"
<?php if( $objResult1["sell_id"]==$rs["sell_id"] )
{
echo 'selected';
}
else if ($objResult1["sell_id"]=" ")
{
echo ' กรุณาเลือกชื่อผู้ขาย / บริจาค';
}?>> <?=$objResult1["sell_name"];?></option>
<?
}
?>
</select>
</td>
</tr>
<tr>
<td height="16" align="right" bgcolor="#FFFFFF" class="style2">ที่อยู่ผู้ขาย : </td>
<td bgcolor="#FFFFFF">
<input name="Address" type="text" size="50" value="<?=$objResult["sell_address"];?>" disabled="disabled">
</td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#FFFFFF" class="style2"><font face="Tahoma">โทรศัพท์ : </font></td>
<td bgcolor="#FFFFFF"><input name="Phone" type="text" class="input " id="Phone" value="<?=$objResult["sell_tel"];?>" size="10" disabled="disabled" /></td>
</tr>
<tr>
<td height="24" align="right" 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 name="AccId" type="hidden" id="AccId" value="<?=$rs['AccId']; ?>" />
<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);
|