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) { if ($val['parent_id'] == 0) { $set_types[$val['id']] = $val; foreach ($trade_types as $key1 => $val1) { if ($val1['parent_id'] == $val['id']) { $set_types[$val['id']]['child'][$val1['id']] = $val1; } } } } setvar("select_tradetypes", $set_types); if (!empty($item)) { unset($item['id']);
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=" . $_SESSION['MemberID']); if (!empty($item)) { $item['type_id'] = 2; $item['title'] = $item['name']; if (isset($item['picture'])) { $item['image'] = pb_get_attachmenturl($item['picture'], "../"); } setvar("item", $item); } $tpl_file = "offer_edit"; template($tpl_file); exit; } if ($do == "update" && !empty($id)) { $vals = array(); $vals['modified'] = $time_stamp;