Пример #1
0
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) {
        if (isset($value) && $value != '') {