<?php # daily_deals.php
// This script will be the base page to set up the user's profile
require ('includes/config.inc.php');
$page_title = 'Daily Deals';
include ('includes/header.html');
require (MYSQL); // Need the database connection:
// refresh_session(0);
// If no first_name session variable exists, redirect the user:
if (!isset($_SESSION['person_id'])) {
$url = BASE_URL . 'index.php'; // Define the URL.
ob_end_clean(); // Delete the buffer.
header("Location: $url");
exit(); // Quit the script.
}
refresh_session(0); // Refresh session settinings incase of previous changes
// header
echo "<h1>$page_title</h1><br />";
if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Handle the form.
$trimmed = array_map('trim', $_POST); // Trim all the incoming data:
}// End of the main Submit conditional.
?>
<h2>Daily Deals</h2>
<form action="daily_deals.php" method="post">
<fieldset>
<p>Work Address 1: <input type="text" name="w_address1" size="20" maxlength="20"
value="<?php echo (isset($trimmed['w_address1']) ? $trimmed['w_address1'] : (isset($_SESSION['o_address1']) ? $_SESSION['o_address1'] : '' )); ?>" /></span></pre>
<pre><span style="font-size: 10pt;">
<p>Work Address 2: <input type="text" name="w_address2" size="30" maxlength="80"
value="<?php echo (isset($trimmed['w_address2']) ? $trimmed['w_address2'] : (isset($_SESSION['o_address2']) ? $_SESSION['o_address2'] : '' )); ?>" /></span></pre>
<pre><span style="font-size: 10pt;">
<p style="color:red">Work City: <input type="text" name="w_city" size="20" maxlength="20"
value="<?php echo (isset($trimmed['w_city']) ? $trimmed['w_city'] : (isset($_SESSION['o_city']) ? $_SESSION['o_city'] : '' )); ?>" /></span></pre>
<pre><span style="font-size: 10pt;">
<p style="color:red">Work State: <input type="text" name="w_state" size="20" maxlength="20"
value="<?php echo (isset($trimmed['w_state']) ? $trimmed['w_state'] : (isset($_SESSION['o_state']) ? $_SESSION['o_state'] : '' )); ?>" /></span></pre>
<pre><span style="font-size: 10pt;">
<p>Work Zip: <input type="text" name="w_zip" size="20" maxlength="40"
value="<?php echo (isset($trimmed['w_zip']) ? $trimmed['w_zip'] : (isset($_SESSION['o_zip']) ? $_SESSION['o_zip'] : '' )); ?>" /></span></pre>
<pre><span style="font-size: 10pt;">
<p style="color:red">Your Birth Date: <input type="date" name="w_birth" size="20" maxlength="40"
value="<?php echo (isset($trimmed['w_birth']) ? $trimmed['w_birth'] : (isset($_SESSION['birth_date']) ? $_SESSION['birth_date'] : '' )); ?>" /></span></pre>
<pre><span style="font-size: 10pt;">
<p style="color:red">Date You Started In This Business: <input type="date" name="w_start" size="20" maxlength="40"
value="<?php echo (isset($trimmed['w_start']) ? $trimmed['w_start'] : (isset($_SESSION['start_date']) ? $_SESSION['start_date'] : '' )); ?>" /></span></pre>
<pre><span style="font-size: 10pt;">
</fieldset>
<div align="center">
<input type="submit" name="submit" value="Submit" />
</div>
</form>
<?php
include ('includes/footer.html');
?>