Beispiel #1
0
foreach ($fields as $field) {
    if (!isset($_POST[$field])) {
        $_POST[$field] = '';
    }
}
// Check if we have Form Data to process
if (isset($_GET['go']) && $_GET['go'] == "y") {
    $logContent = "\n";
    // Insert into DB
    $quotesNew = new Quotes();
    $quotesNew->setCustid($_POST['custid']);
    $quotesNew->setIncept(time());
    $quotesNew->setContent($_POST['content']);
    $quotesNew->setPrice($_POST['price']);
    $quotesNew->setNotes($_POST['notes']);
    $quotesid = $quotesNew->insertIntoDB();
    $logresult = logEvent(1, $logContent);
    header("Location: /quotes/?id=" . $quotesid);
    exit;
}
// Define elements for the HTML Header include
$pagescript = array('/pub/js/jquery.js');
$pagestyle = array();
include "../tmpl/header.php";
?>

<h1>Add a New Quote</h1>

<form role="form" action="<?php 
echo $_SERVER['PHP_SELF'];
?>