Example #1
0
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');
if ($q) {