-
Notifications
You must be signed in to change notification settings - Fork 2
/
view-profit.php
94 lines (74 loc) · 2.44 KB
/
view-profit.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
include("includes/header.php");
if(!isset($_SESSION['admin_username']))
{
echo "<script>document.location='login.php'</script>";
}
else
{
?>
<!-- Main Content-->
<div class="main-content pt-0">
<div class="container">
<div class="inner-body">
<!-- Page Header -->
<div class="page-header">
<div>
<h2 class="main-content-title tx-24 mg-b-5">Profits</h2>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">View Profits</li>
</ol>
</div>
</div>
<!-- End Page Header -->
<!-- Row -->
<div class="row sidemenu-height">
<div class="col-lg-12">
<div class="card custom-card">
<div class="card-body">
<div class="table-responsive">
<table class="table" id="exportexample">
<thead>
<tr>
<th class="wd-20p">Net Sales</th>
<th class="wd-15p">Cost of Goods Sold</th>
<th class="wd-20p">Expenses</th>
<th class="wd-20p">Gross Profit</th>
<th class="wd-15p">Date</th>
</tr>
</thead>
<tbody>
<?php
$get_prof = "SELECT * FROM tbl_profit";
$run_prof = mysqli_query($db, $get_prof);
while($row_prof = mysqli_fetch_array($run_prof))
{
$net_sales = $row_prof['net_sales'];
$cogs = $row_prof['cogs'];
$expenses = $row_prof['expenses'];
$gross_profit = $row_prof['gross_profit'];
$profit_date = $row_prof['profit_date'];
?>
<tr>
<td>₵<?php echo number_format($net_sales,2); ?></td>
<td>₵<?php echo number_format($cogs, 2); ?></td>
<td>₵<?php echo number_format($expenses, 2); ?></td>
<td>₵<?php echo number_format($gross_profit, 2); ?></td>
<td><?php echo date("M d, Y",strtotime($profit_date)); ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- End Row -->
</div>
</div>
</div>
<!-- End Main Content-->
<?php include("includes/footer.php"); ?>
<?php } ?>