<?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;
}
}

$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 tb_login (name, telno, username, password) VALUES (%s, %s, %s, %s)",
                       GetSQLValueString($_POST['name'], "text"),
                       GetSQLValueString($_POST['telno'], "text"),
                       GetSQLValueString($_POST['username'], "text"),
                       GetSQLValueString($_POST['password'], "text"));

  mysql_select_db($database_login, $login);
  $Result1 = mysql_query($insertSQL, $login) or die(mysql_error());

  $insertGoTo = "../index.html";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}
?>
<html>
<head>
<title>regis</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ImageReady Preload Script (regis.psd) -->
<script type="text/javascript">
<!--

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		regis_Layer_19_over = newImage("images/regis_Layer-19-over.gif");
		regis_Layer_19_over014 = newImage("images/regis_Layer-19-over-14.gif");
		regis_Layer_19_over016 = newImage("images/regis_Layer-19-over-16.gif");
		regis_Layer_19_over020 = newImage("images/regis_Layer-19-over-20.gif");
		regis_Layer_19_over022 = newImage("images/regis_Layer-19-over-22.gif");
		regis_Layer_21_over = newImage("images/regis_Layer-21-over.gif");
		preloadFlag = true;
	}
}

// -->
</script>
<!-- End Preload Script -->
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="preloadImages();">
<!-- ImageReady Slices (regis.psd) -->
<table id="Table_01" width="1025" height="1000" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="8">
      <img src="images/regis_01.gif" alt="" width="1024" height="320" border="0" usemap="#Map"></td>
		<td>
			<img src="images/spacer.gif" width="1" height="320" alt=""></td>
	</tr>
	<tr>
		<td rowspan="9">
			<img src="images/regis_02.gif" width="41" height="329" alt=""></td>
		<td rowspan="3"><a href="index.html"><img name="regis_Layer_19" src="images/regis_Layer-19.gif" width="181" height="66" border="0" alt=""></a></td>
		<td colspan="6">
			<img src="images/regis_04.gif" width="802" height="27" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="27" alt=""></td>
	</tr>
	<tr>
		<td colspan="2" rowspan="8">
			<img src="images/regis_05.gif" width="19" height="302" alt=""></td>
		<td rowspan="10" align="center" bgcolor="#CCFFFF">&nbsp;
		  <h1>&#3626;&#3617;&#3633;&#3588;&#3619;&#3626;&#3617;&#3634;&#3594;&#3636;&#3585;
          </h1>
		  <form method="post" name="form1" action="<?php echo $editFormAction; ?>">
            <table align="center">
              <tr valign="baseline">
                <td width="70" align="center" nowrap><h4>&#3594;&#3639;&#3656;&#3629;</h4></td>
                <td width="192"><h4>
                  <input type="text" name="name" value="" size="32">
                </h4></td>
              </tr>
              <tr valign="baseline">
                <td nowrap align="center"><h4>&#3648;&#3610;&#3629;&#3619;&#3660;&#3650;&#3607;&#3619;</h4></td>
                <td><h4>
                  <input type="text" name="telno" value="" size="32">
                </h4></td>
              </tr>
              <tr valign="baseline">
                <td nowrap align="center"><h4>&#3594;&#3639;&#3656;&#3629;&#3612;&#3641;&#3657;&#3651;&#3594;&#3657;</h4></td>
                <td><h4>
                  <input type="text" name="username" value="" size="32">
                </h4></td>
              </tr>
              <tr valign="baseline">
                <td nowrap align="center"><h4>&#3619;&#3627;&#3633;&#3626;&#3612;&#3656;&#3634;&#3609;</h4></td>
                <td><h4>
                  <input type="text" name="password" value="" size="32">
                </h4></td>
              </tr>
              <tr valign="baseline">
                <td nowrap align="center"><h4>&nbsp;</h4></td>
                <td><h4>
                  <input type="submit" value="&#3610;&#3633;&#3609;&#3607;&#3638;&#3585;">
                  <input type="reset" name="button3" id="button3" value="&#3618;&#3585;&#3648;&#3621;&#3636;&#3585;">
                </h4></td>
              </tr>
            </table>
            <input type="hidden" name="MM_insert" value="form1">
          </form>
        <p>&nbsp;</p></td>
		<td colspan="3">
    <img src="images/regis_07.gif" width="283" height="11" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="11" alt=""></td>
	</tr>
	<tr>
		<td rowspan="10">
			<img src="images/regis_08.gif" width="25" height="567" alt=""></td>
		<td rowspan="3" align="center" valign="top"><p>USERNAME
		  <input type="text" name="username" id="username">
		  PASSWORD
  <input type="text" name="password" id="password">
		  </p>
          <p>
            <input type="submit" name="button" id="button" value="&#3605;&#3585;&#3621;&#3591;">
            <input type="reset" name="button2" id="button2" value="&#3618;&#3585;&#3648;&#3621;&#3636;&#3585;">
        </p></td>
		<td rowspan="10">
