|
|
|
เก็บข้อมูล แล้วพอเวลาโชวข้อมูล ไม่แสดงภาษาไทย แสดงแต่ภาษาอังกฤษ |
|
|
|
|
|
|
|
โค้ดหน้าแรก
หน้าเก็บข้อมูล student.php
<?php echo "<?xml version=\"1.0\" encoding=\"windows-874\"?".">"; ?><?
include ('Connections1/conn.php');
include 'check.php';
?>
<!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" />
<title>Untitled Document</title>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style5 {font-size: 14px}
.style6 {
font-size: 13px;
}
.style8 {
font-size: 13px;
font-weight: bold;
}
.style9 {font-size: 12px}
.style11 {
font-size: 14px;
color: #FFFFFF;
font-weight: bold;
}
.style12 {font-size: 14px; font-weight: bold; }
.style13 {color: #FF0000}
.style15 {font-size: 12px; font-weight: bold; }
.style16 {font-size: 9px}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<SCRIPT language=JavaScript>
function check_number() {
e_k=event.keyCode
//if (((e_k < 48) || (e_k > 57)) && e_k != 46 ) {
if (e_k != 13 && (e_k < 48) || (e_k > 57)) {
event.returnValue = false;
alert("ต้องเป็นตัวเลขเท่านั้น... \nกรุณาตรวจสอบข้อมูลของท่านอีกครั้ง...");
}
}
</script>
</head>
<body>
<table width="800" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td><img src="banner.jpg" width="800" height="130" /></td>
</tr>
</table>
<table width="800" height="411" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#0066FF">
<tr>
<td height="35" background="image/bg_blue.gif"><div align="center"></div></td>
</tr>
<tr>
<td><form id="form1" name="form1" method="post" action="student2.php">
<table width="658" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="229" bgcolor="#BFDFFF"><div align="right" class="style8">คำนำหน้าชื่อ: </div></td>
<td width="15"><span id="sprytextfield1"><span class="textfieldRequiredMsg">A value is required.</span></span></td>
<td width="414"><span id="title">
<input type="text" name="title" id="title" />
<span class="textfieldRequiredMsg style9">กรุณาป้อนคำนำหน้าชื่อ.</span> </span><span class="style13">*</span></td>
</tr>
<tr>
<td bgcolor="#BFDFFF"><div align="right" class="style8">ชื่อ:</div></td>
<td><span id="sprytextfield2"><span class="textfieldRequiredMsg">A value is required.</span></span></td>
<td><span id="fristname">
<input type="text" name="fristname" id="fristname" />
<span class="textfieldRequiredMsg style9">กรุณาป้อนชื่อ</span> </span><span class="style13">*</span></td>
</tr>
<tr>
<td bgcolor="#BFDFFF"><div align="right" class="style8">สกุล:</div></td>
<td><span id="sprytextfield3"><span class="textfieldRequiredMsg">A value is required.</span></span></td>
<td><span id="lastname">
<input type="text" name="lastname" id="lastname" />
<span class="textfieldRequiredMsg style9">กรุณาป้อนนามสกุล</span> </span><span class="style13">*</span></td>
</tr>
<tr>
<td bgcolor="#BFDFFF"><div align="right" class="style8">ที่อยู่:</div></td>
<td><span id="sprytextfield4"><span class="textfieldRequiredMsg">A value is required.</span></span></td>
<td><span id="school">
<input name="school" type="text" id="school" size="45" />
<span class="textfieldRequiredMsg style9">กรุณาป้อนที่อยู่</span> </span><span class="style13">*</span></td>
</tr>
<tr>
<td bgcolor="#BFDFFF"><div align="right" class="style8">จังหวัด:</div></td>
<td> </td>
<td><span id="proven">
<input type="text" name="proven" id="proven" />
<span class="textfieldRequiredMsg style9">กรุณาป้อนจังหวัด</span> </span><span class="style13">*</span></td>
</tr>
<tr>
<td bgcolor="#BFDFFF"><div align="right" class="style8">รหัสไปรษณืย์::</div></td>
<td><span id="sprytextfield6"><span class="textfieldRequiredMsg">A value is required.</span></span></td>
<td><span id="area">
<input name="area" type="text" id="area" size="20" />
<span class="textfieldRequiredMsg style9">กรุณาป้อนรหัสไปรษณืย</span> </span><span class="style13">*</span></td>
</tr>
<tr>
<td bgcolor="#BFDFFF"><div align="right" class="style8">เบอร์โทรศัทพ์มือถือ</div></td>
<td><span id="sprytextfield7"><span class="textfieldRequiredMsg">A value is required.</span></span></td>
<td><span id="tel">
<input name="tel" type="text" id="tel" maxlength="10" onkeypress=check_number(); />
<span class="textfieldRequiredMsg style9">กรุณาป้อนเบอร์โทรศัทพ์มือถือ</span> </span><span class="style13">*</span></td>
</tr>
<tr>
<td bgcolor="#BFDFFF"><div align="right" class="style8">เบอร์โทรศัพท์บ้าน</div></td>
<td><span id="sprytextfield8"><span class="textfieldRequiredMsg">A value is required.</span></span></td>
<td><span id="email">
<input name="email" type="text" id="email" size="25" />
<span class="textfieldRequiredMsg style9">กรุณาป้อนเบอร์โทรศัพท์บ้าน</span> </span><span class="style13">*</span></td>
</tr>
<tr>
<td bgcolor="#BFDFFF"><div align="right" class="style8">สถานที่ทำงาน:</div></td>
<td><span id="sprytextfield10"><span class="textfieldRequiredMsg">A value is required.</span></span></td>
<td><span id="content">
<input name="content" type="text" id="content" value="" size="45" />
<span class="textfieldRequiredMsg style9">กรุณาป้อนสถานที่ทำงาน</span> </span><span class="style13">*</span></td>
</tr>
<tr>
<td bgcolor="#BFDFFF"><div align="right" class="style5 style6"><strong>ตำแหน่ง:</strong></div></td>
<td><span id="sprytextfield11"><span class="textfieldRequiredMsg">A value is required.</span></span></td>
<td><span id="sprytextfield21">
<input name="team" type="text" id="team" size="30" />
<span class="textfieldRequiredMsg style9">กรุณาตำแหน่ง</span> </span><span class="style13">*</span></td>
</tr>
<tr>
<td bgcolor="#BFDFFF"><div align="right"><span class="style15">ปีที่สำเร็จการศึกษา:</span></div></td>
<td> </td>
<td><span id="sprytextfield22">
<input name="adviser" type="text" id="adviser" size="20" />
<span class="textfieldRequiredMsg style16 style9 style9 style9 style9">กรุณาป้อนปีที่สำเร็จการศึกษา</span> </span><span class="style13">*</span></td>
</tr>
<tr>
<td bgcolor="#BFDFFF"><div align="right" class="style8"></div></td>
<td><span id="sprytextfield9"><span class="textfieldRequiredMsg">A value is required.</span></span></td>
<td><span id="sprytextfield19"><span class="textfieldRequiredMsg">A value is required.</span></span>
<select name="select" id="select">
<?
mysql_select_db($database_conn, $conn);
$rs = mysql_query("SELECT * FROM typestudent ORDER BY id", $conn);
$rsCount = mysql_num_rows($rs);
if ($rsCount==0)
{
}
else
{
while ($rsField = mysql_fetch_array($rs))
{
?>
<option value="<?php echo $rsField["id"]; ?>"><?php echo $rsField["name_typestudent"]; ?></option>
<?php
}
}
?>
</select></td>
</tr>
<tr>
<td> </td>
<td colspan="2">
<div align="left">
<input type="submit" name="button" id="button" value="บันทึกข้อมูล" />
<input type="reset" name="button2" id="button2" value="ล้างข้อมูล" />
</div></td>
</tr>
<tr>
<td> </td>
<td colspan="2"> <br />
<font color="#FF0000" size="2"><strong>กรณีในทีมมีสมาชิกมากกว่า 1 คน ให้กรอกข้อมูลทุกคน</strong></font></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<div align="center"></div>
<div align="center" class="style12">
<p><img src="image/mod.png" width="35" height="31" /> <a href="liststudent.php" target="_top">ดูข้อมูลผู้สมัครทั้งหมด</a></p>
<p> </p>
</div>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3");
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4");
var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6");
var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7");
var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8");
var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9");
var sprytextfield10 = new Spry.Widget.ValidationTextField("sprytextfield10");
var sprytextfield11 = new Spry.Widget.ValidationTextField("sprytextfield11");
var sprytextfield5 = new Spry.Widget.ValidationTextField("title", "none", {validateOn:["blur", "change"]});
var sprytextfield12 = new Spry.Widget.ValidationTextField("fristname", "none", {validateOn:["blur", "change"]});
var sprytextfield13 = new Spry.Widget.ValidationTextField("lastname", "none", {validateOn:["blur", "change"]});
var sprytextfield14 = new Spry.Widget.ValidationTextField("school", "none", {validateOn:["blur", "change"]});
var sprytextfield15 = new Spry.Widget.ValidationTextField("proven", "none", {validateOn:["blur", "change"]});
var sprytextfield16 = new Spry.Widget.ValidationTextField("area", "none", {validateOn:["blur", "change"]});
var sprytextfield17 = new Spry.Widget.ValidationTextField("tel", "none", {validateOn:["blur", "change"]});
var sprytextfield18 = new Spry.Widget.ValidationTextField("email", "none", {validateOn:["blur", "change"]});
var sprytextfield19 = new Spry.Widget.ValidationTextField("sprytextfield19");
var sprytextfield20 = new Spry.Widget.ValidationTextField("content", "none", {validateOn:["blur", "change"]});
var sprytextfield21 = new Spry.Widget.ValidationTextField("sprytextfield21", "none", {validateOn:["blur"]});
var sprytextfield22 = new Spry.Widget.ValidationTextField("sprytextfield22", "none", {validateOn:["blur"]});
//-->
</script>
</body>
<!--Namo WebEditor Data 4.0
:EmbededNPI001
4QMAAHhevVK9SgNBEJ47oxGUQcUm3cUUgiAYjWIhuBrEBCQETIrY6BEDptBAPINaSMDO3sIu
PoGvkPex8Q3iN3t7fyZYibvMfvO3O3/rHFdqM0R2xb3uOOUbr9V1m16716J/WtMmzhDogSxQ
AUcKaIN2DS/ynuGnwCvw7+Kg15tKoNPxZVX3sfrs4/BcjUajRGUSb1lMQ8kgWp+DJS2IPY4J
J2N/MXhpjIs/nUL5a9+w/ckuoZ3ScDilK2phe+TQhr4gXQhoUlZPUEpT/jqTE3LpAZl0f83k
Fc2SeY5Fv+gpnX7/0EeK6vTFR6MPumLsgzOFv0k1RL6PdUHmNQ+S2WxhC5ZiuuSEF/TbwRyJ
fFlyDPKM80Xo50BHd81u57bt1quiwdrR1z6CDMewYUpoyM/U45JnorC6TjP+sPwwFbGugtY4
y3lOcY4V21zmTT4AljiNM88ZtrjAszhz2Fl2qExFtMchm9fhk4GPhZs53uYVSPLqN0k5QxU=
-->
</html>
|
|
|
|
|
Date :
2011-02-17 11:01:59 |
By :
aoooza |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lisstudent.php
<!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" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style5 {font-size: 12px; color: #FFFFFF; font-weight: bold; }
.style8 { font-size: 13px;
font-weight: bold;
}
.style9 {color: #FFFFFF}
.style11 {font-size: 12px; font-weight: bold; }
.style13 {font-size: 13px; font-weight: bold; color: #FFFFFF; }
-->
</style>
</head>
<body>
<table width="1515" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
<tr>
<td width="50" bgcolor="#0066CC"><div align="center" style="font-size: 12px; font-weight: bold; color: #FFFFFF">
<div align="center">ลำดับที่</div>
</div></td>
<td width="78" bgcolor="#0066CC"><div align="center" style="font-size: 12px; font-weight: bold; color: #FFFFFF">
<div align="center">คำนำหน้าชื่อ</div>
</div></td>
<td width="102" bgcolor="#0066CC"><div align="center" style="font-size: 12px; font-weight: bold; color: #FFFFFF">
<div align="center">ชื่อ</div>
</div></td>
<td width="126" bgcolor="#0066CC"><div align="center" style="font-size: 12px; font-weight: bold; color: #FFFFFF">
<div align="center">นามสกุล</div>
</div></td>
<td width="273" bgcolor="#0066CC"><div align="center" style="font-size: 12px; font-weight: bold; color: #FFFFFF">
<div align="center"><span class="style8">ที่อย</span></div>
</div></td>
<td width="90" bgcolor="#0066CC"><div align="center"><span class="style5">จังหวัด</span></div></td>
<td width="83" bgcolor="#0066CC"><div align="center" class="style9"><span class="style11">รหัสไปรษณีย์</span></div></td>
<td width="140" bgcolor="#0066CC"><div align="center"><span class="style13">เบอร์โทรศัทพ์มือถือ</span></div></td>
<td width="124" bgcolor="#0066CC"><div align="center"><span class="style13">เบอร์โทรศัพท์บ้าน</span></div></td>
<td width="0" bgcolor="#0066CC"></td>
<td width="166" bgcolor="#0066CC"><div align="center"><span class="style13">สถานที่ทำงาน</span></div></td>
<td width="88" bgcolor="#0066CC"><div align="center" style="font-size: 12px; font-weight: bold; color: #FFFFFF">
<div align="center"><strong>ตำแหน่ง</strong></div>
</div></td>
<td width="167" bgcolor="#0066CC"><div align="center"><span class="style5">ปีที่สำเร็จการศึกษา:</span></div></td>
</tr>
<?
$no=1;
include "connect.php";
$sql="SELECT student.*, typestudent.name_typestudent
FROM student,typestudent
WHERE student.type = typestudent.id";
$result=mysql_db_query($dbname,$sql);
$num_rows=mysql_num_rows($result);
while($r=mysql_fetch_array($result)){
$bg = ($bg=="#FFFFFF") ? "#cccccc" : "#FFFFFF";
$title=$r[title];
$fristname=$r[fristname];
$lastname=$r[lastname];
$school=$r[school];
$proven=$r[proven];
$area=$r[area];
$tel=$r[tel];
$email=$r[email];
$name_typestudent=$r[name_typestudent];
$content=$r[content];
$team=$r[team];
$adviser=$r[adviser];
echo"
<tr bgcolor=$bg>
<td><center><FONT SIZE=2>$no</FONT></center></td>
<td><center><FONT SIZE=2>$title</FONT></center></td>
<td><center><FONT SIZE=2>$fristname</font></center></td>
<td><center><FONT SIZE=2>$lastname</font></center></td>
<td><center><FONT SIZE=2>$school</FONT></center></td>
<td><center><FONT SIZE=2>$proven</FONT></center></td>
<td><center><FONT SIZE=2>$area</font></center></td>
<td><center><FONT SIZE=2>$tel</font></center></td>
<td><center><FONT SIZE=2>$email</FONT></center></td>
<td><center><FONT SIZE=2>$name_typestudent</FONT></center></td>
<td><center><FONT SIZE=2>$content</font></center></td>
<td><center><FONT SIZE=2>$team</font></center></td>
<td><center><FONT SIZE=2>$adviser</font></center></td>
</tr>";
$no++;
}
mysql_close();
?>
</table>
</body>
</html>
|
|
|
|
|
Date :
2011-02-17 11:02:29 |
By :
aoooza |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
student2.php
<?
$title=$_POST[title];
$fristname=$_POST[fristname];
$lastname=$_POST[lastname];
$school=$_POST[school];
$proven=$_POST[proven];
$area=$_POST[area];
$tel=$_POST[tel];
$email=$_POST[email];
$select=$_POST[select];
$content=$_POST[content];
$team=$_POST[team];
$adviser=$_POST[adviser];
include "check.php";
include "connect.php";
$sql="INSERT INTO student VALUES('','$title','$fristname','$lastname','$school','$proven','$area','$tel','$email','$select','$content','$team','$adviser')";
$result=mysql_db_query($dbname,$sql);
if ($result){
msg3("บันทึกข้อมูลเรียบร้อย");
}else{
msg("บันทึกข้อมูลไม่ได้");
}
mysql_close();
?>
|
|
|
|
|
Date :
2011-02-17 11:02:58 |
By :
aoooza |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ช่วยด้วยครับ
|
|
|
|
|
Date :
2011-02-17 12:40:22 |
By :
aoooza |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองเอา
mysql_query("set NAMES tis620");
ใส่ใน connect.php ดูครับ
|
|
|
|
|
Date :
2011-02-17 13:40:47 |
By :
ABiTz666 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|