-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetPrices.php
34 lines (22 loc) · 861 Bytes
/
getPrices.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
<?php
include("config.php");
// added a comment
$output = array('data' => array());
$sql = 'SELECT * FROM prices';
foreach ($conn->query($sql) as $row) {
$removeButton = '<a type="button" data-toggle="modal" data-target="#removeMemberModal" onclick="removeMember('.$row['ID'].')"> <span class="glyphicon glyphicon-trash"></span> </a>
<a type="button" data-toggle="modal" data-target="#editMemberModal" onclick="editMember('.$row['ID'].')"> <span class="glyphicon glyphicon-edit"></span></a>' ;
$startTime = date("g:i a", strtotime($row['startTime']));
$endTime = date("g:i a", strtotime($row['endTime']));
$output['data'][] = array(
$row['ID'],
$startTime ,
$endTime,
$row['perkm'],
$row['min'],
$removeButton
);
}
// database connection close
echo json_encode($output);
?>