03.
<head>
04.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
05.
<title>Untitled Document</title>
06.
</head>
07.
08.
<body>
09.
<?php
10.
include
"config.in.php"
;
11.
$sql
=
"SELECT * FROM graduated_profile WHERE IDCard_Num = '$IDCard_Num' "
;
12.
$query
= mysql_query(
$sql
);
13.
$rs
= mysql_fetch_array(
$query
);
14.
if
(
$rs
){
15.
?>
16.
<script>
17.
alert(
"เลขบัตรประจำตัวประชาชน\nหรือรหัสประจำตัวนักศึกษาซ้ำ"
);
18.
</script>
19.
<?
20.
echo
"<meta http-equiv='refresh' content='0;url=questionnaire.php'>"
;
21.
}
else
{
22.
23.
24.
25.
$sql1
="insert into graduated_profile(
26.
Prefix,Prefix_Ohter,
27.
Name,LName,
28.
DateOfBirth,
29.
IDCard_Num,Semester_Type,
30.
Course_Type,GPA,Program,
31.
Student_ID,Home_Number,Mu,
32.
Village_Name,Lane,Road,
33.
Distric,City,Province,
34.
Postcode,Home_Tel,Mobile,
35.
Fax,Email
36.
)values(
37.
'".$_POST[Prefix]."'
,
'".$_POST[Prefix_Other]."'
,
38.
'".$_POST[Name]."'
,
'".$_POST[LName]."'
,
39.
'".$_POST[DateOfBirth1].'
/
'.$_POST[DateOfBirth2].'
/
'.$_POST[DateOfBirth3]."'
,
40.
'".$_POST[IDCard_Num]."'
,
'".$_POST[Semester_Type]."'
,
41.
'".$_POST[Course_Type]."'
,
'".$_POST[GPA]."'
,
'".$_POST[Program]."'
,
42.
'".$_POST[Student_ID]."'
,
'".$_POST[Home_Number]."'
,
'".$_POST[Mu]."'
,
43.
'".$_POST[Village_Name]."'
,
'".$_POST[Lane]."'
,
'".$_POST[Road]."'
,
44.
'".$_POST[Distric]."'
,
'".$_POST[City]."'
,
'".$_POST[Province]."'
,
45.
'".$_POST[Postcode]."'
,
'".$_POST[Home_Tel]."'
,
'".$_POST[Mobile]."'
,
46.
'".$_POST[Fax]."'
,
'".$_POST[Email]."'
)";
47.
48.
49.
50.
$sql2
="insent info awards (
51.
Student_ID,Get_Awrd,
52.
Award_Name1,Name1,
53.
Award_Type1,Award_Type_Other1
54.
) values (
55.
'".$_POST[Student_ID]."'
,
'".$_POST[Get_Awrd]."'
,
56.
'".$_POST[Award_Name1]."'
,
'".$_POST[Name1]."'
,
57.
'".$_POST[Award_Type1]."'
,
'".$_POST[Award_Type_Other1]."'
)";
58.
$query
=mysql_query(
$sql1
&
$sql2
);
59.
60.
if
(
$query
){
61.
62.
?>
63.
<script>
64.
alert(
"เพิ่มข้อมูล เรียบร้อยแล้ว"
);
65.
</script>
66.
67.
<?
68.
echo
"<meta http-equiv='refresh' content='0;url=questionnaire.php'>"
;
69.
}
else
{
70.
?>
71.
<script>
72.
alert(
"ไม่สามารถเพิ่มข้อมูลได้"
);
73.
</script>
74.
<?
75.
echo
"<meta http-equiv='refresh' content='0;url=questionnaire.php'>"
;
76.
}
77.
}
78.
?>
79.
</body>
80.
</html>