001.
<?php
002.
003.
004.
005.
echo
"<table border='1' width=80% align=center>"
;
006.
print
"<table width=800 align=center border=1>"
;
007.
print
"<tr bgcolor=0066FF>"
;
008.
print
"<td align = center width=5%><font color=ffffff size=2>ลำดับ</font></td>"
;
009.
print
"<td align = center width=20%><font color=ffffff size=2>เรื่อง</font></td>"
;
010.
print
"<td align = center width=25%><font color=ffffff size=2>วันที่อบรม</font></td>"
;
011.
print
"<td align = center width=5%><font color=ffffff size=2>เวลา</font></td>"
;
012.
print
"<td align = center width=8%><font color=ffffff size=2>ค่าลงทะเบียน</font></td>"
;
013.
print
"<td align = center width=8%><font color=ffffff size=2>ค่าเดินทาง</font></td>"
;
014.
print
"<td align = center width=8%><font color=ffffff size=2>ค่าที่พัก</font></td>"
;
015.
print
"<td align = center width=8%><font color=ffffff size=2>ค่าเบี้ยเลี้ยง</font></td>"
;
016.
print
"<td align = center width=8%><font color=ffffff size=2>ค่าอื่น</font></td>"
;
017.
print
"<td align = center width=5%><font color=ffffff size=2>ลบ</font></td>"
;
018.
019.
print
"</tr>"
;
020.
021.
022.
023.
024.
$hostname
=
"localhost"
;
025.
$user
=
"root"
;
026.
$password
=
"root"
;
027.
$dbname
=
"holiday"
;
028.
029.
$sql1
=
" select * from data_conf where id_user='$id_user' "
;
030.
$sql2
=
" select * from total_conf where id_user='$id_user' "
;
031.
032.
033.
034.
035.
036.
037.
038.
039.
040.
mysql_connect(
$hostname
,
$user
,
$password
)
or
die
(
"cannot connect"
);
041.
042.
mysql_select_db(
$dbname
)
or
die
(
"cannot select db"
);
043.
044.
045.
mysql_query(
"SET NAMES utf8"
);
046.
047.
$result1
= mysql_query(
$sql1
);
048.
$row_number
= mysql_num_rows(
$result1
);
049.
050.
$result2
= mysql_query(
$sql2
);
051.
$row_number
= mysql_num_rows(
$result2
);
052.
053.
054.
055.
$id
=1;
056.
if
(
$row_number
> 0){
057.
while
(
$record
= mysql_fetch_array(
$result1
)){
058.
$record1
=
$record
[
"id_user"
];
059.
$record2
=
$record
[
"subject"
];
060.
$record3
=
$record
[
"date"
];
061.
$record4
=
$record
[
"hour"
];
062.
$record5
=
$record
[
"register"
];
063.
$record6
=
$record
[
"fare"
];
064.
$record7
=
$record
[
"rent"
];
065.
$record8
=
$record
[
"relate"
];
066.
$record9
=
$record
[
"other_mon"
];
067.
$record10
=
$record
[
"id_conf"
];
068.
069.
070.
while
(
$record
= mysql_fetch_array(
$result2
))
071.
$record11
=
$record
[
"id_total"
];
072.
073.
074.
075.
076.
077.
078.
079.
080.
081.
082.
083.
084.
085.
?>
086.
087.
088.
089.
090.
<tr bgcolor=
"#F3F7FE"
bordercolor=
"#0033FF"
>
091.
<td style=
"font:tahoma; color:#00008B; text-align:center; font-size:12px; width:1%;"
><a><?=
$id
?></a></td>
092.
<td style=
"font:Arial, Helvetica, sans-serif; color: #993399; text-align:center; font-size:12px; width:4%;"
><b><?=
$record2
?></b></td>
093.
<td style=
"font:tahoma; color:#00008B; text-align:center; font-size:12px; width:5%;"
><a><?=
$record3
?></a></td>
094.
<td style=
"font:tahoma; color:#00008B; text-align:center; font-size:12px; width:5%;"
><a><?=
$record4
?></a></td>
095.
<td style=
"font:tahoma; color:#00008B; text-align:center; font-size:12px; width:3%;"
><a><?=
$record5
?></a></td>
096.
<td style=
"font:tahoma; color:#00008B; text-align:center; font-size:12px; width:3%;"
><a><?=
$record6
?></a></td>
097.
<td style=
"font:tahoma; color:#00008B; text-align:center; font-size:12px; width:3%;"
><a><?=
$record7
?></a></td>
098.
<td style=
"font:tahoma; color:#00008B; text-align:center; font-size:12px; width:3%;"
><a><?=
$record8
?></a></td>
099.
<td style=
"font:tahoma; color:#00008B; text-align:center; font-size:12px; width:3%;"
><a><?=
$record9
?></a></td>
100.
<td style=
"font:tahoma; color:#00008B; text-align:center; font-size:12px; width:5%;"
><a href=
"delete2.php?id_conf=<?=$record10?> and id_total="
<?=
$record11
?>runat=
"server"
onclick=
"return submit2_onclick()"
>ลบ</a></td>
101.
</tr>
102.
103.
104.
<?php
105.
$id
++;
106.
}
107.
108.
}
109.
110.
111.
112.
echo
"</table>"
;
113.
114.
?>
115.