Ejemplo n.º 1
0
if (isset($_POST['btnEventDelete'])) {
    require_once CLASSES . 'event.php';
    $post_id = $_POST['hidPostID'];
    $post = new Post($post_id, 'edit');
    if ($post->delete_post()) {
        url_redirect(HTTP_SERVER . 'index.php?post=1');
    } else {
    }
}
if (isset($_POST['btnVarUpdate'])) {
    require_once CLASSES . 'variable.php';
    $var_id = $_POST['hidVarID'];
    $var_name = $_POST['txtVarName'];
    $var_value = $_POST['txtVarVal'];
    $variable = new Variable($var_id, 'edit');
    if ($variable->update_variable($var_name, $var_value)) {
        unset($_POST['btnVarUpdate']);
        url_redirect(HTTP_SERVER . 'index.php?variable=1');
    } else {
    }
}
if (isset($_POST['btnVarAdd'])) {
    require_once CLASSES . 'variable.php';
    $var_name = $_POST['txtVarName'];
    $var_value = $_POST['txtVarVal'];
    $variable = new Variable();
    if ($variable->add_variable($var_name, $var_value)) {
        unset($_POST['btnVarAdd']);
        url_redirect(HTTP_SERVER . 'index.php?variable=1');
    } else {
    }