Viewing file: FrmEdit.php (9.92 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include("../../include/FunctionDB.php");
include("../../include/Function.php");
include("header.php");
ConnectDB();
$sql ="SELECT * FROM bookmant_tb Where code='$code'";
$result = mysql_query($sql) or die("Cannot Select").mysql_error();
$rs = mysql_fetch_array($result);
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function browse()
{
form1.Imag1.src = form1.Img1.value;
}
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
function chk(c){
if (c.checked){
document.all.Prob1.disabled=false;
document.all.Prob2.disabled=false;
document.all.Prob3.disabled=false;
document.all.Prob4.disabled=false;
}
else{
document.all.Problem.disabled=false;
}
}
</script>
<html>
<head>
<title>Edit accessories</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="../../css/style1.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" style="border:1px solid gray">
<tr bgcolor="#CCCCFF" >
<td height="25" colspan="3"> <div align="center"><font color="#000000" size="4" face="Tahoma"><strong><font color="#FF0000">แก้ไข</font>
ข้อมูล</strong></font></div></td>
</tr>
<form name="form1" method="POST" action="EditMan.php"
enctype="multipart/form-data">
<tr bordercolor="#99CCFF">
<td width="26%" bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma">วันที่รับ</font></div></td>
<td width="2%" bgcolor="#EEEEEE"><div align="center"><font color="#FF0000" size="4" face="Tahoma"><strong>*</strong></font></div></td>
<td width="72%" bgcolor="#EEEEEE"><font color="#000000" size="2" face="Tahoma">วันที่
<select name="mDate" id="select4" class="select" >
<?php
$Date_buy = $rs[Date_buy];
$yearthai = explode("-",$Date_buy);
$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="select5" class="select" >
<?php
$Date_buy = $rs[Date_buy];
$yearthai = explode("-",$Date_buy);
$mDate= intval($yearthai[2]);
$Month = intval($yearthai[1]);
$mYear2= 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>
ปี พ.ศ.
<input name="mYear" type="text" id="mYear" size="4" class="input1" value="<? echo $mYear?>" >
</font></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="20" bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma">เลขที่หนังสือรับ</font></div></td>
<td><div align="center"><font color="#FF0000" size="4" face="Tahoma"><strong>*</strong></font></div></td>
<td><font color="#006633" size="2" face="Tahoma">
<input name="No_in" type="text" id="No_in" value="<? echo $rs[No_in]?>" size="20">
</font></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="22" bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma">วันที่ออก</font></div></td>
<td> </td>
<td><font color="#000000" size="2" face="Tahoma">วันที่
<select name="mDate1" id="mDate1" class="select" >
<?php
$Date_year = $rs[Date_year];
$yearthai = explode("-",$Date_year);
$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="mMonth1" id="mMonth1" class="select" >
<?php
$Date_year = $rs[Date_year];
$yearthai = explode("-",$Date_year);
$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 ";
}
// CloseDB();
// getThaiMonth();
?>
</select>
ปี พ.ศ.
<input name="mYear1" type="text" class="input" id="mYear1" value="<? echo $mYear ?>" size="4">
</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma">นักศึกษาผู้แจ้งซ่อม</font></div></td>
<td bgcolor="#EEEEEE"><div align="center"><font color="#FF0000" size="4" face="Tahoma"><strong>*</strong></font></div></td>
<td bgcolor="#EEEEEE"><strong><font color="#003366" size="2" face="Tahoma">
</font><font color="#006633" size="2" face="Tahoma">
<input name="No_out" type="text" id="No_out" value="<? echo $rs[No_in]?>" size="20">
</font><font color="#003366" size="2" face="Tahoma"> </font></strong></td>
</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma">เรื่อง</font></div></td>
<td bgcolor="#EEEEEE"><div align="center"><font color="#FF0000" size="4" face="Tahoma"><strong>*</strong></font></div></td>
<td bgcolor="#EEEEEE"><strong><font color="#003366" size="2" face="Tahoma"> </font><font color="#006633" size="2" face="Tahoma">
<input name="Status" type="text" id="Status" value="<? echo $rs[Status]?>" size="65">
</font><font color="#003366" size="2" face="Tahoma"> </font></strong></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="22" bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma">ชื่อผู้รับ - ส่งหนังสือ</font></div></td>
<td><font color="#FF0000" size="4" face="Tahoma"><strong>*</strong></font></td>
<td bgcolor="#EEEEEE"><strong><font color="#003366" size="2" face="Tahoma">
<select name="Teacher_code" id="Teacher_code" class="input1">
<?php
$Teacher_code = $rs[Teacher_code];
$strSQL2 = "SELECT * FROM personal_tb Where Teacher_code='$Teacher_code' ";
$result2 = mysql_query($strSQL2);
$strSQL3 = "SELECT * FROM personal_tb Where Permision='2' Order by Teacher_name";
$result3 = mysql_query($strSQL3);
while( $rs2 = mysql_fetch_array($result2))
{
echo"<option value=\"$rs2[Teacher_code]\" ><b>$rs2[Teacher_name] $rs2[Teacher_lastname]</b></option>\n";
while( $rs3 = mysql_fetch_array($result3))
{
echo"<option value=\"$rs3[Teacher_code]\" ><b>$rs3[Teacher_name] $rs3[Teacher_lastname]</b></option>\n";
}
}
CloseDB();
?>
</select>
</font></strong></td>
</tr>
<tr bgcolor="#EEEEEE">
<td bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma"><font size="2">ชนิดอุปกรณ์</font> </font></div></td>
<td><font color="#FF0000" size="4" face="Tahoma"><strong>*</strong></font></td>
<td><font size="2" face="Tahoma">
<input type="radio" name="Statistic" <?php if (!(strcmp("$rs[Statistic]","ภายนอก"))){echo "checked";} ?> value="ภายนอก">
ภายนอก
<input type="radio" name="Statistic" <?php if (!(strcmp("$rs[Statistic]","ภายใน"))){echo "checked";} ?> value="ภายใน">
ภายใน
<strong><font color="#003366" size="2" face="Tahoma">
</font></strong> </font></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="22" bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma">จากหน่วยงาน</font></div></td>
<td><div align="center"><font color="#FF0000" size="4" face="Tahoma"><strong>*</strong></font></div></td>
<td bgcolor="#EEEEEE"><input name="Store_1" type="text" class="input" id="Store_1" value="<? echo $rs[Store_1]?>" size="50">
</td>
</tr>
<tr bgcolor="#eeeeee">
<td><div align="center"><font size="2" face="Tahoma">ถึงหน่วยงาน</font></div></td>
<td> </td>
<td><input name="Store_2" type="text" class="input" id="Store_2" value="<? echo $rs[Store_2]?>" size="50"></td>
</tr>
<tr bordercolor="#99CCFF">
<td bgcolor="#EEEEEE"><div align="center"><font color="#003366" size="2" face="Tahoma">โหลดเอกสาร </font></div></td>
<td bgcolor="#EEEEEE"> </td>
<td bgcolor="#EEEEEE"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="73%"><div align="center">
<font color="#996600" size="2" face="Tahoma"></font>
<input name= "Img1" type="file" class="input" id="Img1" onChange=browse()>
</div></td>
<td width="27%"><div align="center"></div></td>
</tr>
</table></td>
</tr>
<tr bgcolor="#CCCCFF" >
<td height="25" colspan="3"> <div align="center">
<input name="code" type="hidden" id="code" value="<? echo $rs[code]?>">
<input type="submit" name="Submit" value=" บันทึก " class="button">
</div></td>
</tr>
</form>
</table>
</body>
</html>
|