001.
code.php
004.
<head>
005.
<title>Untitled Document</title>
006.
<style type=
"text/css"
>
007.
table#gridview {
008.
clear:both;
009.
}
010.
table#gridview td {
011.
padding:3px 0px;
012.
}
013.
table#gridview tr.head {
014.
background:#B18904;
015.
font-family:Arial, Helvetica, sans-serif;
016.
text-align:center;
017.
}
018.
table#gridview tr.head td {
019.
padding:3px 0px;
020.
}
021.
.bb2 {
022.
font-size: 14px;
023.
}
024.
text-indent:0.5in;
025.
#gridviewsss {
026.
color: #FFF;
027.
}
028.
body {
029.
background-color: #D3D3D3;
030.
}
031.
body,td,th {
032.
color: #909090;
033.
}
034.
thead > tr{background:#A2C4AA;}
035.
th, td{font-family:font-family:Arial, Helvetica, sans-serif}
036.
thead th{color:#fff;font-size:14px;}
037.
tr{height:44px;}
038.
tbody > tr:nth-child(even) {background: #f3f3f3}
039.
tbody > tr:nth-child(odd) {background: #fff}
040.
tr.tr2 {background:#FFB7B7 !important}
041.
tbody > tr:hover, tr.tr2:hover, tr.tr3:hover{background:#fff5e6 !important}
042.
tbody td{font-size:13px;color:#000}
043.
tbody td > div{text-align:center}
044.
.text-center{text-align:center}
045.
.hide{display: none;visibility: hidden;}
046.
</style>
047.
<body>
048.
<?php
049.
$objConnect
= mysql_connect(
"localhost"
,
"root"
,
"root"
)
or
die
(
"Error Connect to Database"
);
050.
$objDB
= mysql_select_db(
"ots_data"
);
051.
$strSQL
=
"SELECT * FROM customer"
;
052.
$objQuery
= mysql_query(
$strSQL
)
or
die
(
"Error Query ["
.
$strSQL
.
"]"
);
053.
$Num_Rows
= mysql_num_rows(
$objQuery
);
054.
$strSQL
.=
" order by id desc "
;
055.
$objQuery
= mysql_query(
$strSQL
);
056.
?>
057.
<table
class
=
"display"
width=
"800"
height=
"135"
border=
"0"
align=
"center"
cellpadding=
"1"
cellspacing=
"1"
id=
"gridview"
>
058.
<thead> <tr>
059.
<th width=
"35"
> ID </th>
060.
<th width=
"134"
>Reservation
Date
</th>
061.
<th width=
"212"
> Guest Name</th>
062.
<th width=
"161"
> Destination</th>
063.
<th width=
"79"
> Amount</th>
064.
<th width=
"41"
>Level</th>
065.
<th width=
"41"
>Level2</th>
066.
<th width=
"64"
>Remark</th>
067.
<th width=
"49"
> </th>
068.
</tr>
069.
</thead>
070.
<?php
071.
while
(
$objResult
= mysql_fetch_array(
$objQuery
))
072.
{
073.
$id
=
$objResult
[
"id"
];
074.
$remark
=
$objResult
[
"remark"
];
075.
$edit_class
= (trim(
$remark
) ==
''
) ?
''
:
' hide'
;
076.
$tr_class
=
''
;
077.
if
(
$objResult
[
'level'
] ==
'2'
)
078.
{
079.
$tr_class
=
' class="tr'
.
$objResult
[
'level'
].
'"'
;
080.
}
081.
echo
'<tr'
.
$tr_class
.
'>'
;
082.
083.
?>
084.
085.
<td height=
"42"
><div><?php
echo
$id
;?></div></td>
086.
<td><?php
echo
$objResult
[
"reservation_date"
];?></td>
087.
<td><?php
echo
$objResult
[
"destination"
];?></td>
088.
<td><?php
echo
$objResult
[
"guest_name"
];?></td>
089.
<td><?php
echo
$objResult
[
"amount"
];?></td>
090.
<td><?php
echo
$objResult
[
"level"
];?></td>
091.
092.
<td><?php
echo
$objResult
[
"level2"
];?></td>
093.
<td><?php
echo
$remark
;?></td>
094.
<td bgcolor=
"#999999"
>
095.
<div
class
=
"text-center<?php echo $edit_class;?>"
>
096.
<a href=
"edit.php?edit_id=<?=$objResult[id]?>"
>EDIT</a></div></td>
097.
</tr>
098.
099.
<?php
100.
}
101.
?>
102.
</table>
103.
</body>
104.
</html>