Example #1
0
    update_session();
    if (isset($_POST['mark'])) {
        $marked = $_POST['mark'];
        foreach ($marked as $symb) {
            del_from_cart('cart', $symb);
        }
    }
} elseif (isset($_POST['watch'])) {
    update_session();
    if (isset($_POST['mark'])) {
        $marked = $_POST['mark'];
        foreach ($marked as $symb) {
            if (!is_in_cart('watch', $symb)) {
                if (add_to_cart('watch', $symb, $_POST["comment_{$symb}"], $_POST["volume_{$symb}"])) {
                    del_from_cart('cart', $symb);
                }
            }
        }
    }
} elseif (isset($_POST['buy'])) {
    update_session();
    if (isset($_POST['mark'])) {
        $marked = $_POST['mark'];
        foreach ($marked as $symb) {
            if (buy_stock($symb, $_POST["comment_{$symb}"], $_POST["volume_{$symb}"])) {
                del_from_cart('cart', $symb);
            }
        }
    }
}
draw_buy_table($pf_id, $pf_working_date, $pf_exch, $pf_name);
Example #2
0
    }
    if (isset($_POST['chart_period'])) {
        $_SESSION['chart_period'] = $_POST['chart_period'];
    } else {
        unset($_SESSION['chart_period']);
    }
}
if (isset($_POST['recalc'])) {
    update_session();
} elseif (isset($_POST['delete'])) {
    update_session();
    if (isset($_POST['mark'])) {
        $marked = $_POST['mark'];
        foreach ($marked as $symb) {
            del_from_cart('watch', $symb);
        }
    }
} elseif (isset($_POST['cart'])) {
    update_session();
    if (isset($_POST['mark'])) {
        $marked = $_POST['mark'];
        foreach ($marked as $symb) {
            if (!is_in_cart('cart', $symb)) {
                if (add_to_cart('cart', $symb, $_POST["comment_{$symb}"], $_POST["volume_{$symb}"])) {
                    del_from_cart('watch', $symb);
                }
            }
        }
    }
}
draw_watch_table($pf_id, $pf_working_date, $pf_exch, $pf_name);