Esempio n. 1
0
        $last_trade_id = $trade->getMaxId();
        $item_ids = $form->Add($last_trade_id, $_POST['data']['formitem']);
        if ($item_ids) {
            $pdb->Execute("UPDATE {$tb_prefix}trades SET formattribute_ids='{$item_ids}' WHERE id=" . $last_trade_id);
        }
        $tradefield_res['trade_id'] = $last_trade_id;
    }
    $tradefield->replace($tradefield_res);
    if (!$res) {
        flash("action_failed");
    } else {
        flash($msg ? $msg : "success");
    }
}
if (isset($_POST['del']) && !empty($_POST['tradeid'])) {
    $tRes = $trade->del($_POST['tradeid'], "member_id = " . $the_memberid);
    if ($tRes) {
        $pdb->Execute("DELETE from {$tb_prefix}tradefields WHERE trade_id IN (" . implode(",", $_POST['tradeid']) . ")");
    }
}
if (isset($_POST['refresh'])) {
    if (!empty($_POST['refresh']) && !empty($_POST['tradeid'])) {
        $vals = array();
        $pre_submittime = $pdb->GetOne("select max(submit_time) from {$tb_prefix}trades where member_id=" . $the_memberid);
        if ($pre_submittime > $time_stamp - $tMaxDay * 86400) {
            flash("allow_refresh_day");
        }
        $vals['submit_time'] = $time_stamp;
        $vals['expire_days'] = 10;
        $vals['expire_time'] = $time_stamp + 24 * 3600 * $vals['expire_days'];
        $conditions[] = "status='1'";
Esempio n. 2
0
        $last_trade_id = $trade->getMaxId();
        $item_ids = $form->Add($last_trade_id, $_POST['data']['formitem']);
        if ($item_ids) {
            $pdb->Execute("UPDATE {$tb_prefix}trades SET formattribute_ids='{$item_ids}' WHERE id=" . $last_trade_id);
        }
        $tradefield_res['trade_id'] = $last_trade_id;
    }
    $tradefield->replace($tradefield_res);
    if (!$res) {
        flash("action_failed");
    } else {
        flash($msg ? $msg : "success");
    }
}
if (isset($_POST['del']) && !empty($_POST['tradeid'])) {
    $tRes = $trade->del($_POST['tradeid'], "member_id = " . $_SESSION['MemberID']);
    if ($tRes) {
        $pdb->Execute("DELETE from {$tb_prefix}tradefields WHERE trade_id IN (" . implode(",", $_POST['tradeid']) . ")");
    }
}
if (isset($_POST['refresh'])) {
    if (!empty($_POST['refresh']) && !empty($_POST['tradeid'])) {
        $vals = array();
        $pre_submittime = $pdb->GetOne("select max(submit_time) from {$tb_prefix}trades where member_id=" . $_SESSION['MemberID']);
        if ($pre_submittime > $time_stamp - $tMaxDay * 86400) {
            flash("allow_refresh_day");
        }
        $vals['submit_time'] = $time_stamp;
        $vals['expire_days'] = 10;
        $vals['expire_time'] = $time_stamp + 24 * 3600 * $vals['expire_days'];
        $conditions[] = "status='1'";