<?php require_once('Connections/connecting.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 ``database`` (name, sirname, username, password, age, tell, email) VALUES (%s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['name'], "text"),
                       GetSQLValueString($_POST['sirname'], "text"),
                       GetSQLValueString($_POST['username'], "text"),
                       GetSQLValueString($_POST['password'], "text"),
                       GetSQLValueString($_POST['age'], "text"),
                       GetSQLValueString($_POST['tell'], "text"),
                       GetSQLValueString($_POST['email'], "text"));

  mysql_select_db($database_connecting, $connecting);
  $Result1 = mysql_query($insertSQL, $connecting) or die(mysql_error());

  $insertGoTo = "registertrue.html";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}
?>
<html>
<head>
<title>Udonthani Vocational collage</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body,td,th {
	font-family: "Angsana New";
}
#apDiv1 {
	position:absolute;
	left:1037px;
	top:1403px;
	width:174px;
	height:36px;
	z-index:1;
}
a:link {
	color: #000;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #000;
}
a:hover {
	text-decoration: underline;
	color: #000;
}
a:active {
	text-decoration: none;
	color: #000;
}
#apDiv2 {
	position:absolute;
	left:620px;
	top:619px;
	width:512px;
	height:313px;
	z-index:2;
}
#apDiv3 {
	position:absolute;
	left:592px;
	top:545px;
	width:315px;
	height:67px;
	z-index:3;
}
#apDiv4 {
	position:absolute;
	left:570px;
	top:950px;
	width:432px;
	height:286px;
	z-index:4;
}
#apDiv5 {
	position:absolute;
	left:554px;
	top:915px;
	width:462px;
	height:33px;
	z-index:5;
}
</style>
<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>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/page1_03.png','images/page1_05.png','images/page1_07.png','images/page1_09.png','images/page1_11.png','images/indexnew1_24.png','images/indexnew1_27.png','images/indexnew1_29.png','images/indexnew1_31.png','images/indexnew1_33.png','images/indexnew1_35.png','images/indexnew1_37.png','images/indexnew1_39.png','images/indexnew1_41.png','images/indexnew1_43.png','images/indexnew1_47.png','images/indexnew1_51.png','images/indexnew-3_45.png','images/indexnew-3_48.png','images/indexnew-3_50.png')">
<div id="apDiv2">
  <form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="form1">
    <table width="344" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="80"><h3>&#3594;&#3639;&#3656;&#3629;</h3></td>
        <td width="264"><h3>
          <label for="name"></label>
          <input type="text" name="name" id="name">
        </h3></td>
      </tr>
      <tr>
        <td height="23"><h3>&#3609;&#3634;&#3617;&#3626;&#3585;&#3640;&#3621;</h3></td>
        <td><h3>
          <input type="text" name="sirname" id="sirname">
        </h3></td>
      </tr>
      <tr>
        <td><h3>&#3594;&#3639;&#3656;&#3629;&#3612;&#3641;&#3657;&#3651;&#3594;&#3657;</h3></td>
        <td><h3>
          <label for="username"></label>
          <input type="text" name="username" id="username">
        </h3></td>
      </tr>
      <tr>
        <td><h3>&#3619;&#3633;&#3627;&#3626;&#3612;&#3656;&#3634;&#3609;</h3></td>
        <td><h3>
          <input type="text" name="password" id="password">
        </h3></td>
      </tr>
      <tr>
        <td><h3>&#3629;&#3634;&#3618;&#3640;</h3></td>
        <td><h3>
          <input type="text" name="age" id="age">
        </h3></td>
      </tr>
      <tr>
        <td><h3>&#3648;&#3610;&#3629;&#3619;&#3660;&#3650;&#3607;&#3619;&#3624;&#3633;&#3614;&#3607;&#3660;</h3></td>
        <td><h3>
          <input type="text" name="tell" id="tell">
        </h3></td>
      </tr>
      <tr>
        <td><h3>&#3629;&#3637;&#3648;&#3617;&#3621;&#3621;&#3660;</h3></td>
        <td><h3>
          <input type="text" name="email" id="email">
        </h3></td>
      </tr>
      <tr>
        <td><h3>&nbsp;</h3></td>
        <td><h3>
          <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;">
        </h3></td>
      </tr>
      <tr>
        <td><h3>&nbsp;</h3></td>
        <td><h3>&nbsp;</h3></td>
      </tr>
    </table>
    <input type="hidden" name="MM_insert" value="form1">
  </form>
  <h3 align="left">&nbsp;</h3>
