Пример #1
0
    if (!$result) {
        flash();
    }
}
if (isset($_POST['del']) && !empty($_POST['id'])) {
    $result = $goods->del($_POST['id']);
}
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    if (!empty($_GET['id'])) {
        $id = intval($_GET['id']);
    }
    if ($do == "del" && !empty($id)) {
        $result = $goods->del($_GET['id']);
    }
    if ($do == "edit") {
        if (!empty($id)) {
            $result = $goods->read("*", $id);
            setvar("item", $result);
        }
        $tpl_file = "goods.edit";
        template($tpl_file);
        exit;
    }
}
$amount = $goods->findCount();
$page->setPagenav($amount);
$result = $goods->findAll("*", null, $conditions, "id desc", $page->firstcount, $page->displaypg);
setvar("Items", $result);
setvar("ByPages", $page->pagenav);
template($tpl_file);
Пример #2
0
         $new_trade_no = $order->Add($order_result);
         $order_result['trade_no'] = $new_trade_no;
     }
     $tmp = $pdb->GetRow("SELECT * FROM " . $tb_prefix . "payments WHERE name='" . $order_pay_code . "' AND available=1");
     if (!empty($tmp['config'])) {
         $payment_config = unserialize($tmp['config']);
     }
     $payer->redirect($order_result, $payment_config);
     break;
 case "buynow":
     //If not exists, create a new order.
     $data['member_id'] = $member_info['id'];
     $data['cache_username'] = $member_info['username'];
     $data['content'] = htmlspecialchars($_POST['content']);
     //get price by good_id
     $info = $goods->read("*", $_POST['good_id']);
     if (!empty($_POST['payment_id'])) {
         $data['pay_id'] = intval($_POST['payment_id']);
     }
     if (!empty($info)) {
         $data['total_price'] = $info['price'];
         $data['subject'] = $info['name'];
         $new_trade_no = $order->Add($data);
     }
     //get payment information
     $tmp = $pdb->GetRow("SELECT * FROM " . $tb_prefix . "payments WHERE id='" . $_POST['payment_id'] . "' AND available=1");
     setvar("OnlineSupport", $tmp['if_online_support']);
     setvar("tradeno", $new_trade_no);
     render("member.pay", 1);
     break;
 default: