예제 #1
0
if (Input::get('detach') && Input::get('detach') == 1) {
    $return_url = Crytion::decryt64(Input::get("return_url"));
    $inv->detach_customer();
    Redirect::to($return_url);
}
//cancel sales
if (Input::get('detachall') == 1) {
    $return_url = Crytion::decryt64(Input::get("return_url"));
    $inv->cancel_sale();
    Redirect::to($return_url);
}
//remove item from shopping cart
if (Input::get('removep') && Input::get('return_url') && Session::exists('products')) {
    $code = Input::get('removep');
    $return_url = Crytion::decryt64(Input::get("return_url"));
    $inv->remove_item(Input::get('bac'), $code);
    Redirect::to($return_url);
}
//complete sales
if (Input::exists() && Input::get('complete') == md5("complete") && Session::exists('products') && Session::exists('add-pay')) {
    $return_url = Crytion::decryt64(Input::get("return_url"));
    echo $emp_id = Crytion::decryt64(Session::get('user_id'));
    $email = Input::get('bool-email');
    if (Session::exists('select_cust')) {
        echo $cust_id = Session::get('select_cust');
        echo "Send Email :" . $email;
    } else {
        $cust_id = "null";
        $email = "null";
    }
    $inv->completesales($cust_id, $emp_id, $email);