01.
<?session_start();
02.
include
(
"check_login.php"
);
03.
?>
04.
<html>
05.
<body bgcolor = #F5F5DC>
06.
</body>
07.
<form method=
"post"
name=
"form1"
action=
"<? echo $PHP_SELF ?>"
>
08.
<center>
09.
<?
10.
$day
=
date
(
"d"
);
11.
$month
=
date
(
"m"
);
12.
$year
=
date
(
"Y"
);
13.
$year
=
$year
+ 543;
14.
$date2
=
$year
.
$month
.
$day
;
15.
?>
16.
17.
<tr><td><font size=4><b> เพิ่มข้อมูลนักท่องเที่ยว</b></font><p>
18.
รหัสTaxi <input type=
"text"
name=
"id_val"
value=
"<? echo $dbarr['id']; ?>"
style=
"width:200px"
>
19.
<input type=
"submit"
name=
"send"
value=
"ค้นหา"
><p>
20.
21.
<?
22.
if
(
$send
!=
""
){
23.
$link
= mysql_connect(
"localhost"
,
"root"
,
"1234"
);
24.
$sql
=
"use Taxi"
;
25.
$result
= mysql_query(
$sql
);
26.
$sql
=
"select * from add_newmember where id = '$id_val' "
;
27.
$result
= mysql_query(
$sql
);
28.
while
(
$dbarr
= mysql_fetch_array(
$result
)){
29.
$ddd
=
$dbarr
[
'id_val'
];
30.
$query
=mysql_query(
$sql
)
or
die
(
"query failed"
);
31.
$arr
=mysql_fetch_array(
$query
); ?>
32.
33.
ชื่อคนขับTaxi <input type=
"text"
name=
"Ename"
style=
"width:200px"
value=
"<? echo$dbarr['name']?>"
disabled>
34.
35.
36.
</center>
37.
38.
39.
<center>
40.
<?
41.
42.
}
43.
?>
44.
<br>
45.
<br>
46.
47.
จำนวนนักท่องเที่ยวชาวต่างชาติ<p>
48.
ผู้ใหญ่ <input type=
"text"
name=
"Eadult"
value =
"0"
> คน<p>
49.
เด็ก <input type=
"text"
name=
"Echildren"
value =
"0"
> คน<p>
50.
<input type=
"submit"
name=
"send2"
value=
"บันทึก"
></td><p>
51.
52.
53.
54.
<!--<td width=190 bgcolor=><ul>
55.
<li align =
'right'
><a href=Add_newmember.php>เพิ่มข้อมูลสมาชิกใหม</a></li>
56.
<li align =
'right'
><a href=Edit.php>แก้ไข</a></li>
57.
<li align =
'right'
><a href=showtaxi.php>รายงาน</a></li>-->
58.
</tr>
59.
</form>
60.
</html>
61.
</center>
62.
<?
63.
64.
if
(
$send2
!=
""
){
65.
$Etotal
=
$Eadult
+
$Echildren
;
66.
$Eadult
+
$Echildren
!= 0;
67.
$link
= mysql_connect(
"localhost"
,
"root"
,
"1234"
) ;
68.
$sql
=
"use Taxi"
;
69.
$result
= mysql_query(
$sql
);
70.
$sql
=
"INSERT INTO add_tourit VALUES('$dd', '$date2', '$Eadult', '$Echildren', '$Etotal')"
;
71.
$result
= mysql_query(
$sql
);
72.
73.
mysql_close(
$link
);
74.
75.
if
(
$result
)
76.
{
77.
78.
80.
81.
82.
}
83.
84.
else
85.
{
86.
88.
89.
90.
}
91.
}
92.
93.
}
94.
?>