'; // print_r($_POST); // die(); // Sanitize and assign form inputs $company_id = mysqli_real_escape_string($conn, $_POST['company_id']); $customer_id = mysqli_real_escape_string($conn, $_POST['customer_id']); $po_no = mysqli_real_escape_string($conn, $_POST['po_no']); $po_date = mysqli_real_escape_string($conn, $_POST['po_date']); $rate = mysqli_real_escape_string($conn, $_POST['rate']); $po_quantity = mysqli_real_escape_string($conn, $_POST['po_quantity']); $po_quantity_left = mysqli_real_escape_string($conn, $_POST['po_quantity_left']); $created_at = date('Y-m-d H:i:s'); $stmt = $conn->prepare(" INSERT INTO `purchase_order_master` (`company_name`, `customer_name`, `po_no`, `po_date`, `rate`, `po_quantity`, `po_quantity_left`, `created_at`) VALUES (?, ?, ?, ?, ?, ?, ?, ?) "); if ($stmt) { $stmt->bind_param( "ssssssss", $company_id, $customer_id, $po_no, $po_date, $rate, $po_quantity, $po_quantity_left, $created_at ); if ($stmt->execute()) { echo ""; } else { echo "Error executing query: " . $stmt->error; } $stmt->close(); } else { echo "Failed to prepare statement: " . $conn->error; } $conn->close(); } require_once('includes/header.php'); ?>

Purchase Order Dashboard

Inventory
query($query); $index = 1; // Initialize row index if ($result && $result->num_rows > 0) { while ($row = $result->fetch_assoc()) { echo ""; $index++; // Increment index } } else { echo ''; } ?>
ID Our Company Customer PO No. Date Rate P.O. Quantity P.O. Quantity Dispatched P.O. Quantity Left Actions
{$index} " . htmlspecialchars($row['company_name']) . " " . htmlspecialchars($row['customer_name']) . " " . htmlspecialchars($row['po_no']) . " " . htmlspecialchars($row['po_date']) . " " . htmlspecialchars($row['rate']) . " " . htmlspecialchars($row['po_quantity']) . " " . htmlspecialchars($row['po_quantity_dispatched'] ?? '0') . " " . htmlspecialchars($row['po_quantity_left']) . "
No records found.