<?php require_once('Connections/login.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;
}
}
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['textfield'])) {
  $loginUsername=$_POST['textfield'];
  $password=$_POST['textfield2'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "index.html";
  $MM_redirectLoginFailed = "No.php";
  $MM_redirecttoReferrer = false;
  mysql_select_db($database_login, $login);
  
  $LoginRS__query=sprintf("SELECT username, password FROM tb_login WHERE username=%s AND password=%s",
    GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 
   
  $LoginRS = mysql_query($LoginRS__query, $login) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";
    
	if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;	      

    if (isset($_SESSION['PrevUrl']) && false) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];	
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
?>
<html>
<head>
<title>index</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {
	background-image: url(x1pjzF2-RYhxRWtSbRE9koX_UC5d1CLg-1.gif);
}
</style>
</head>
<center><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<style type="text/css">BODY {cursor:url(http://i1318.photobucket.com/albums/t660/keynaftyaless/17_zps6176f848.png),auto;}a {cursor:url(http://i1318.photobucket.com/albums/t660/keynaftyaless/172_zps5774b852.png),auto;}</style>
<!-- Save for Web Slices (index.psd) -->
<table id="Table_01" width="1025" height="1657" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="34">
			<img src="images/index_01.gif" width="1024" height="413" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="413" alt=""></td>
	</tr>
	<tr>
		<td colspan="4" rowspan="3"><a href="R.html"><img src="images/index_02.gif" width="106" height="63" alt=""></a></td>
		<td rowspan="3"><a href="R.html"><img src="images/index_03.gif" width="105" height="63" alt=""></a></td>
		<td rowspan="3">
			<img src="images/index_04.gif" width="2" height="63" alt=""></td>
		<td colspan="6" rowspan="3"><a href="R.html"><img src="images/index_05.gif" width="113" height="63" alt=""></a></td>
		<td rowspan="3"><a href="R.html"><img src="images/index_06.gif" width="106" height="63" alt=""></a></td>
		<td rowspan="3"><a href="R.html"><img src="images/index_07.gif" width="94" height="63" alt=""></a></td>
		<td rowspan="3">
			<img src="images/index_08.gif" width="3" height="63" alt=""></td>
		<td rowspan="3"><a href="RR.html"><img src="images/index_09.gif" width="92" height="63" alt=""></a></td>
		<td rowspan="3">
			<img src="images/index_10.gif" width="6" height="63" alt=""></td>
		<td rowspan="3"><a href="RR.html"><img src="images/index_11.gif" width="98" height="63" alt=""></a></td>
		<td rowspan="3">
			<img src="images/index_12.gif" width="4" height="63" alt=""></td>
		<td colspan="6" rowspan="2"><a href="RR.html"><img src="images/index_13.gif" width="102" height="62" alt=""></a></td>
		<td colspan="3">
			<img src="images/index_14.gif" width="104" height="3" alt=""></td>
		<td colspan="6" rowspan="3"><a href="RR.html"><img src="images/index_15.gif" width="89" height="63" alt=""></a></td>
		<td>
			<img src="images/spacer.gif" width="1" height="3" alt=""></td>
	</tr>
	<tr>
		<td rowspan="2">
			<img src="images/index_16.gif" width="3" height="60" alt=""></td>
		<td rowspan="2"><a href="RR.html"><img src="images/index_17.gif" width="98" height="60" alt=""></a></td>
		<td rowspan="2">
			<img src="images/index_18.gif" width="3" height="60" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="59" alt=""></td>
	</tr>
	<tr>
		<td colspan="6">
			<img src="images/index_19.gif" width="102" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="1" alt=""></td>
	</tr>
	<tr>
		<td colspan="34">
			<img src="images/index_20.gif" width="1024" height="40" alt="">
			<form name="form2" method="post" action="">
		  </form></td>
		<td>
			<img src="images/spacer.gif" width="1" height="40" alt=""></td>
	</tr>
	<tr>
		<td colspan="34">
			<img src="images/index_21.gif" width="1024" height="66" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="66" alt=""></td>
	</tr>
	<tr>
		<td colspan="21">
			<img src="images/index_22.gif" width="762" height="18" alt=""></td>
		<td colspan="12" rowspan="2" valign="top" bgcolor=""><form name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
		  <p>
		    <label for="textfield">username</label>
		    <input type="text" name="textfield" id="username">
		  </p>
		  <p>
		    <label for="textfield2">password</label>
		    <input type="text" name="textfield2" id="password">
	      </p>
		  <p>
		    <input type="submit" name="Submit" id="button" value="OK">
		    <input type="reset" name="button2" id="button2" value="cancet">
&#3626;&#3617;&#3633;&#3588;&#3619;&#3626;&#3617;&#3634;&#3594;&#3636;&#3585;&#3651;&#3627;&#3617;&#3656;</p>
        </form></td>
		<td rowspan="26">
			<img src="images/index_24.gif" width="11" height="1074" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="18" alt=""></td>
	</tr>
	<tr>
		<td colspan="10" rowspan="9">
			<img src="images/index_25.gif" width="280" height="446" alt=""></td>
		<td colspan="10" rowspan="3">
			<img src="images/index_26.gif" width="460" height="336" alt=""></td>
		<td rowspan="25">
			<img src="images/index_27.gif" width="22" height="1056" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="204" alt=""></td>
	</tr>
	<tr>
		<td colspan="12">
			<img src="images/index_28.gif" width="251" height="115" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="115" alt=""></td>
	</tr>
	<tr>
		<td colspan="2" rowspan="14">
			<img src="images/index_29.gif" width="28" height="308" alt=""></td>
		<td colspan="6" rowspan="2"><a href="https://www.google.co.th/?gws_rd=cr,ssl&ei=f4H6VZT5F4yeuQSkl6C4AQ"><img src="images/index_30.gif" width="191" height="39" alt=""></a></td>
		<td colspan="4" rowspan="3">
			<img src="images/index_31.gif" width="32" height="53" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="17" alt=""></td>
	</tr>
	<tr>
		<td colspan="10" rowspan="4">
			<img src="images/index_32.gif" width="460" height="95" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="22" alt=""></td>
	</tr>
	<tr>
		<td colspan="6">
			<img src="images/index_33.gif" width="191" height="14" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="14" alt=""></td>
	</tr>
	<tr>
		<td rowspan="3">
			<img src="images/index_34.gif" width="1" height="63" alt=""></td>
		<td colspan="6"><a href="https://www.youtube.com/"><img src="images/index_35.gif" width="193" height="48" alt=""></a></td>
		<td colspan="3" rowspan="5">
			<img src="images/index_36.gif" width="29" height="121" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="48" alt=""></td>
	</tr>
	<tr>
		<td colspan="6" rowspan="2">
			<img src="images/index_37.gif" width="193" height="15" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="11" alt=""></td>
	</tr>
	<tr>
		<td rowspan="18">
			<img src="images/index_38.gif" width="13" height="625" alt=""></td>
		<td colspan="9" rowspan="16">
			<img src="images/index_39.gif" width="447" height="398" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="4" alt=""></td>
	</tr>
	<tr>
		<td colspan="7" rowspan="2"><a href="https://www.facebook.com/"><img src="images/index_40.gif" width="194" height="58" alt=""></a></td>
		<td>
			<img src="images/spacer.gif" width="1" height="11" alt=""></td>
	</tr>
	<tr>
		<td colspan="2" rowspan="2">
			<img src="images/index_41.gif" width="22" height="50" alt=""></td>
		<td colspan="5" rowspan="2">
			<img src="images/index_42.gif" width="241" height="50" alt=""></td>
		<td colspan="3" rowspan="2">
			<img src="images/index_43.gif" width="17" height="50" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="47" alt=""></td>
	</tr>
	<tr>
		<td colspan="8" rowspan="2">
			<img src="images/index_44.gif" width="195" height="60" alt=""></td>
		<td colspan="2" rowspan="6">
			<img src="images/index_45.gif" width="28" height="134" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="3" alt=""></td>
	</tr>
	<tr>
		<td rowspan="14">
			<img src="images/index_46.gif" width="18" height="560" alt=""></td>
		<td colspan="8"><a href="B.html"><img src="images/index_47.gif" width="248" height="57" alt=""></a></td>
		<td rowspan="14">
			<img src="images/index_48.gif" width="14" height="560" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="57" alt=""></td>
	</tr>
	<tr>
		<td colspan="8">
			<img src="images/index_49.gif" width="248" height="9" alt=""></td>
		<td colspan="8" rowspan="4">
			<img src="images/index_50.gif" width="195" height="74" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="9" alt=""></td>
	</tr>
	<tr>
		<td rowspan="7">
			<img src="images/index_51.gif" width="4" height="171" alt=""></td>
		<td colspan="6"><a href="V.html"><img src="images/index_52.gif" width="242" height="48" alt=""></a></td>
		<td rowspan="12">
			<img src="images/index_53.gif" width="2" height="494" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="48" alt=""></td>
	</tr>
	<tr>
		<td colspan="6">
			<img src="images/index_54.gif" width="242" height="10" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="10" alt=""></td>
	</tr>
	<tr>
		<td colspan="6" rowspan="2"><a href="c.html"><img src="images/index_55.gif" width="242" height="47" alt=""></a></td>
		<td>
			<img src="images/spacer.gif" width="1" height="7" alt=""></td>
	</tr>
	<tr>
		<td rowspan="9">
			<img src="images/index_56.gif" width="14" height="429" alt=""></td>
		<td colspan="10" rowspan="8"><embed src="http://www.123mycodes.com/flash/calendar/hearts/4.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="230" height="189"></embed><br></td>
		<td rowspan="9">
			<img src="images/index_58.gif" width="7" height="429" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="40" alt=""></td>
	</tr>
	<tr>
		<td colspan="6">
			<img src="images/index_59.gif" width="242" height="9" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="9" alt=""></td>
	</tr>
	<tr>
		<td rowspan="2">
			<img src="images/index_60.gif" width="2" height="57" alt=""></td>
		<td colspan="4"><a href="d.html"><img src="images/index_61.gif" width="239" height="41" alt=""></a></td>
		<td rowspan="7">
			<img src="images/index_62.gif" width="1" height="380" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="41" alt=""></td>
	</tr>
	<tr>
		<td colspan="4">
			<img src="images/index_63.gif" width="239" height="16" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="16" alt=""></td>
	</tr>
	<tr>
		<td colspan="6"><a href="Name.html"><img src="images/index_64.gif" width="245" height="47" alt=""></a></td>
		<td>
			<img src="images/spacer.gif" width="1" height="47" alt=""></td>
	</tr>
	<tr>
		<td colspan="6">
			<img src="images/index_65.gif" width="245" height="9" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="9" alt=""></td>
	</tr>
	<tr>
		<td colspan="2" rowspan="3">
			<img src="images/index_66.gif" width="6" height="267" alt=""></td>
		<td colspan="4" rowspan="2"><a href="https://docs.google.com/forms/d/1NeDreRiUke6qKpLsYD8-hY1cEkcs6P4VcZRF0HxPMbs/viewform?usp=send_form"><img src="images/index_67.gif" width="239" height="83" alt=""></a></td>
		<td>
			<img src="images/spacer.gif" width="1" height="40" alt=""></td>
	</tr>
	<tr>
		<td colspan="9" rowspan="2">
			<img src="images/index_68.gif" width="447" height="227" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="43" alt=""></td>
	</tr>
	<tr>
		<td colspan="4">
			<img src="images/index_69.gif" width="239" height="184" alt=""></td>
		<td colspan="10">
			<img src="images/index_70.gif" width="230" height="184" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="184" alt=""></td>
	</tr>
	<tr>
		<td>
			<img src="images/spacer.gif" width="18" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="4" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="2" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="82" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="105" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="2" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="50" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="2" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="14" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="13" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="33" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="106" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="94" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="3" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="92" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="6" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="98" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="4" 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="14" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="14" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="40" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="3" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="98" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="3" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="46" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="3" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="21" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="7" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="11" height="1" alt=""></td>
		<td></td>
	</tr>
</table>
<!-- End Save for Web Slices -->
</center>
</body>
</html>