Đặt vé xe buýt trực tuyến bằng PHP / MySQLi
1 <?php
2 require_once('auth.php');
3 ?>
4 <html>
5 <head>
6 <link href="css/style.css" rel="stylesheet" type="text/css" />
7 <link rel="stylesheet" href="febe/style.css" type="text/css" media="screen" charset="utf-8">
8 <script src="argiepolicarpio.js" type="text/javascript" charset="utf-8"></script>
9 <script src="js/application.js" type="text/javascript" charset="utf-8"></script>
10 <!--sa poip up-->
11 <link href="src/facebox.css" media="screen" rel="stylesheet" type="text/css" />
12 <script src="lib/jquery.js" type="text/javascript"></script>
13 <script src="src/facebox.js" type="text/javascript"></script>
14 <script type="text/javascript">
15 jQuery(document).ready(function($) {
16 $('a[rel*=facebox]').facebox({
17 loadingImage : 'src/loading.gif',
18 closeImage : 'src/closelabel.png'
19 })
20 })
21 </script>
22 </head>
23 <body>
24 <div id="container">
25 <div id="adminbar-outer" class="radius-bottom">
26 <div id="adminbar" class="radius-bottom">
27 <a id="logo" href="dashboard.php"></a>
28 <div id="details">
29 <a class="avatar" href="javascript: void(0)">
30 <img width="36" height="36" alt="avatar" src="img/avatar.jpg">
31 </a>
32 <div class="tcenter">
33 Hi
34 <strong>Admin</strong>
35 !
36 <br>
37 <a class="alightred" href="../index.php">Logout</a>
38 </div>
39 </div>
40 </div>
41 </div>
42 <div id="panel-outer" class="radius" style="opacity: 1;">
43 <div id="panel" class="radius">
44 <ul class="radius-top clearfix" id="main-menu">
45 <li>
46 <a href="dashboard.php">
47 <img alt="Dashboard" src="img/m-dashboard.png">
48 <span>Dashboard</span>
49 </a>
50 </li>
51
52 <li>
53 <a class="active" href="route.php">
54 <img alt="Statistics" src="img/m-custom.png">
55 <span>Bus</span>
56 </a>
57 </li>
58 <li>
59 <a href="setinventory.php">
60 <img alt="Statistics" src="img/m-statistics.png">
61 <span>Seat Inventory</span>
62 </a>
63 </li>
64 <div class="clearfix"></div>
65 </ul>
66 <div id="content" class="clearfix">
67 <label for="filter">Filter</label> <input type="text" name="filter" value="" id="filter" />
68 <a rel="facebox" href="addroute.php">Add Route</a>
69
70 <table cellpadding="1" cellspacing="1" id="resultTable">
71 <thead>
72 <tr>
73 <th style="border-left: 1px solid #C1DAD7"> Bus Type </th>
74 <th> Route </th>
75 <th> Seat Number </th>
76 <th> Price </th>
77 <th> Time </th>
78 <th> Action </th>
79 </tr>
80 </thead>
81 <tbody>
82 <?php
83 include('../db.php');
84 $result = mysqli_query($conn,"SELECT * FROM route");
85 while($row = mysqli_fetch_array($result))
86 {
87 echo '<tr class="record">';
88 echo '<td style="border-left: 1px solid #C1DAD7;">'.$row['type'].'</td>';
89 echo '<td><div align="right">'.$row['route'].'</div></td>';
90 echo '<td><div align="right">'.$row['numseats'].'</div></td>';
91 echo '<td><div align="right">'.$row['price'].'</div></td>';
92 echo '<td><div align="right">'.$row['time'].'</div></td>';
93 echo '<td><div align="center"><a rel="facebox" href="editrutedetails.php?id='.$row['id'].'">edit</a> | <a href="#" id="'.$row['id'].'" class="delbutton" title="Click To Delete">delete</a></div></td>';
94 echo '</tr>';
95 }
96 ?>
97 </tbody>
98 </table>
99 </div>
100 <div id="footer" class="radius-bottom">
101 2011-12 ©
102 <a class="afooter-link" href="">TurboAdmin 1.1</a>
103 by
104 <a class="afooter-link" href="">Begie</a>
105 </div>
106 <div class="clearfix"></div>
107 </div>
108 <div class="clearfix"></div>
109 </div>
110 <div class="clearfix"></div>
111 </div>
112 <script src="js/jquery.js"></script>
113 <script type="text/javascript">
114 $(function() {
115
116
117 $(".delbutton").click(function(){
118
119 //Save the link in a variable called element
120 var element = $(this);
121
122 //Find the id of the link that was clicked
123 var del_id = element.attr("id");
124
125 //Built a url to send
126 var info = 'id=' + del_id;
127 if(confirm("Sure you want to delete this update? There is NO undo!"))
128 {
129
130 $.ajax({
131 type: "GET",
132 url: "deleteroute.php",
133 data: info,
134 success: function(){
135
136 }
137 });
138 $(this).parents(".record").animate({ backgroundColor: "#fbc7c7" }, "fast")
139 .animate({ opacity: "hide" }, "slow");
140
141 }
142
143 return false;
144
145 });
146
147 });
148 </script>
149 </body>
150 </html>