$vals['expire_days'] = 10; $vals['expire_time'] = $time_stamp + 24 * 3600 * $vals['expire_days']; $conditions[] = "status='1'"; $ids = implode(",", $_POST['tradeid']); $conditions[] = "id in (" . $ids . ")"; $condition = implode(" AND ", $conditions); $sql = "update " . $trade->getTable() . " set submit_time=" . $time_stamp . ",expire_days=10,expire_time=" . $vals['expire_time'] . " where " . $condition; $result = $pdb->Execute($sql); if ($result) { flash("success"); } else { flash("action_failed"); } } } $amount = 0; $amount = $trade->findCount(null, $conditions); $page->setPagenav($amount); $result = $trade->findAll("*", null, $conditions, "Trade.submit_time DESC,Trade.id DESC", $page->firstcount, $page->displaypg); if (!empty($result)) { for ($i = 0; $i < count($result); $i++) { $result[$i]['expire_date'] = df($result[$i]['expire_time']); } setvar("Items", $result); } uaAssign(array("ByPages" => $page->getPagenav())); setvar("OFFER_MODERATE_POINT", $_PB_CACHE['setting']['offer_moderate_point']); setvar("CheckStatus", $typeoption->get_cache_type("check_status")); setvar("Amount", $amount); setvar("TimeStamp", $time_stamp); template($tpl_file);
template($tpl_file); exit; } if ($do == "search" && !empty($_GET['q'])) { $conditions[] = "Tag.name like '%" . trim($_GET['q']) . "%'"; } if ($do == "del" && !empty($id)) { $tag->del($id); } } if (isset($_POST['del']) && !empty($_POST['id'])) { $tag->del($_POST['id']); } if (isset($_POST['save']) && !empty($_POST['data']['tag'])) { if (isset($_POST['id'])) { $id = intval($_POST['id']); } if ($id) { $tag->save($_POST['data']['tag'], "update", $id); } else { $tag->save($_POST['data']['tag']); } } $amount = $tag->findCount(null, $conditions); $page = new Pages(); $page->setPagenav($amount); //$joins[] = "LEFT JOIN {$tb_prefix}members m ON m.id=Tag.member_id"; $result = $tag->findAll("Tag.*", $joins, $conditions, "Tag.id DESC ", $page->firstcount, $page->displaypg); setvar("Items", $result); setvar("ByPages", $page->getPagenav()); template($tpl_file);
} } if (($do == "del" || $_GET['act'] == "del") && !empty($id)) { $res = $product->read("id", $id); if ($res) { if (!$product->del($_GET['id'], $conditions)) { flash(); } } else { flash("data_not_exists"); } } } if (isset($_GET['typeid']) && !empty($_GET['typeid'])) { $conditions[] = "producttype_id = " . $_GET['typeid']; } $amount = $product->findCount(null, $conditions, "Product.id"); $page->setPagenav($amount); $result = $product->findAll("sort_id,id,name,picture,content,created,status,state", null, $conditions, "Product.id DESC", $page->firstcount, $page->displaypg); if ($result) { $i_count = count($result); for ($i = 0; $i < $i_count; $i++) { $result[$i]['image'] = pb_get_attachmenturl($result[$i]['picture'], '../', 'small'); } } setvar("Items", $result); setvar("nlink", $page->nextpage_link); setvar("plink", $page->previouspage_link); setvar("CheckStatus", explode(",", L('product_status', 'tpl'))); uaAssign(array("pagenav" => $page->getPagenav())); template($tpl_file);