query($query2); while ($row2 = $result2->fetchArray()) { $string = $row2['fullname']; $parts = explode(" ", $string); if ($parts[0] == $_COOKIE["username"]){ $createEmail = $row2['email']; $createMobile = $row2['mobile']; $createdby = $row2['fullname']; } } $db2->close(); $dbFile4 = $parentDirectory . '/invoices/database/invoices.db'; if (!file_exists($dbFile4)) { $db = new SQLite3($dbFile4); if (!$db) { die("Failed to create the database file."); } // Create the 'projects' table $createQuery = "CREATE TABLE IF NOT EXISTS figures ( id INTEGER PRIMARY KEY AUTOINCREMENT, item TEXT, description TEXT, subtotal TEXT )"; $db->exec($createQuery); if (!$db->exec($createQuery)) { die("Failed to create the 'projects' table."); } $db->close(); } else { $db = new SQLite3($dbFile4); if (!$db) { die("Database connection failed: " . $db->lastErrorMsg()); } } // Function to fetch and display data function displayData($db) { $query = "SELECT id, item, description, subtotal FROM figures"; $result = $db->query($query); while ($row = $result->fetchArray(SQLITE3_ASSOC)) { $projectId = $row['id']; echo ""; echo "" . $row['item'] . ""; echo "" . $row['description'] . ""; echo "
R". $row['subtotal'] ."
"; echo ""; echo ""; } } if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["update"])) { $updatedData = $_POST["updatedData"]; $projectId = $_POST["projectId"]; $updateQuery = "UPDATE figures SET item = :item, description = :description, subtotal = :subtotal WHERE id = :id"; $stmt = $db->prepare($updateQuery); if (!$stmt) { die("Prepare failed: " . $db->lastErrorMsg()); } $stmt->bindValue(':item', $updatedData['item'], SQLITE3_TEXT); $stmt->bindValue(':description', $updatedData['description'], SQLITE3_TEXT); $stmt->bindValue(':subtotal', $updatedData['subtotal'], SQLITE3_TEXT); $stmt->bindValue(':id', $projectId, SQLITE3_INTEGER); $result = $stmt->execute(); if (!$result) { die("Execute failed: " . $db->lastErrorMsg()); } // Close the prepared statement $stmt->close(); } ?> Invoice
Home Clients Projects Invoices Statistics Leads Logout





"; echo '"; echo ""; ?> "; ?> "; echo ""; ?> "; ?> "; ?> '; echo $createdby; echo ""; echo ''; echo ""; ?> '; echo $createEmail; echo ""; echo ''; echo ""; ?> '; echo $createMobile; echo ""; echo ''; echo ''; ?> "; echo '"; echo ""; ?>
Company: Client:
BLACKHOUND ENTERPRISES PTY LTD T/A
BLACKHOUND ARCHITECTURE & RENDERING
Unit 10 - The Network
19 Cactus Road, Fairview, Port Elizabeth
(Gqeberha), Eastern Cape, 6075
Invoice No.: Date:  
Item: Description: Sub Total: .
1
R 0.00
Total: (excl. VAT)
R 0.00
Banking Details:
Bank:                       Nedbank
Account Type:         Cheque account
Account Number:    1212774191
Branch Code:          12681700
KINDLY USE THE INVOICE NUMBER AS YOUR PAYMENT REFERENCE