<?php require_once('../Connections/db_conn.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO t_q (mess, `date`, name) VALUES (%s, %s, %s)",
                       GetSQLValueString($_POST['mess'], "text"),
                       GetSQLValueString($_POST['date'], "date"),
                       GetSQLValueString($_POST['name'], "text"));

  mysql_select_db($database_db_conn, $db_conn);
  $Result1 = mysql_query($insertSQL, $db_conn) or die(mysql_error());

  $insertGoTo = "list.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}

mysql_select_db($database_db_conn, $db_conn);
$query_rs = "SELECT * FROM t_q";
$rs = mysql_query($query_rs, $db_conn) or die(mysql_error());
$row_rs = mysql_fetch_assoc($rs);
$totalRows_rs = mysql_num_rows($rs);
?>
<html>
<head>
<title>borad</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
<style type="text/css">
#Table_01 tr td form table {
	font-family: "TH Kodchasal";
	font-weight: bold;
	font-size: 22px;
}
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../images/aa_03.jpg','../images/aa_04.jpg','../images/aa_05.jpg','../images/aa_06.jpg','../images/aa_22.jpg','../images/aa_25.jpg','../images/aa_28.jpg','../images/aa_32.jpg','../images/aa_34.jpg','../images/aa_37.jpg','../images/aa_39.jpg','../images/aa_14.jpg','../images/aa_15.jpg','../images/aa_16.jpg','../images/aa_17.jpg','../images/aa_18.jpg','../images/aa_19.jpg','../images/aa_20.jpg','../images/aa_24.jpg','../images/aa_26.jpg','../images/aa_27.jpg','../images/aa_30.jpg','../images/aa_33.jpg','../images/aa_35.jpg','../images/aa_36.jpg','../images/aa_38.jpg','../images/aa_40.jpg','../images/aa_41.jpg','../images/aa_42.jpg','../images/aa_44.jpg','../images/aa_45.jpg','../images/aa_48.jpg','../images/aa_50.jpg')">
<div align="center"><!-- Save for Web Slices (index.psd) -->
  <table id="Table_01" width="901" height="1301" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td colspan="10">
        <img src="../images/index_01.jpg" width="900" height="291" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="291" alt=""></td>
      </tr>
    <tr>
      <td rowspan="4">
        <img src="../images/index_02.jpg" width="1" height="79" alt=""></td>
      <td colspan="5" rowspan="2"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image107','','../images/aa_03.jpg',1)"><img src="../images/index_03.jpg" name="Image107" width="212" height="59" border="0"></a></td>
      <td rowspan="2"><a href="https://www.facebook.com/udvc.ac.th/photos_stream" target="_new" onMouseOver="MM_swapImage('Image108','','../images/aa_04.jpg',1)" onMouseOut="MM_swapImgRestore()"><img src="../images/index_04.jpg" name="Image108" width="237" height="59" border="0"></a></td>
      <td rowspan="2"><a href="http://www.udvc.ac.th/home.html" target="_new" onMouseOver="MM_swapImage('Image109','','../images/aa_05.jpg',1)" onMouseOut="MM_swapImgRestore()"><img src="../images/index_05.jpg" name="Image109" width="226" height="59" border="0"></a></td>
      <td colspan="2"><a href="borad.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image110','','../images/aa_06.jpg',1)"><img src="../images/index_06.jpg" name="Image110" width="224" height="58" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="58" alt=""></td>
      </tr>
    <tr>
      <td colspan="2" rowspan="2">
        <img src="../images/index_07.jpg" width="224" height="20" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="1" alt=""></td>
      </tr>
    <tr>
      <td colspan="7">
        <img src="../images/index_08.jpg" width="675" height="19" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="19" alt=""></td>
      </tr>
    <tr>
      <td colspan="4">
        <img src="../images/index_09.jpg" width="190" height="1" alt=""></td>
      <td colspan="4" rowspan="36" align="center" valign="top"><form action="<?php echo $editFormAction; ?>" name="form1" method="POST">
        <p>&nbsp;</p>
        <table width="400" border="1">
          <tr>
            <td colspan="2" align="center">&#3650;&#3614;&#3626;&#3585;&#3619;&#3632;&#3607;&#3641;&#3657;&#3651;&#3627;&#3617;&#3656;</td>
          </tr>
          <tr>
            <td width="104" align="center">&#3627;&#3633;&#3623;&#3586;&#3657;&#3629;&#3585;&#3619;&#3632;&#3607;&#3641;&#3657;</td>
            <td align="center" valign="top"><p>
              <textarea name="mess" id="textfield2"></textarea>
            </p>
              <p>
                <label for="label"></label>
              </p></td>
          </tr>
          <tr>
            <td>&#3650;&#3604;&#3618;</td>
            <td><input name="name" type="text" id="textfield" value="" /></td>
          </tr>
          <tr>
            <td height="61" colspan="2" align="center">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;
              <input type="submit" name="button" id="button" value="&#3605;&#3585;&#3621;&#3591;" />
              &nbsp; &nbsp;
              <input type="reset" name="button2" id="button2" value="&#3618;&#3585;&#3648;&#3621;&#3636;&#3585;" /></td>
          </tr>
        </table>
        <input name="date" type="hidden" id="date" value="<?php echo $row_rs['date']; ?>">
