-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist.php
More file actions
37 lines (35 loc) · 806 Bytes
/
list.php
File metadata and controls
37 lines (35 loc) · 806 Bytes
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
<?php
$data = array();
$file = fopen("records.dat","r");
$lines = split("\n", file_get_contents($file));
?>
<!DOCTYPE html>
<html>
<head>
<title>Test app - list events</title>
</head>
<body>
<table>
<tr>
<th>Event name</th>
<th>Start date</th>
<th>End date</th>
<th>Number of tickets</th>
</tr>
<tr>
<?php
for($i = 1; $i < 11; $i++){ //loop for the first 10 lines
echo $lines[$i];
$name = $lines[$i]$file[0];
$start = $lines[$i]$file[1];
$end = $lines[$i]$file[2];
$tickets = $lines[$i]$file[3];?>
<td><?php echo $name ?></td>
<td><?php echo $start ?></td>
<td><?php echo $end ?></td>
<td><?php echo $tickets ?></td>
<?php } ?>
</tr>
</table>
</body>
</html>