Example #1
0
        $logContent = 'Invoice Paid for InvoiceID:' . $_GET['id'];
        # Update DB
        $invoicesUpdate = new Invoices();
        $invoicesUpdate->setInvoicesid($_GET['id']);
        $invoicesUpdate->setPaid(time());
        $invoicesUpdate->updateDB();
        $logresult = logEvent(26, $logContent);
        $done = 1;
    }
}
if (isset($_GET['go']) && $_GET['go'] == "undopaid") {
    if (isset($_GET['id']) && is_numeric($_GET['id']) && $_GET['id']) {
        $logContent = 'Invoice marked UNPaid for InvoiceID:' . $_GET['id'];
        # Update DB
        $invoicesUpdate = new Invoices();
        $invoicesUpdate->setInvoicesid($_GET['id']);
        $invoicesUpdate->setPaid(0);
        $invoicesUpdate->updateDB();
        $logresult = logEvent(26, $logContent);
        $done = 1;
    }
}
// Define elements for the HTML Header include
$pagetitle = "Home";
$pagescript = array();
$pagestyle = array();
$query = isset($_GET['q']) && $_GET['q'] != '' ? $_GET['q'] : '';
$custid = isset($_GET['custid']) && is_numeric($_GET['custid']) && $_GET['custid'] > 0 ? $_GET['custid'] : '';
include "../tmpl/header.php";
?>
Example #2
0
include "/srv/athenace/lib/shared/functions_form.php";
if (!is_numeric($_GET['id'])) {
    header("Location: /invoices/?id=notFound");
    exit;
}
if (isset($_GET['go']) && $_GET['go'] == "y") {
    $invoicesDelete = new Invoices();
    $invoicesDelete->setInvoicesid($_GET['id']);
    $invoicesDelete->deleteFromDB();
    header("Location: /invoices/?ItemDeleted=y");
    exit;
}
include "../tmpl/header.php";
$invoices = new Invoices();
// Load DB data into object
$invoices->setInvoicesid($_GET['id']);
$invoices->loadInvoices();
$all = $invoices->getAll();
if (isset($all)) {
    ?>

<div class="panel panel-info">
	<div class="panel-heading">
		<strong>Viewing <?php 
    echo $invoices->getInvoicesid();
    ?>
</strong>
	</div>
	<div class="panel-body">
		<?php 
    foreach ($all as $key => $value) {