<?php
include("./include/FunctionDB.php");
include(
"./include/Function.php");
@
session_start();
  
ConnectDB();
$Flag true;
$Info_name htmlspecialchars(trim($Info_name));
$Info_detail htmlspecialchars(trim($Info_detail));
$Email htmlspecialchars(trim($Email));
$Supervisor =  htmlspecialchars(trim($Supervisor));

//

if ($_SESSION['AntiSpamImage'] != $_REQUEST['antispamcode']){    
    echo 
"<br><br><br><center>";    
    echo 
"<table width=60% border=0 bgcolor=#f0ffff cellpadding=2 cellspacing=0>";
    echo 
"<tr><td align=center><br><br>";    
    echo 
"<font size=3 color=red><b>รหัสป้องกัน Spam ไม่ถูกต้อง <a href='javascript:history.back()'>กลับไปแก้ไขข้อมูล</a></b></font>";
    echo 
"<br><br><br></td></tr>";
    echo 
"</table>";    
    echo 
"</center>";
}
else{

///////////////////////// Check Status to Insert Data /////////////////////////////
  
    
if(getenv(HTTP_X_FORWARDED_FOR)){
        
$IP getenv(HTTP_X_FORWARDED_FOR);
    }     
    else{
        
$IP getenv("REMOTE_ADDR");
    }

     
//InsertComment($Info_name,$Info_detail,$Organiz,$Supervisor,$IP,$Date);
    
$sql "INSERT INTO comment_tb(Info_name, Info_detail, Supervisor, Email, IP, Date) VALUES ('".$Info_name."','".$Info_detail."','".$Supervisor."','".$Email."','".$IP."',NOW() )";
    
mysql_query($sql);

    
//$msg.="<li>ระบบจัดเก็บข้อมูลของท่านเรียบร้อยแล้ว";
    //echo"<center><font face=\"Ms San serif\"size=\"6\" color=\"#FF0000\">Complete</font></center>";
    //echo"<meta http-equiv=\"refresh\" content=\"1;URL=Addcomment.php\">";
    
CloseDB();
}
?>

<!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" />
<script language="javascript" src="js/utilities.js"></script>
<title>สายตรงถึงผู้อำนวยการ</title>
</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("templates/incMainMenuLeft.php");?></td>
    <td width="800" height="440" align="center" valign="top" style="padding:10px 0px 5px 10px"><fieldset>
     <table width="780" border="0" cellspacing="0" cellpadding="0">
      <form id="myForm" name="myForm" method="post" action="">
      <tr>
        <td height="5"></td>
      </tr>
      <tr>
        <td height="30" background="images/background/bg-head-topic-w780.gif" class="PADDING-LEFT-10"><div align="left"><strong><a href="index.php">หน้าหลัก</a></strong> <strong>&raquo; <span class="NOTE">สายตรงถึงผู้อำนวยการ</span></strong></div></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="435" align="center"><span class="TEXT-GREEN10"><strong>ระบบจัดเก็บข้อมูลของท่านเรียบร้อยแล้ว</strong></span><br />
          กรุณารอส้กครู่ กำลังเปลี่ยนหน้าอัตโนมัติ<br />
          <?php echo "<meta http-equiv=\"refresh\" content=\"2; URL=Addcomment.php\">"?></td>
      </tr>
      </form>
    </table>
   </fieldset></td>
  </tr>
</table>
<?php include("templates/incFooter.php"); ?>
</body>
</html>