Ejemplo n.º 1
0
         if (!empty($_GET['typeid'])) {
             setvar("type_id", intval($_GET['typeid']));
         } else {
             setvar("type_id", $trade_info['type_id']);
         }
         $r1 = $industry->disSubOptions($trade_info['industry_id'], "industry_");
         $r2 = $area->disSubOptions($trade_info['area_id'], "area_");
         $trade_info = am($trade_info, $r1, $r2);
         setvar("item", $trade_info);
         $tpl_file = "offer_edit";
         template($tpl_file);
         exit;
         break;
     case "stat":
         $tpl_file = "tradestat";
         $amount = $trade->findAll("Trade.type_id AS TradeTypeId,COUNT(Trade.id) AS CountTrade", null, $conditions, "Trade.type_id", 0, 10, "Trade.type_id");
         foreach ($amount as $val) {
             $stats[$val['TradeTypeId']] = $val['CountTrade'];
         }
         setvar("UserTradeStat", $stats);
         setvar("ProductAmount", $product->findCount(null, $conditions, "Product.id"));
         break;
     default:
         break;
 }
 if ($do == "pro2offer" && !empty($_GET['productid'])) {
     $product = new products();
     $item = $product->read("*", $_GET['productid'], null, "member_id=" . $the_memberid);
     $item['country'] = "blank.gif";
     $trade_types = $trade->GetArray("SELECT * FROM " . $tb_prefix . "tradetypes");
     foreach ($trade_types as $key => $val) {
Ejemplo n.º 2
0
        $last_insert_key = "{$tb_prefix}trades_id";
        $id = $trade->{$last_insert_key};
    }
    if (!$updated) {
        flash();
    } else {
        if ($_PB_CACHE['setting']['keyword_bidding']) {
            $keyword->setIds($vals['title'] . $vals['content'], 'trades', true, $id);
        }
        flash("success", "offer.php?do=search&page=" . $_REQUEST['page'] . "&type_id=" . $vals['type_id']);
    }
}
setvar("CheckStatus", explode(",", L('product_status', 'tpl')));
$amount = $trade->findCount(null, $conditions, "Trade.id");
$page->setPagenav($amount);
$fields = "Trade.member_id,m.username,Trade.company_id,Trade.type_id,Trade.status,Trade.id,Trade.title,Trade.clicked,Trade.if_urgent,Trade.submit_time AS pubdate,Trade.submit_time,Trade.expire_time AS expdate,Trade.expire_time,Trade.picture as TradePicture,require_point,require_membertype,ip_addr as IP,Trade.if_commend";
$joins[] = "LEFT JOIN {$tb_prefix}members m ON m.id=Trade.member_id";
$result = $trade->findAll($fields, $joins, $conditions, "Trade.id DESC", $page->firstcount, $page->displaypg);
if (!empty($result)) {
    for ($i = 0; $i < count($result); $i++) {
        $result[$i]['pubdate'] = df($result[$i]['pubdate']);
        $result[$i]['expdate'] = df($result[$i]['expdate']);
        if ($result[$i]['expire_time'] < $time_stamp) {
            $result[$i]['if_expire'] = L("has_expired", "tpl");
        }
    }
    setvar("Items", $result);
}
setvar("ByPages", $page->getPagenav());
setvar("TradeNames", $trade_controller->getTradeTypeNames());
template($tpl_file);