403Webshell
Server IP : 173.209.174.21  /  Your IP : 216.73.216.89
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux wcfs-server 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64
User : nodor ( 1000)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/wcfs/tabs/Backups/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/wcfs/tabs/Backups/print_all_statements.php.b4 1 page per customer
<?php
include 'db.php';

$tax_rate = 0.082;

$customers = $conn->query("SELECT id, first_name, last_name FROM customers ORDER BY last_name, first_name");

echo "<!DOCTYPE html><html><head><meta charset='UTF-8'><title>All Customer Statements</title>
<style>
.page-break { page-break-after: always; }
.header { font-size: 14px; line-height: 1.6; margin-bottom: 10px; }
    body { font-family: 'Segoe UI', sans-serif; margin: 20px; }
    h2 { border-bottom: 1px solid #ccc; padding-bottom: 4px; }
    table { width: 100%; border-collapse: collapse; margin-top: 10px; }
    th, td { border: 1px solid #ccc; padding: 8px; text-align: left; }
    th { background-color: #eee; }
    .total { font-weight: bold; background: #f5f5f5; }
</style>
</head><body>";

while ($customer = $customers->fetch_assoc()) {
    $customer_id = $customer['id'];
    $name = htmlspecialchars($customer['first_name'] . ' ' . $customer['last_name']);

    $stmt = $conn->prepare("SELECT * FROM transactions WHERE customer_id = ? ORDER BY date DESC");
    $stmt->bind_param("i", $customer_id);
    $stmt->execute();
    $result = $stmt->get_result();

    if ($result->num_rows > 0) {
        echo "<div class='page-break'></div>
<div class='header'>
    <strong>Wilson Creek Farm Supply</strong><br>
    117 3rd St S, Wilson Creek WA 98860<br>
    509-345-2572<br>
    info@wilsoncreekfarmsupply.com<br>
    www.wilsoncreekfarmsupply.com
</div>
<hr><br>
<h2>$name</h2>";
        echo "<table><tr>
                <th>Date</th>
                <th>Qty</th>
                <th>Item</th>
                <th>Price</th>
                <th>Taxable</th>
                <th>Total</th>
                <th>Notes</th>
              </tr>";

        $item_total = 0;
        $taxable_total = 0;

        while ($row = $result->fetch_assoc()) {
            $line_base = $row['price'] * $row['quantity'];
            $line_total = $line_base;
            if ($row['taxable']) {
                $taxable_total += $line_base;
                $line_total *= (1 + $tax_rate);
            }
            $item_total += $line_base;

            echo "<tr>
                    <td>{$row['date']}</td>
                    <td>{$row['quantity']}</td>
                    <td>" . htmlspecialchars($row['item_name']) . "</td>
                    <td>$" . number_format($row['price'], 2) . "</td>
                    <td>" . ($row['taxable'] ? 'Yes' : 'No') . "</td>
                    <td>$" . number_format($line_total, 2) . "</td>
                    <td>" . htmlspecialchars($row['notes']) . "</td>
                  </tr>";
        }

        $tax_amount = $taxable_total * $tax_rate;
        $total = $item_total + $tax_amount;

        echo "<tr class='total'><td colspan='5' align='right'>Item Total:</td><td colspan='2'>$" . number_format($item_total, 2) . "</td></tr>";
        echo "<tr class='total'><td colspan='5' align='right'>Tax Total (8.2%):</td><td colspan='2'>$" . number_format($tax_amount, 2) . "</td></tr>";
        echo "<tr class='total'><td colspan='5' align='right'>Total with Tax:</td><td colspan='2'>$" . number_format($total, 2) . "</td></tr>";
        echo "</table><br><br>";
    }
}

echo "</body></html>";
?>

Youez - 2016 - github.com/yon3zu
LinuXploit