001.
<?
002.
$objConnect
= mysql_connect(
"localhost"
,
"root"
,
"1234"
)
or
die
(
"Error Connect to Database"
);
003.
$objDB
= mysql_select_db(
"TOT_DATA"
);
004.
mysql_query(
"SET NAMES UTF8"
);
005.
006.
$strSQL
= "SELECT *
007.
FROM project
008.
order by NO";
009.
$objQuery
= mysql_query(
$strSQL
)
or
die
(
"Error Query ["
.
$strSQL
.
"]"
);
010.
?>
011.
<style type=
"text/css"
>
012.
.wi {
013.
color: #FFF;
014.
}
015.
</style>
016.
<table width=
"1200"
border=
"1"
align=
"center"
cellpadding=
"0"
cellspacing=
"0"
style=
"text-align:center;"
>
017.
<tr bgcolor=
"#0066FF"
class
=
"wi"
>
018.
<th width=
"80"
> <div align=
"center"
>ลำดับที่</div></th>
019.
<th width=
"400"
> <div align=
"center"
>ชื่อโครงการ </div></th>
020.
<th width=
"00"
> <div align=
"center"
>ชื่อลูกค้า </div></th>
021.
<th width=
"200"
> <div align=
"center"
>เจ้าของโครงการ</div></th>
022.
<th width=
"50"
> <div align=
"center"
>วันที่เริ่ม </div></th>
023.
<th width=
"50"
> <div align=
"center"
>วันที่สิ้นสุด</div></th>
024.
025.
</tr>
026.
<?
027.
$i
= 0;
028.
while
(
$objResult
= mysql_fetch_array(
$objQuery
))
029.
{
030.
?>
031.
<?
if
(
$i
%2 == 0){?>
032.
<tr bgcolor=
"#E9E9E9"
>
033.
<? }?>
034.
<?
if
(
$i
%2 != 0){?>
035.
<tr>
036.
<? }
037.
$i
++;
038.
?>
039.
<td><div align=
"center"
><?=
$objResult
[
'NO'
]?></div></td>
040.
<td><div align=
"center"
><a href=
"Vpro.php?name=<?$objResult['Pro']?>"
><?=
$objResult
[
'Pro'
];?></a></div> </td>
041.
042.
<td><div align=
"center"
><?=
$objResult
[
"Customer"
];?></div></td>
043.
044.
045.
046.
<td><?=
$objResult
[
"Project_Owner"
];?></td>
047.
048.
<td><?=
$objResult
[
"Start_Date"
];?></td>
049.
<td><?=
$objResult
[
"End_Date"
];?></td>
050.
051.
</tr>
052.
<?
053.
}
054.
?>
055.
056.
</table>
057.
<?
058.
mysql_close(
$objConnect
);
059.
060.
?>
061.
062.
063.
064.
-----------------------------------------------------------------------------หน้าสอง
065.
066.
<?php
067.
$hostname_connection
=
"localhost"
;
068.
$database_connection
=
"TOT_DATA"
;
069.
$username_connection
=
"root"
;
070.
$password_connection
=
"1234"
;
071.
$connection
= mysql_pconnect(
$hostname_connection
,
$username_connection
,
$password_connection
)
or
trigger_error(mysql_error(),E_USER_ERROR);
072.
mysql_query(
"SET NAMES UTF8"
);
073.
?>
074.
<?
075.
mysql_select_db(
$database_connection
,
$connection
);
076.
$strSearch
=
$_get
[
'name'
];
077.
078.
$query_rs_item
= ("SELECT *
079.
FROM site
080.
WHERE Project =
'$strSearch'
");
081.
082.
$rs_item
= mysql_query(
$query_rs_item
,
$connection
)
or
die
(mysql_error());
083.
?>
084.
<html>
085.
<head>
086.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
087.
<title>List</title>
088.
</head>
089.
<body>
090.
091.
092.
<table width=
"3490"
border=
"1"
align=
"center"
cellpadding=
"0"
cellspacing=
"0"
style=
"text-align:center;"
>
093.
<tr bgcolor=
"#0099FF"
>
094.
095.
096.
097.
<th width=
"200"
> <div align=
"center"
>Project </div></th>
098.
<th width=
"200"
> <div align=
"center"
>ชื่อลูกค้า </div></th>
099.
<th width=
"200"
> <div align=
"center"
>เจ้าของโครงการ </div></th>
100.
<th width=
"80"
> <div align=
"center"
>วันที่เริ่มโครงการ </div></th>
101.
<th width=
"80"
> <div align=
"center"
>วันที่สิ้นสุดโครงการ </div></th>
102.
103.
<th width=
"100"
> <div align=
"center"
>หมายเลขวงจร </div></th>
104.
<th width=
"400"
> <div align=
"center"
>ที่อยู่สาขา </div></th>
105.
<th width=
"400"
> <div align=
"center"
>ที่อยู่ลูกค้า </div></th>
106.
<th width=
"140"
> <div align=
"center"
>PE_WAN </div></th>
107.
<th width=
"140"
> <div align=
"center"
>CE_WAN </div></th>
108.
<th width=
"140"
> <div align=
"center"
>CE_LAN </div></th>
109.
<th width=
"150"
> <div align=
"center"
>จังหวัด</div></th>
110.
<th width=
"150"
> <div align=
"center"
>เทคโนโลยี </div></th>
111.
<th width=
"110"
> <div align=
"center"
>Speed</div></th>
112.
<th width=
"200"
> <div align=
"center"
>ชื่อของช่าง </div></th>
113.
<th width=
"110"
> <div align=
"center"
>เบอร์ติดต่อช่าง</div>
114.
115.
</tr>
116.
<?php
while
(
$row_rs_item
= mysql_fetch_assoc(
$rs_item
)){ ?>
117.
<tr>
118.
119.
<td><?php
echo
$row_rs_item
[
'Project'
]; ?></td>
120.
<td><?php
echo
$row_rs_item
[
'Customer_name'
]; ?></td>
121.
<td><?php
echo
$row_rs_item
[
'Project_Owner'
]; ?></td>
122.
<td><?php
echo
$row_rs_item
[
'Start_Date'
]; ?></td>
123.
<td><?php
echo
$row_rs_item
[
'End_Date'
]; ?></td>
124.
125.
<td><?php
echo
$row_rs_item
[
'TOT_C_ID'
]; ?></td>
126.
<td><?php
echo
$row_rs_item
[
'Site'
]; ?></td>
127.
<td><?php
echo
$row_rs_item
[
'Address'
]; ?></td>
128.
<td><?php
echo
$row_rs_item
[
'PE_WAN'
]; ?></td>
129.
<td><?php
echo
$row_rs_item
[
'CE_WAN'
]; ?></td>
130.
<td><?php
echo
$row_rs_item
[
'CE_LAN'
]; ?></td>
131.
<td><?php
echo
$row_rs_item
[
'Province'
]; ?></td>
132.
<td><?php
echo
$row_rs_item
[
'Service'
]; ?></td>
133.
<td><?php
echo
$row_rs_item
[
'Speed'
]; ?></td>
134.
<td><?php
echo
$row_rs_item
[
'Contact_Point'
]; ?></td>
135.
<td><?php
echo
$row_rs_item
[
'Contact_Phone'
]; ?></td>
136.
</tr>
137.
<?php } ?>
138.
139.
140.
</table>
141.
</form>
142.
</body>
143.
</html>