Viewing file: FrmEdit.php (9.52 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
$Username = $valid_user;
$Password = $password;
include("../../include/FunctionDB.php");
include("../../include/Function.php");
ConnectDB();
$sql ="SELECT * FROM manament_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" topmargin="0 " >
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="1" style="border:1px solid gray">
<tr bgcolor="#CCCCFF" >
<td height="25" colspan="3" bgcolor="#0066CC"><img src="../../Image/Manlogo.jpg" width="837" height="110"></td>
</tr>
<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 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"><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="#FFFFFF">
<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"><select name="Acc_name" id="Acc_name" class="input1">
<?php
$Acc_name = $rs[Acc_name];
$strSQL6 = "SELECT * FROM manament_tb Where code='$code' ";
$result6 = mysql_query($strSQL6);
$strSQL7 = "SELECT * FROM manament_tb ";
$result7 = mysql_query($strSQL7);
while( $rs6 = mysql_fetch_array($result6))
{
echo"<option value=\"$rs6[Acc_name]\" ><b>$rs6[Acc_code] $rs6[Acc_name]</b></option>\n";
while( $rs7 = mysql_fetch_array($result7))
{
echo"<option value=\"$rs7[Acc_name]\" ><b>$rs7[Acc_code] $rs7[Acc_name]</b></option>\n";
}
}
?>
</select></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];
$strSQL4 = "SELECT * FROM personal_tb Where Teacher_code='$Teacher_code' ";
$result4 = mysql_query($strSQL4);
$strSQL5 = "SELECT * FROM personal_tb Where Permision='2' Order by Teacher_name";
$result5 = mysql_query($strSQL5);
while( $rs4 = mysql_fetch_array($result4))
{
echo"<option value=\"$rs4[Teacher_code]\" ><b>$rs4[Teacher_name] $rs4[Teacher_lastname]</b></option>\n";
while( $rs5 = mysql_fetch_array($result5))
{
echo"<option value=\"$rs5[Teacher_code]\" ><b>$rs5[Teacher_name] $rs5[Teacher_lastname]</b></option>\n";
}
}
?>
</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="Status" <?php if (!(strcmp("$rs[Status]","Hand piece"))){echo "checked";} ?> value="Hand piece">
Hand piece
<input type="radio" name="Status" <?php if (!(strcmp("$rs[Status]","X-ray"))){echo "checked";} ?> value="X-ray">
X-ray
<input type="radio" name="Status" <?php if (!(strcmp("$rs[Status]","Air compressor"))){echo "checked";} ?> value="Air compressor">
Air compressor
<input type="radio" name="Status" <?php if (!(strcmp("$rs[Status]","Dental Chair"))){echo "checked";} ?> value="Dental Chair">
Dental chair
<input type="radio" name="Status" <?php if (!(strcmp("$rs[Status]","เครื่องขูดหินปูน"))){echo "checked";} ?> value="เครื่องขูดหินปูน">
เครื่องขูดหินปูน</font></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="22" bgcolor="#EEEEEE"> </td>
<td><font color="#FF0000" size="4" face="Tahoma"><strong>*</strong></font></td>
<td bgcolor="#EEEEEE"><font size="2" face="Tahoma">
<input type="radio" name="Status" <?php if (!(strcmp("$rs[Status]","เครื่องฉายแสง"))){echo "checked";} ?> value="เครื่องฉายแสง">
เครื่องฉายแสง
<input type="radio" name="Status" <?php if (!(strcmp("$rs[Status]","Autocalve"))){echo "checked";} ?> value="Autocalve">
Autocalve
<input type="radio" name="Status" <?php if (!(strcmp("$rs[Status]","เครื่องปั่นอมัลกั้ม"))){echo "checked";} ?> value="เครื่องปั่นอมัลกั้ม">
เครื่องปั่นอมัลกั้ม
<input type="radio" name="Status" <?php if (!(strcmp("$rs[Status]","Hot air oven"))){echo "checked";} ?> value="Hot air oven">
Hot air oven
<input type="radio" name="Status" <?php if (!(strcmp("$rs[Status]","Dental unit"))){echo "checked";} ?> value="Dental unit">
Dental Unit </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="Acc_code" type="text" id="Acc_code" value="<? echo $rs[Acc_code]?>" size="50">
</font></td>
</tr>
<tr bgcolor="#eeeeee">
<td><div align="center"><font size="2" face="Tahoma">สถานที่อุปกรณ</font>์</div></td>
<td> </td>
<td bgcolor="#eeeeee"><input name="Store" type="text" class="input" id="Store" value="<? echo $rs[Store]?>" size="50"></td>
</tr>
<tr bgcolor="#eeeeee">
<td> <div align="center"><font size="2" face="Tahoma">สาเหตุอาการ</font></div></td>
<td> </td>
<td bgcolor="#eeeeee">
<textarea name="Contact" cols="40" rows="5" id="Contact" class="input1"><? echo $rs[Contact]?></textarea> </td>
</tr>
<tr bordercolor="#99CCFF">
<td bgcolor="#EEEEEE"><div align="center"><font 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"><img name="Imag1" src=" " width="100" height="100"></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>
|