<p>&nbsp;</p>
<input type="hidden" name="MM_insert" value="form1">
      </form></td>
      <td rowspan="2">
        <img src="../images/index_11.jpg" width="196" height="44" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="1" alt=""></td>
      </tr>
    <tr>
      <td colspan="4" rowspan="8">
        <img src="../images/index_12.jpg" width="180" height="245" alt=""></td>
      <td rowspan="36">
        <img src="../images/index_13.jpg" width="11" height="852" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="43" alt=""></td>
      </tr>
    <tr>
      <td><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image118','','../images/aa_14.jpg',1)"><img src="../images/index_14.jpg" name="Image118" width="196" height="35" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="35" alt=""></td>
      </tr>
    <tr>
      <td><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image119','','../images/aa_15.jpg',1)"><img src="../images/index_15.jpg" name="Image119" width="196" height="33" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="33" alt=""></td>
      </tr>
    <tr>
      <td><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image120','','../images/aa_16.jpg',1)"><img src="../images/index_16.jpg" name="Image120" width="196" height="35" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="35" alt=""></td>
      </tr>
    <tr>
      <td><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image121','','../images/aa_17.jpg',1)"><img src="../images/index_17.jpg" name="Image121" width="196" height="32" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="32" alt=""></td>
      </tr>
    <tr>
      <td><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image122','','../images/aa_18.jpg',1)"><img src="../images/index_18.jpg" name="Image122" width="196" height="32" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="32" alt=""></td>
      </tr>
    <tr>
      <td><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image123','','../images/aa_19.jpg',1)"><img src="../images/index_19.jpg" name="Image123" width="196" height="34" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="34" alt=""></td>
      </tr>
    <tr>
      <td rowspan="2"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image124','','../images/aa_20.jpg',1)"><img src="../images/index_20.jpg" name="Image124" width="196" height="33" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="1" alt=""></td>
      </tr>
    <tr>
      <td rowspan="5">
        <img src="../images/index_21.jpg" width="1" height="114" alt=""></td>
      <td colspan="2" rowspan="2"><a href="a2.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image111','','../images/aa_22.jpg',1)"><img src="../images/index_22.jpg" name="Image111" width="176" height="53" border="0"></a></td>
      <td rowspan="5">
        <img src="../images/index_23.jpg" width="3" height="114" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="32" alt=""></td>
      </tr>
    <tr>
      <td rowspan="2"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image125','','../images/aa_24.jpg',1)"><img src="../images/index_24.jpg" name="Image125" width="196" height="33" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="21" alt=""></td>
      </tr>
    <tr>
      <td colspan="2" rowspan="3"><a href="a3.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image112','','../images/aa_25.jpg',1)"><img src="../images/index_25.jpg" name="Image112" width="176" height="61" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="12" alt=""></td>
      </tr>
    <tr>
      <td><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image126','','../images/aa_26.jpg',1)"><img src="../images/index_26.jpg" name="Image126" width="196" height="33" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="33" alt=""></td>
      </tr>
    <tr>
      <td rowspan="2"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image127','','../images/aa_27.jpg',1)"><img src="../images/index_27.jpg" name="Image127" width="196" height="33" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="16" alt=""></td>
      </tr>
    <tr>
      <td colspan="4" rowspan="3"><a href="a4.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image113','','../images/aa_28.jpg',1)"><img src="../images/index_28.jpg" name="Image113" width="180" height="63" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="17" alt=""></td>
      </tr>
    <tr>
      <td>
        <img src="../images/index_29.jpg" width="196" height="43" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="43" alt=""></td>
      </tr>
    <tr>
      <td rowspan="2"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image128','','../images/aa_30.jpg',1)"><img src="../images/index_30.jpg" name="Image128" width="196" height="34" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="3" alt=""></td>
      </tr>
    <tr>
      <td rowspan="20">
        <img src="../images/index_31.jpg" width="1" height="430" alt=""></td>
      <td colspan="3" rowspan="2"><a href="a5.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image114','','../images/aa_32.jpg',1)"><img src="../images/index_32.jpg" name="Image114" width="179" height="65" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="31" alt=""></td>
      </tr>
    <tr>
      <td><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image129','','../images/aa_33.jpg',1)"><img src="../images/index_33.jpg" name="Image129" width="196" height="34" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="34" alt=""></td>
      </tr>
    <tr>
      <td colspan="3" rowspan="2"><a href="a6.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image115','','../images/aa_34.jpg',1)"><img src="../images/index_34.jpg" name="Image115" width="179" height="57" border="0"></a></td>
      <td><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image130','','../images/aa_35.jpg',1)"><img src="../images/index_35.jpg" name="Image130" width="196" height="35" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="35" alt=""></td>
      </tr>
    <tr>
      <td rowspan="2"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image131','','../images/aa_36.jpg',1)"><img src="../images/index_36.jpg" name="Image131" width="196" height="32" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="22" alt=""></td>
      </tr>
    <tr>
      <td colspan="3" rowspan="2"><a href="a7.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image116','','../images/aa_37.jpg',1)"><img src="../images/index_37.jpg" name="Image116" width="179" height="40" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="10" alt=""></td>
      </tr>
    <tr>
      <td rowspan="2"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image132','','../images/aa_38.jpg',1)"><img src="../images/index_38.jpg" name="Image132" width="196" height="33" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="30" alt=""></td>
      </tr>
    <tr>
      <td colspan="3" rowspan="4"><a href="a8.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image117','','../images/aa_39.jpg',1)"><img src="../images/index_39.jpg" name="Image117" width="179" height="81" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="3" alt=""></td>
      </tr>
    <tr>
      <td><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image133','','../images/aa_40.jpg',1)"><img src="../images/index_40.jpg" name="Image133" width="196" height="35" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="35" alt=""></td>
      </tr>
    <tr>
      <td><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image134','','../images/aa_41.jpg',1)"><img src="../images/index_41.jpg" name="Image134" width="196" height="32" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="32" alt=""></td>
      </tr>
    <tr>
      <td rowspan="2"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image135','','../images/aa_42.jpg',1)"><img src="../images/index_42.jpg" name="Image135" width="196" height="33" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="11" alt=""></td>
      </tr>
    <tr>
      <td colspan="3" rowspan="3">
        <img src="../images/index_43.jpg" width="179" height="63" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="22" alt=""></td>
      </tr>
    <tr>
      <td><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image136','','../images/aa_44.jpg',1)"><img src="../images/index_44.jpg" name="Image136" width="196" height="33" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="33" alt=""></td>
      </tr>
    <tr>
      <td rowspan="2"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image137','','../images/aa_45.jpg',1)"><img src="../images/index_45.jpg" name="Image137" width="196" height="34" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="8" alt=""></td>
      </tr>
    <tr>
      <td rowspan="7">
        <img src="../images/index_46.jpg" width="11" height="124" alt=""></td>
      <td colspan="2" rowspan="2"><a href="http://www.vec.go.th/" target="_new"><img src="../images/index_47.jpg" width="168" height="33" alt=""></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="26" alt=""></td>
      </tr>
    <tr>
      <td rowspan="2"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image138','','../images/aa_48.jpg',1)"><img src="../images/index_48.jpg" name="Image138" width="196" height="33" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="7" alt=""></td>
      </tr>
    <tr>
      <td colspan="2" rowspan="2"><a href="http://www.vec.go.th/" target="_new"><img src="../images/index_49.jpg" width="168" height="40" alt=""></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="26" alt=""></td>
      </tr>
    <tr>
      <td rowspan="2"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image139','','../images/aa_50.jpg',1)"><img src="../images/index_50.jpg" name="Image139" width="196" height="33" border="0"></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="14" alt=""></td>
      </tr>
    <tr>
      <td colspan="2" rowspan="2"><a href="http://www.v-cop.net/" target="_new"><img src="../images/index_51.jpg" width="168" height="48" alt=""></a></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="19" alt=""></td>
      </tr>
    <tr>
      <td rowspan="2">
        <img src="../images/index_52.jpg" width="196" height="32" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="29" alt=""></td>
      </tr>
    <tr>
      <td colspan="2">
        <img src="../images/index_53.jpg" width="168" height="3" alt=""></td>
      <td colspan="4">
        <img src="../images/index_54.jpg" width="513" height="3" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="3" alt=""></td>
      </tr>
    <tr>
      <td colspan="10">
        <img src="../images/index_55.jpg" width="900" height="78" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="1" height="78" alt=""></td>
      </tr>
    <tr>
      <td>
        <img src="../images/spacer.gif" width="1" height="1" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="11" height="1" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="165" height="1" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="3" height="1" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="11" height="1" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="22" height="1" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="237" height="1" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="226" height="1" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="28" height="1" alt=""></td>
      <td>
        <img src="../images/spacer.gif" width="196" height="1" alt=""></td>
      <td></td>
      </tr>
  </table>
  <!-- End Save for Web Slices -->
</div>
</body>
</html>
<?php
mysql_free_result($rs);
?>
