-
Notifications
You must be signed in to change notification settings - Fork 0
/
event_print.php
66 lines (48 loc) · 1.1 KB
/
event_print.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<html>
<body>
<div align = "center">
<h1> List of Asset </h1>
<table border =2 cellpadding =2 cellspacing =2>
<tr>
<TH>ID</TH>
<TH>TYPE</TH>
<TH>TOPIC</TH>
<TH>DATE</TH>
<TH>TIME</TH>
<TH>VENUE</TH>
</tr>
<?php
//Create connect with MySql Database
$con = mysqli_connect('127.0.0.1','root','');
//Select database
if(!mysqli_select_db($con,'wadah4db'))
{
echo "Event not selected";
}
//select query
$sql = "SELECT * FROM event";
//execute the SQL query
$records = mysqli_query($con,$sql);
while ($row = mysqli_fetch_array($records))
{
echo "<tr>";
echo "<td>".$row['event_id']."</td>";
echo "<td>".$row['event_type']."</td>";
echo "<td>".$row['event_topic']."</td>";
echo "<td>".$row['event_date']."</td>";
echo "<td>".$row['event_time']."</td>";
echo "<td>".$row['event_venue']."</td>";
echo "</tr>";
}
?>
</table>
<br>
<br>
<button onclick="myFunction()">Print</button>
<script>
function myFunction() {
window.print();
}
</script>
</body>
</html>