Ejemplo n.º 1
0
    $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;
}
if (isset($_GET['editform'])) {
    Exchange::updateExchange($_POST['id'], $_POST['name'], $_POST['web']);
    header('Location: .');
    exit;
}
// SELECT THE LIST OF EXCHANGES //////////////////////////////////////////////////////
$exchanges = Exchange::getExchanges();
include 'exchanges.html.php';