Ejemplo n.º 1
0
    exit;
}
// ADD AND EDIT EXCHANGES
// ADD
if (isset($_GET['addexchange'])) {
    $pageTitle = 'New Exchange';
    $action = 'addform';
    $name = '';
    $web = '';
    $id = '';
    $button = 'Add exchange';
    include 'form.html.php';
    exit;
}
if (isset($_GET['addform'])) {
    Exchange::insertExchange($_POST['name'], $_POST['web']);
    header('Location: .');
    exit;
}
//EDIT
if (isset($_POST['action']) and $_POST['action'] == 'Edit') {
    $arr = Exchange::getExchanges($_POST['id']);
    $row = $arr[0];
    $pageTitle = 'Edit Exchange';
    $action = 'editform';
    $name = $row->_name;
    $web = $row->_web;
    $id = $row->_id;
    $button = 'Update exchange';
    include 'form.html.php';
    exit;