</div>
<div id="apDiv3">
  <h1>&#3626;&#3617;&#3633;&#3588;&#3619;&#3626;&#3617;&#3634;&#3594;&#3636;&#3585; (Register)</h1>
</div>
<div align="center"><!-- Save for Web Slices (page1.psd) -->
  <table id="Table_01" width="901" height="1561" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td colspan="15">
        <img src="images/page1_01.png" width="900" height="183" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="183" alt=""></td>
    </tr>
    <tr>
      <td rowspan="2">
        <img src="images/page1_02.png" width="25" height="46" alt=""></td>
      <td><a href="indexnew1.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image109','','images/page1_03.png',1)"><img src="images/index1_03.png" name="Image109" width="97" height="38" border="0"></a></td>
      <td rowspan="2">
        <img src="images/page1_04.png" width="37" height="46" alt=""></td>
      <td colspan="4"><a href="page1.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image110','','images/page1_05.png',1)"><img src="images/index1_05.png" name="Image110" width="139" height="38" border="0"></a></td>
      <td rowspan="2">
        <img src="images/page1_06.png" width="45" height="46" alt=""></td>
      <td><a href="page2.2.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image111','','images/page1_07.png',1)"><img src="images/index1_07.png" name="Image111" width="182" height="38" border="0"></a></td>
      <td colspan="2" rowspan="2">
        <img src="images/page1_08.png" width="39" height="46" alt=""></td>
      <td><a href="page3.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image112','','images/page1_09.png',1)"><img src="images/index1_09.png" name="Image112" width="148" height="38" border="0"></a></td>
      <td rowspan="2">
        <img src="images/page1_10.png" width="31" height="46" alt=""></td>
      <td><a href="page4.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image113','','images/page1_11.png',1)"><img src="images/index1_11.png" name="Image113" width="135" height="38" border="0"></a></td>
      <td rowspan="2">
        <img src="images/page1_12.png" width="22" height="46" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="38" alt=""></td>
    </tr>
    <tr>
      <td>
        <img src="images/page1_13.png" width="97" height="8" alt=""></td>
      <td colspan="4">
        <img src="images/page1_14.png" width="139" height="8" alt=""></td>
      <td>
        <img src="images/page1_15.png" width="182" height="8" alt=""></td>
      <td>
        <img src="images/page1_16.png" width="148" height="8" alt=""></td>
      <td>
        <img src="images/page1_17.png" width="135" height="8" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="8" alt=""></td>
    </tr>
    <tr>
      <td colspan="15"><img src="images/bannerslide1.gif" width="900" height="302"></td>
      <td>
        <img src="images/spacer.gif" width="1" height="291" alt=""></td>
    </tr>
    <tr>
      <td colspan="15">
        <img src="images/page1_19.png" width="900" height="7" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="7" alt=""></td>
    </tr>
    <tr>
      <td colspan="6">
        <img src="images/page1_20.png" width="208" height="59" alt=""></td>
      <td colspan="4" valign="bottom"><h1 align="center">&nbsp;</h1></td>
      <td colspan="5">
        <img src="images/page1_22.png" width="345" height="59" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="59" alt=""></td>
    </tr>
    <tr>
      <td colspan="5"><a href="page5.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image114','','images/indexnew1_24.png',1)"><img src="images/index1_20.png" name="Image114" width="201" height="36" border="0"></a></td>
      <td rowspan="31">
        <img src="images/page1_24.png" width="7" height="872" alt=""></td>
      <td colspan="9" rowspan="30" align="left" valign="top"><h3>&nbsp;</h3></td>
      <td>
        <img src="images/spacer.gif" width="1" height="36" alt=""></td>
    </tr>
    <tr>
      <td colspan="5">
        <img src="images/page1_26.png" width="201" height="5" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="5" alt=""></td>
    </tr>
    <tr>
      <td colspan="5"><a href="page6.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image115','','images/indexnew1_27.png',1)"><img src="images/index1_23.png" name="Image115" width="201" height="31" border="0"></a></td>
      <td>
        <img src="images/spacer.gif" width="1" height="31" alt=""></td>
    </tr>
    <tr>
      <td colspan="5">
        <img src="images/page1_28.png" width="201" height="5" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="5" alt=""></td>
    </tr>
    <tr>
      <td colspan="5"><a href="page7.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image116','','images/indexnew1_29.png',1)"><img src="images/index1_25.png" name="Image116" width="201" height="27" border="0"></a></td>
      <td>
        <img src="images/spacer.gif" width="1" height="27" alt=""></td>
    </tr>
    <tr>
      <td colspan="5">
        <img src="images/page1_30.png" width="201" height="9" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="9" alt=""></td>
    </tr>
    <tr>
      <td colspan="5"><a href="page8.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image117','','images/indexnew1_31.png',1)"><img src="images/index1_27.png" name="Image117" width="201" height="27" border="0"></a></td>
      <td>
        <img src="images/spacer.gif" width="1" height="27" alt=""></td>
    </tr>
    <tr>
      <td colspan="5">
        <img src="images/page1_32.png" width="201" height="85" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="85" alt=""></td>
    </tr>
    <tr>
      <td colspan="5"><a href="https://www.facebook.com/udvc.ac.th?fref=ts" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image118','','images/indexnew1_33.png',1)"><img src="images/index1_29.png" name="Image118" width="201" height="31" border="0"></a></td>
      <td>
        <img src="images/spacer.gif" width="1" height="31" alt=""></td>
    </tr>
    <tr>
      <td colspan="5">
        <img src="images/page1_34.png" width="201" height="6" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="6" alt=""></td>
    </tr>
    <tr>
      <td colspan="5"><a href="https://www.facebook.com/udvc.ac.th?fref=ts" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image119','','images/indexnew1_35.png',1)"><img src="images/index1_31.png" name="Image119" width="201" height="29" border="0"></a></td>
      <td>
        <img src="images/spacer.gif" width="1" height="29" alt=""></td>
    </tr>
    <tr>
      <td colspan="5">
        <img src="images/page1_36.png" width="201" height="11" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="11" alt=""></td>
    </tr>
    <tr>
      <td colspan="5"><a href="https://www.facebook.com/udvc.ac.th?fref=ts" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image120','','images/indexnew1_37.png',1)"><img src="images/index1_33.png" name="Image120" width="201" height="23" border="0"></a></td>
      <td>
        <img src="images/spacer.gif" width="1" height="23" alt=""></td>
    </tr>
    <tr>
      <td colspan="5">
        <img src="images/page1_38.png" width="201" height="9" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="9" alt=""></td>
    </tr>
    <tr>
      <td colspan="5"><a href="https://www.facebook.com/udvc.ac.th?fref=ts" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image121','','images/indexnew1_39.png',1)"><img src="images/index1_35.png" name="Image121" width="201" height="28" border="0"></a></td>
      <td>
        <img src="images/spacer.gif" width="1" height="28" alt=""></td>
    </tr>
    <tr>
      <td colspan="5">
        <img src="images/page1_40.png" width="201" height="10" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="10" alt=""></td>
    </tr>
    <tr>
      <td colspan="5"><a href="https://www.facebook.com/udvc.ac.th?fref=ts" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image122','','images/indexnew1_41.png',1)"><img src="images/index1_37.png" name="Image122" width="201" height="24" border="0"></a></td>
      <td>
        <img src="images/spacer.gif" width="1" height="24" alt=""></td>
    </tr>
    <tr>
      <td colspan="5">
        <img src="images/page1_42.png" width="201" height="10" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="10" alt=""></td>
    </tr>
    <tr>
      <td colspan="5"><a href="https://www.facebook.com/udvc.ac.th?fref=ts" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image123','','images/indexnew1_43.png',1)"><img src="images/index1_39.png" name="Image123" width="201" height="24" border="0"></a></td>
      <td>
        <img src="images/spacer.gif" width="1" height="24" alt=""></td>
    </tr>
    <tr>
      <td colspan="5">
        <img src="images/page1_44.png" width="201" height="16" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="16" alt=""></td>
    </tr>
    <tr>
      <td colspan="5"><a href="https://www.facebook.com/udvc.ac.th?fref=ts" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image124','','images/indexnew1_47.png',1)"><img src="images/index1_41.png" name="Image124" width="201" height="25" border="0"></a></td>
      <td>
        <img src="images/spacer.gif" width="1" height="25" alt=""></td>
    </tr>
    <tr>
      <td colspan="5">
        <img src="images/page1_46.png" width="201" height="7" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="7" alt=""></td>
    </tr>
    <tr>
      <td colspan="5"><a href="https://www.facebook.com/udvc.ac.th?fref=ts" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image125','','images/indexnew1_51.png',1)"><img src="images/index1_43.png" name="Image125" width="201" height="28" border="0"></a></td>
      <td>
        <img src="images/spacer.gif" width="1" height="28" alt=""></td>
    </tr>
    <tr>
      <td colspan="5">
        <img src="images/page1_48.png" width="201" height="68" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="68" alt=""></td>
    </tr>
    <tr>
      <td colspan="4"><a href="https://www.facebook.com/udvc.ac.th?fref=ts" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image126','','images/indexnew-3_45.png',1)"><img src="images/indexnew-2_45.png" name="Image126" width="199" height="63" border="0"></a></td>
      <td rowspan="7">
        <img src="images/page1_50.png" width="2" height="298" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="63" alt=""></td>
    </tr>
    <tr>
      <td colspan="4">
        <img src="images/page1_51.png" width="199" height="28" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="28" alt=""></td>
    </tr>
    <tr>
      <td colspan="4"><a href="http://www.jobthai.com/home/searchjob.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image127','','images/indexnew-3_48.png',1)"><img src="images/indexnew-2_48.png" name="Image127" width="199" height="76" border="0"></a></td>
      <td>
        <img src="images/spacer.gif" width="1" height="76" alt=""></td>
    </tr>
    <tr>
      <td colspan="4">
        <img src="images/page1_53.png" width="199" height="27" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="27" alt=""></td>
    </tr>
    <tr>
      <td colspan="4"><a href="http://www.kroobannok.com/category29.data" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image128','','images/indexnew-3_50.png',1)"><img src="images/indexnew-2_50.png" name="Image128" width="199" height="82" border="0"></a></td>
      <td>
        <img src="images/spacer.gif" width="1" height="82" alt=""></td>
    </tr>
    <tr>
      <td colspan="4" rowspan="2">
        <img src="images/page1_55.png" width="199" height="22" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="16" alt=""></td>
    </tr>
    <tr>
      <td colspan="9">
        <img src="images/page1_56.png" width="692" height="6" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="1" height="6" alt=""></td>
    </tr>
    <tr>
      <td colspan="15">
        <img src="images/page1_57.png" alt="" width="900" height="102" border="0" usemap="#Map"></td>
      <td>
        <img src="images/spacer.gif" width="1" height="102" alt=""></td>
    </tr>
    <tr>
      <td>
        <img src="images/spacer.gif" width="25" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="97" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="37" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="40" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="2" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="7" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="90" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="45" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="182" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="30" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="9" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="148" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="31" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="135" height="1" alt=""></td>
      <td>
        <img src="images/spacer.gif" width="22" height="1" alt=""></td>
      <td></td>
    </tr>
  </table>
</div>
<!-- End Save for Web Slices -->

<map name="Map">
  <area shape="rect" coords="664,50,706,89" href="https://www.facebook.com/udvc.ac.th?fref=ts">
  <area shape="rect" coords="708,49,747,89" href="https://www.youtube.com/">
  <area shape="rect" coords="753,51,792,87" href="https://twitter.com/">
</map>
</body>
</html>