Example #1
0
include "/srv/athenace/lib/intranet/common.php";
include "/srv/athenace/lib/shared/functions_form.php";
if (!is_numeric($_GET['id'])) {
    header("Location: /quotes/?id=notFound");
    exit;
}
# Set up HTML Form input error array
# Check if we have Form Data to process
if (isset($_GET['go']) && $_GET['go'] == "y") {
    if (empty($errors)) {
        if ($_POST['live'] != 1) {
            $_POST['live'] = 0;
        }
        # Update DB
        $quotesUpdate = new Quotes();
        $quotesUpdate->setQuotesid($_GET['id']);
        $quotesUpdate->setLive($_POST['live']);
        $quotesUpdate->updateDB();
        $logContent = 'Changed Quote Status to ' . $input['live'];
        $logresult = logEvent(5, $logContent);
        header("Location: /quotes/view.php?id=" . $_GET['id']);
        exit;
    }
}
# Define  elements for the HTML Header include
$pagetitle = "Edit Quote";
$pagescript = array("/pub/calpop/calendar_eu.js");
$pagestyle = array("/css/calendar.css");
include "../tmpl/header.php";
$sqltext = "SELECT * FROM quotes WHERE quotesid=?";
$q = $db->select($sqltext, array($_GET['id']), 'i');
Example #2
0
include "/srv/athenace/lib/shared/functions_form.php";
if (!is_numeric($_GET['id'])) {
    header("Location: /quotes/?id=notFound");
    exit;
}
if (isset($_GET['go']) && $_GET['go'] == "y") {
    $quotesDelete = new Quotes();
    $quotesDelete->setQuotesid($_GET['id']);
    $quotesDelete->deleteFromDB();
    header("Location: /quotes/?ItemDeleted=y");
    exit;
}
include "../tmpl/header.php";
$quotes = new Quotes();
// Load DB data into object
$quotes->setQuotesid($_GET['id']);
$quotes->loadQuotes();
$all = $quotes->getAll();
if (isset($all)) {
    ?>

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