-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreportOverview.php
More file actions
65 lines (61 loc) · 1.7 KB
/
reportOverview.php
File metadata and controls
65 lines (61 loc) · 1.7 KB
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
<?php
/**
* Created by PhpStorm.
* User: Ivan
* Date: 09.08.2016
* Time: 19:55
*/
session_start();
require('dbconnect.php');
require('showquery.php');
if(isset($_GET['sct'])&&!empty($_GET['sct']))
{
$date=$_GET['sct'];
$total=0;
$sql = 'SELECT user.name,sales.price,product.name AS pname FROM user,sales,product WHERE sales.dateStamp="'.$date.'" AND sales.userId=user.id AND product.id=sales.productId';
$resultat=mysqli_query($con,$sql);
$array=array();
while($row=mysqli_fetch_assoc($resultat))
{
$array[]=$row;
$total+=$row['price'];
}
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link id="callCss" rel="stylesheet" href="themes/onlineitstore/bootstrap.min.css" media="screen"/>
<link href="themes/css/base.css" rel="stylesheet" media="screen"/>
<title>Document</title>
</head>
<body>
<h3 class="productsOverviewTitle">Извештај за <?php echo $date ?></php></h3><br/>
<div class="productsOverview reportOverview">
<table>
<tr>
<th>Корисник</th>
<th>Продукт</th>
<th>Цена</th>
</tr>
<?php
foreach($array as $item){ ?>
<tr>
<td><?php echo $item['name']?></td>
<td><?php echo $item['pname']?></td>
<td><?php echo $item['price']?> мкд</td>
</tr>
<?php } ?>
<tr>
<td></td>
<td><b>Вкупно:</b></td>
<td><?php echo $total ?></td>
</tr>
<tr>
<td><a href="adminPanel.php"><button class="btn btn-default"> Врати се </button></a></td>
</tr>
</table>
</div>
</body>
</html>