Exemple #1
0
$type = $_POST['type'];
$number = $_POST['number'];
$secure_number = $_POST['secure_number'];
$month = $_POST['month'];
$year = $_POST['year'];
$name = $_POST['name'];
do_html_header('支付');
do_html_top();
if ($_POST['submit'] && $_SESSION['cart'] && $_POST['order_info_userid'] && $_POST['order_info_orderid'] && $_POST['type'] && $_POST['number'] && $_POST['secure_number'] && $_POST['month'] && $_POST['year'] && $_POST['name']) {
    display_cart($_SESSION['cart'], false, 1, 1);
    if (query_order_pay($order_info_orderid) == PAYED) {
        echo "您的订单已经支付成功,无需再次支付。您的订单号:" . $order_info_orderid;
    }
    if (query_order_pay($order_info_orderid) == UNPAYED) {
        if (process_card()) {
            change_order_status($order_info_orderid);
            $date = date("Y-m-d H:i:s");
            echo "您的订单支付成功。支付时间:" . $date . "。您的订单号:" . $order_info_orderid;
            unset($_SESSION['cart']);
            unset($_SESSION['total_price']);
            unset($_SESSION['items']);
        } else {
            echo "您的信用卡有误。";
        }
    } else {
        echo "错误2<br>";
        echo query_order_pay($order_info_orderid);
    }
} else {
    echo "支付信息请填完整";
    print_r($_POST);
Exemple #2
0
function fp_loadfile($Frm, $Err)
{
    global $order_id;
    if (!$Err) {
        $f = $Frm->GetValue(0);
        //$f["tmp_name"]
        //$f["name"]
        //$f["size"]
        //$f["type"]
        if (is_uploaded_file($f["tmp_name"])) {
            $extension = get_file_ext($f['name']);
            if (trim($Frm->GetValueH(1)) == "") {
                $name = $f["name"];
            } else {
                $name = trim($Frm->GetValueH(1)) . '.' . $extension;
            }
            $file_id = Order::attachFile($order_id, $_SESSION["user"]["data"]["id"], $name, $f["size"]);
            if (!$file_id) {
                $Frm->_gui->ERR("Ошибка при загрузке");
            } else {
                $dir = DIR_FS_ORDER_FILES . $order_id . '/';
                if (!is_dir(DIR_FS_ORDER_FILES)) {
                    create_path('order_files', DIR_FS_DOCUMENT_ROOT);
                }
                if (!is_dir($dir)) {
                    create_path($order_id, DIR_FS_ORDER_FILES);
                }
                $file_name = $file_id . '.' . $extension;
                if (move_uploaded_file($f['tmp_name'], $dir . $file_name)) {
                    $Frm->_gui->OK("Файл загружен");
                    if ($_SESSION["user"]["data"]["group_id"] == 6 && get_order_author_id($order_id) == $_SESSION["user"]["data"]["id"]) {
                        $res = change_order_status($order_id, 'RECEIVED_FILE_FROM_AUTHOR');
                        if ($res == 1) {
                            $Frm->_gui->OK("Статус заказа изменен");
                        } else {
                            $Frm->_gui->ERR($res);
                        }
                    }
                } else {
                    Order::deleteAttachedFile($file_id);
                    $Frm->_gui->ERR("Ошибка при сохранении файла");
                }
            }
            page_reloadAll();
        }
    }
}
Exemple #3
0
function fp_loadfile($Frm, $Err)
{
    if (!$Err) {
        $order_id = $Frm->GetNmValueI('order_id');
        $file = $Frm->GetNmValue('file');
        if (is_uploaded_file($file["tmp_name"])) {
            $extension = get_file_ext($file['name']);
            $new_name = trim($Frm->GetNmValueH('new_name'));
            if ($new_name == "") {
                $name = $file["name"];
            } else {
                $name = $new_name . '.' . $extension;
            }
            $file_id = OrderFile::create(array('order_id' => $order_id, 'creator_id' => $_SESSION["user"]["data"]["id"], 'created' => time(), 'name' => $name, 'size' => $file["size"]));
            if (!$file_id) {
                $Frm->_gui->ERR("Ошибка при загрузке");
            } else {
                $dir = DIR_FS_ORDER_FILES . $order_id . '/';
                if (!is_dir(DIR_FS_ORDER_FILES)) {
                    create_path('order_files', DIR_FS_DOCUMENT_ROOT);
                }
                if (!is_dir($dir)) {
                    create_path($order_id, DIR_FS_ORDER_FILES);
                }
                $file_name = $file_id . '.' . $extension;
                if (move_uploaded_file($file['tmp_name'], $dir . $file_name)) {
                    $Frm->_gui->OK("Файл загружен");
                    if ($_SESSION["user"]["data"]["group_id"] == 6 && get_order_author_id($order_id) == $_SESSION["user"]["data"]["id"]) {
                        $res = change_order_status($order_id, 'RECEIVED_FILE_FROM_AUTHOR');
                        if ($res == 1) {
                            $Frm->_gui->OK("Статус заказа изменен");
                        } else {
                            $Frm->_gui->ERR($res);
                        }
                    }
                } else {
                    OrderFile::delete($file_id);
                    $Frm->_gui->ERR("Ошибка при сохранении файла");
                }
            }
            page_reloadAll();
        }
    }
}