<?php 
include("head2.php");
//include("conn.php");
?>
<center>
<br>
<?php
if($emp_name<>""&&$error<>1){
      echo  "<CENTER>MENU SHOW</CENTER>";
?>

<table width=90% bgcolor=#0099cc border=1>
<tr><td>
<HR width=70%>
<H2>Upload  file  แบบทดสอบ</H2>
<form action="add_file_db.php" method="post" enctype="multipart/form-data" name="upfile" id="upfile">
  <table width="100%" border="0" align="center" cellpadding="2" cellspacing="2">
  <TR bgcolor=#00ccff>
  <TD>แบบทดสอบ</TD>
  <TD><INPUT type="TEXT" size=80 name=QuizTitle></TD>
  </TR>
  <TR bgcolor=#00ccff>
  <TD>ที่มา/ผู้ออกข้อสอบ</TD>
  <TD><INPUT type="TEXT" size=50 name=TestAuther></TD>
  </TR>

  <TR bgcolor=#00ccff>
  <TD>กลุ่มสาระฯ</TD>
  <TD>
  <SELECT name="Group_ID">
 <?php
 $sql="SELECT * FROM Groups  Order by  Group_ID";
$list=odbc_exec($conn,$sql);
$t=1;
while(odbc_fetch_row($list,$t)){
		
		$G_ID=odbc_result($list,"Group_ID");
		$G_Name=odbc_result($list,"Group_Name");
		echo "<OPTION value=$G_ID>$G_Name</OPTION>";
		$t++;
}
 ?>
 </SELECT>
  </TD>
  </TR>

	  <TR bgcolor=#00ccff>
  <TD>ระดับชั้น</TD>
  <TD>
  <SELECT name="Level_ID">
 <?php
 $sql2="SELECT * FROM  ClassLevel  Order by  Level_id";
$list2=odbc_exec($conn,$sql2);
$i=1;
while(odbc_fetch_row($list2,$i)){
		
		$level_ID=odbc_result($list2,"Level_id");
		$level_Name=odbc_result($list2,"Level_FullName");
		echo "<OPTION value=$level_ID>$level_Name</OPTION>";
		$i++;
}
 ?>
 </SELECT>
  </TD>
  </TR>

	  <TR bgcolor=#00ccff>
  <TD>ประเภทแบบทดสอบ</TD>
  <TD>
  <SELECT name="TestType_ID">
 <?php
 $sql3="SELECT * FROM  Test_Type  Order by  Test_Type_ID";
$list3=odbc_exec($conn,$sql3);
$j=1;
while(odbc_fetch_row($list3,$j)){
		
		$Test_Type_ID=odbc_result($list3,"Test_Type_ID");
		$Test_Type_Detail=odbc_result($list3,"Test_Type_Detail");
		echo "<OPTION value=$Test_Type_ID>$Test_Type_Detail</OPTION>";
		$j++;
}
 ?>
 </SELECT>
  </TD>
  </TR>

  <TR bgcolor=#00ccff>
  <TD>ปี พ.ศ.</TD>
  <TD><INPUT type="TEXT" size=10 name=QuizYear></TD>
  </TR>
	<tr>
      <td height="40" colspan="2" align="center" bgcolor="#D6D6D6">Form Upload&nbsp;File</td>
    </tr>
    <tr>
      <td align="center" bgcolor="#EDEDED">File Browser</td>
      <td bgcolor="#EDEDED"><label>
        <input type="file" name="fileupload" id="fileupload"  required="required"/>
      </label></td>
    </tr>
    <tr>
      <td bgcolor="#EDEDED">&nbsp;</td>
      <td bgcolor="#EDEDED"><input type="submit" name="button" id="button" value="Upload" /></td>
    </tr>
  </table>
  <p>&nbsp;</p>
</form>
</td>
</tr>
</table>
<?php
		echo "<a href=\"indexmain.php\">Goto main menu</a>";
?>

<BR>
<?php
}
else{
      echo  "<CENTER>คุณไม่ผ่านการ Login /คุณคือไม่ได้รับสิทธิ์ในการใช้งาน?...</CENTER>";
      echo  "<CENTER><a href=\"index.php\">กลับสู่หน้า Login  อีกครั้ง</a></CENTER>";
}
?>

</center>
<?php 
include("last.php");
?>