<img src="images/regis_10.gif" width="8" height="567" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="28" alt=""></td>
	</tr>
	<tr>
		<td>
			<a href="pa.html"
				onmouseover="changeImages('regis_Layer_19013', 'images/regis_Layer-19-over-14.gif'); return true;"
				onmouseout="changeImages('regis_Layer_19013', 'images/regis_Layer-19-13.gif'); return true;"
				onmousedown="changeImages('regis_Layer_19013', 'images/regis_Layer-19-over-14.gif'); return true;"
				onmouseup="changeImages('regis_Layer_19013', 'images/regis_Layer-19-over-14.gif'); return true;">
			  <img name="regis_Layer_19013" src="images/regis_Layer-19-13.gif" width="181" height="66" border="0" alt=""></a></td>
		<td>
			<img src="images/spacer.gif" width="1" height="66" alt=""></td>
	</tr>
	<tr>
		<td rowspan="3">
			<a href="sa.html"
				onmouseover="changeImages('regis_Layer_19015', 'images/regis_Layer-19-over-16.gif'); return true;"
				onmouseout="changeImages('regis_Layer_19015', 'images/regis_Layer-19-15.gif'); return true;"
				onmousedown="changeImages('regis_Layer_19015', 'images/regis_Layer-19-over-16.gif'); return true;"
				onmouseup="changeImages('regis_Layer_19015', 'images/regis_Layer-19-over-16.gif'); return true;">
			  <img name="regis_Layer_19015" src="images/regis_Layer-19-15.gif" width="181" height="66" border="0" alt=""></a></td>
		<td>
			<img src="images/spacer.gif" width="1" height="18" alt=""></td>
	</tr>
	<tr>
		<td>
			<img src="images/regis_13.gif" width="250" height="22" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="22" alt=""></td>
	</tr>
	<tr>
		<td rowspan="6" align="center" valign="middle"><embed src=http://img51.imageshack.us/img51/2944/time2.swf width=242 height=129 type=application/x-shockwave-flash wmode ="transparent"></embed>
		  <table width="200" border="0">
		    <tr>
		      <td><img src="anigif.gif" alt="" width="235" height="77"></td>
	        </tr>
		    <tr>
		      <td><img src="anigif2.gif" alt="" width="235" height="82"></td>
	        </tr>
		    <tr>
		      <td><img src="anigif3.gif" alt="" width="237" height="92"></td>
	        </tr>
        </table></td>
		<td>
			<img src="images/spacer.gif" width="1" height="26" alt=""></td>
	</tr>
	<tr>
		<td>
			<a href="pic.html"
				onmouseover="changeImages('regis_Layer_19019', 'images/regis_Layer-19-over-20.gif'); return true;"
				onmouseout="changeImages('regis_Layer_19019', 'images/regis_Layer-19-19.gif'); return true;"
				onmousedown="changeImages('regis_Layer_19019', 'images/regis_Layer-19-over-20.gif'); return true;"
				onmouseup="changeImages('regis_Layer_19019', 'images/regis_Layer-19-over-20.gif'); return true;">
			  <img name="regis_Layer_19019" src="images/regis_Layer-19-19.gif" width="181" height="66" border="0" alt=""></a></td>
		<td>
			<img src="images/spacer.gif" width="1" height="66" alt=""></td>
	</tr>
	<tr>
		<td rowspan="2">
			<a href="regis.php"
				onmouseover="changeImages('regis_Layer_19021', 'images/regis_Layer-19-over-22.gif'); return true;"
				onmouseout="changeImages('regis_Layer_19021', 'images/regis_Layer-19-21.gif'); return true;"
				onmousedown="changeImages('regis_Layer_19021', 'images/regis_Layer-19-over-22.gif'); return true;"
				onmouseup="changeImages('regis_Layer_19021', 'images/regis_Layer-19-over-22.gif'); return true;">
			  <img name="regis_Layer_19021" src="images/regis_Layer-19-21.gif" width="181" height="66" border="0" alt=""></a></td>
		<td>
			<img src="images/spacer.gif" width="1" height="65" alt=""></td>
	</tr>
	<tr>
		<td rowspan="3">
			<img src="images/regis_17.gif" width="41" height="276" alt=""></td>
		<td rowspan="3">
			<img src="images/regis_18.gif" width="12" height="276" alt=""></td>
		<td rowspan="3">
			<img src="images/regis_19.gif" width="7" height="276" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="1" alt=""></td>
	</tr>
	<tr>
		<td rowspan="2" align="center" bgcolor="#ABFBF3"><embed src=" http://www.blogclock.cn/swf/S1001286e2fe9fc-0.swf" width="179" height="236" type="application/x-shockwave-flash" quality="high" wmode="transparent"/embed> </td>
		<td>
			<img src="images/spacer.gif" width="1" height="137" alt=""></td>
	</tr>
	<tr>
		<td>
			<img src="images/regis_21.gif" width="500" height="138" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="138" alt=""></td>
	</tr>
	<tr>
		<td colspan="8">
			<a href="mailto:koy_25_36@hotmail.com"
				onmouseover="changeImages('regis_Layer_21', 'images/regis_Layer-21-over.gif'); return true;"
				onmouseout="changeImages('regis_Layer_21', 'images/regis_Layer-21.gif'); return true;"
				onmousedown="changeImages('regis_Layer_21', 'images/regis_Layer-21-over.gif'); return true;"
				onmouseup="changeImages('regis_Layer_21', 'images/regis_Layer-21-over.gif'); return true;">
			  <img name="regis_Layer_21" src="images/regis_Layer-21.gif" width="1024" height="75" border="0" alt=""></a></td>
		<td>
			<img src="images/spacer.gif" width="1" height="75" alt=""></td>
	</tr>
</table>
<!-- End ImageReady Slices -->
<map name="Map">
  <area shape="rect" coords="57,71,988,163" href="index.html">
</map>
<map name="Map">
<style type="text/css">BODY {cursor:url(http://i1318.photobucket.com/albums/t660/keynaftyaless/E400E210E320E2A0E4C03_zps17ecd5c9.png),auto;}a {cursor:url(http://i1318.photobucket.com/albums/t660/keynaftyaless/E400E210E320E2A0E4C032_zps4231f241.png),auto;}</style>??????

</body>
</html>