<?php
include("../include/FunctionDB.php");

  
ConnectDB();
$Flag true;
$Cate_name htmlspecialchars(trim($_POST[Cate_name]));
$Cate_nameE htmlspecialchars(trim($_POST[Cate_nameE]));


///////////////////// check Code
if ($Cate_name =="")
{
$msg .="<li>กรุณาระบุ ชื่อหมวดวิชา";
$button ="<input type=\"button\" value=\"Back to Edit\" onclick=\"history.back();\" style=\"font-weight:bold;color:#FFF;background-color:#036;border-style:outset;border-color:#69F;font-family:Tohoma;\">";
$Flag false;
}
///////////////////// check name
if ($Cate_nameE =="")
{
$msg .="<li>กรุณาระบุ ชื่อหมวดวิชา English";
$button ="<input type=\"button\" value=\"Back to Edit\" onclick=\"history.back();\" style=\"font-weight:bold;color:#FFF;background-color:#036;border-style:outset;border-color:#69F;font-family:Tohoma;\">";
$Flag false;
}

///////////////////////// Check Status to Insert Data /////////////////////////////
    
if( $Flag)
    {
        
     
InsertSubCate($Cate_name,$Cate_nameE);
          
$msg.="<li>ระบบจัดเก็บข้อมูลเรียบร้อยแล้ว";
 
//         $button = "<input type=\"reset\" value=\"Close Windows\" onclick=\"javascript:parent.close();\" style=\"font-weight:bold;color:#FFF;background-color:#036;border-style:outset;border-color:#69F;font-family:Tohoma;\">";
//        echo"<center><font face=\"Ms San serif\"size=\"6\" color=\"#FF0000\">Complete</font></center>";
        
echo"<meta http-equiv=\"refresh\" content=\"1;URL=SubCateList.php\">";         
    }
    
CloseDB();
?>
<html>
<head>
<title>Insert Subject Category....</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link rel="stylesheet" href="../../../css/style1.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0"marginwidth="0"marginheight="0">
<form>
<br>
  <table width="70%" border="0" cellspacing="0"cellpadding="2"align="center">
    <tr>
      <td><div align="center"><span><b><font color="#003399" size="4" face="Tahoma">::แบบฟอร์มข้อมูลหมวดวิชา::</font></b></span></div></td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="1"cellpadding="0"align="center"bordercolor="#0B62D9" class="table">
          <tr>
            <td bgcolor="#9ABFED"><div align="center"><b><font color="#000000" size="4" face="Tahoma">ระบบแจ้งการทำงาน</font></b></div></td>
</tr>
<tr>
            <td bgcolor="#000000"> 
              <table width="90%" border="0" cellspacing="0"cellpadding="2"align="center">
<tr>
<td><span><b><font color="#FFFFFF"><?php echo $msg;?></font></b></span></td>
</tr>
</table>
</td>
</tr>
<tr>
            <td bgcolor="#9ABFED"> 
              <div align="center"><b><font color="#CCFF00"><?php echo $button;?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size="2" face="Tahoma"></font></font></b></div></td>
</tr>
</table>
</td>
</tr>
</table>
  <br>
</form>

</body>
</html>