Example #1
0
<?php

require_once '_db.php';
require_once '_db.lost.php';
require_once '_functions.php';
$lost_db = new LostDB();
$ItemName = $_POST['ItemName'];
$Location = $_POST['Location'];
$Description = $_POST['Description'];
$Date = strtotime(date('Y') . '-' . $_POST['Date_Month'] . '-' . $_POST['Date_Day']);
if ($Date > strtotime('tomorrow')) {
    $Date = strtotime('-1 year', $Date);
}
$Date = date('Y-m-d', $Date);
$Email = IWU_Auth::getUser() . '@iwu.edu';
$ContactName = IWU_Auth::getAttribute('displayName');
if ($_POST['type'] == 'found') {
    $lost_db->addFoundItem(array('ItemName' => $ItemName, 'Location' => $Location, 'Description' => $Description, 'Date' => $Date, 'Email' => $Email, 'ContactName' => $ContactName));
} else {
    if ($_POST['type'] == 'lost') {
        $lost_db->addLostItem(array('ItemName' => $ItemName, 'Location' => $Location, 'Description' => $Description, 'Date' => $Date, 'Email' => $Email, 'ContactName' => $ContactName));
    }
}
header('Location: _channel.lost.php');