Exemplo n.º 1
0
<?php

defined('DT_ADMIN') or exit('Access Denied');
$pid = isset($pid) ? intval($pid) : 0;
$menus = array(array('添加报价', '?file=' . $file . '&moduleid=' . $moduleid . '&pid=' . $pid . '&action=add'), array('报价管理', '?file=' . $file . '&moduleid=' . $moduleid . '&pid=' . $pid), array('报价审核', '?file=' . $file . '&moduleid=' . $moduleid . '&pid=' . $pid . '&action=check'));
$P = $pid ? $db->get_one("SELECT * FROM {$table_product} WHERE itemid={$pid}") : array();
$M = $P && $P['market'] ? explode('|', '所属市场|' . $P['market']) : array();
require MD_ROOT . '/price.class.php';
$do = new price();
if (in_array($action, array('', 'check'))) {
    $sfields = array('公司', '会员', 'IP', '电话', 'QQ', '编辑', '备注');
    $dfields = array('company', 'username', 'ip', 'telephone', 'qq', 'editor', 'note');
    $sorder = array('结果排序方式', '添加时间降序', '添加时间升序', '更新时间降序', '更新时间升序', '报价降序', '报价升序');
    $dorder = array('addtime DESC', 'addtime DESC', 'addtime ASC', 'edittime DESC', 'edittime ASC', 'price DESC', 'price ASC');
    isset($fields) && isset($dfields[$fields]) or $fields = 0;
    isset($order) && isset($dorder[$order]) or $order = 0;
    $itemid or $itemid = '';
    $market = isset($market) ? intval($market) : 0;
    $minprice = isset($minprice) ? dround($minprice) : '';
    $minprice or $minprice = '';
    $maxprice = isset($maxprice) ? dround($maxprice) : '';
    $maxprice or $maxprice = '';
    $fields_select = dselect($sfields, 'fields', '', $fields);
    $order_select = dselect($sorder, 'order', '', $order);
    $condition = '';
    if ($keyword) {
        $condition .= " AND {$dfields[$fields]} LIKE '%{$keyword}%'";
    }
    if ($areaid) {
        $condition .= $ARE['child'] ? " AND areaid IN (" . $ARE['arrchildid'] . ")" : " AND areaid={$areaid}";
    }
Exemplo n.º 2
0
            dalert($L['msg_added']);
        }
        $msg = captcha($captcha, $need_captcha, true);
        if ($msg) {
            dalert($msg);
        }
        $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add'];
        $post['addtime'] = 0;
        $post['status'] = get_status(3, $need_check);
        $post['pid'] = $itemid;
        $post['username'] = $_username;
        if ($_userid) {
            $post['company'] = $_company;
        }
        require DT_ROOT . '/module/' . $module . '/price.class.php';
        $do = new price();
        if ($do->pass($post)) {
            $do->add($post);
            $msg = $post['status'] == 2 ? $L['msg_check'] : $L['msg_ok'];
            dalert($msg, '', 'parent.window.location=parent.window.location;');
        } else {
            dalert($do->errmsg, '', ($need_captcha ? reload_captcha() : '') . ($need_question ? reload_question() : ''));
        }
    }
}
isset($ms) or $ms = array();
$market = isset($market) ? intval($market) : 0;
$areaid = isset($areaid) ? intval($areaid) : 0;
$fromdate = isset($fromdate) && is_date($fromdate) ? $fromdate : '';
$fromtime = $fromdate ? strtotime($fromdate . ' 0:0:0') : 0;
$todate = isset($todate) && is_date($todate) ? $todate : '';