Exemplo n.º 1
0
     $all ? msg($MOD['name'] . '生成成功', $this_forward) : dmsg($MOD['name'] . '生成成功', $this_forward);
 }
 $catid = isset($catid) ? intval($catid) : '';
 $sql = $catid ? " AND catid={$catid}" : '';
 if (!isset($fid)) {
     $r = $db->get_one("SELECT min(itemid) AS fid FROM {$table} WHERE status>2 {$sql}");
     $fid = $r['fid'] ? $r['fid'] : 0;
 }
 isset($sid) or $sid = $fid;
 if (!isset($tid)) {
     $r = $db->get_one("SELECT max(itemid) AS tid FROM {$table} WHERE status>2 {$sql}");
     $tid = $r['tid'] ? $r['tid'] : 0;
 }
 if ($update) {
     require MD_ROOT . '/mall.class.php';
     $do = new mall($moduleid);
 }
 isset($num) or $num = 100;
 if ($fid <= $tid) {
     $result = $db->query("SELECT itemid FROM {$table} WHERE status>2 AND itemid>={$fid} {$sql} ORDER BY itemid LIMIT 0,{$num} ");
     if ($db->affected_rows($result)) {
         while ($r = $db->fetch_array($result)) {
             $itemid = $r['itemid'];
             $update ? $do->update($itemid) : tohtml('show', $module);
         }
         $itemid += 1;
     } else {
         $itemid = $fid + $num;
     }
 } else {
     if ($update) {
Exemplo n.º 2
0
<?php

defined('DT_ADMIN') or exit('Access Denied');
require MD_ROOT . '/mall.class.php';
$do = new mall($moduleid);
$menus = array(array('添加商品', '?moduleid=' . $moduleid . '&action=add'), array('商品列表', '?moduleid=' . $moduleid), array('审核商品', '?moduleid=' . $moduleid . '&action=check'), array('下架商品', '?moduleid=' . $moduleid . '&action=expire'), array('未通过商品', '?moduleid=' . $moduleid . '&action=reject'), array('回收站', '?moduleid=' . $moduleid . '&action=recycle'), array('移动分类', '?moduleid=' . $moduleid . '&action=move'));
if (in_array($action, array('add', 'edit'))) {
    $FD = cache_read('fields-' . substr($table, strlen($DT_PRE)) . '.php');
    if ($FD) {
        require DT_ROOT . '/include/fields.func.php';
    }
    isset($post_fields) or $post_fields = array();
    $CP = $MOD['cat_property'];
    if ($CP) {
        require DT_ROOT . '/include/property.func.php';
    }
    isset($post_ppt) or $post_ppt = array();
}
if ($_catids || $_areaids) {
    require DT_ROOT . '/admin/admin_check.inc.php';
}
if (in_array($action, array('', 'check', 'expire', 'reject', 'recycle'))) {
    $sfields = array('模糊', '商品名称', '商品品牌', '简介', '计量单位', '关联名称', '公司名', '联系人', '联系电话', '联系地址', '电子邮件', '联系MSN', '联系QQ', '会员名', '编辑', 'IP', '属性名1', '属性名2', '属性名3', '属性值1', '属性值2', '属性值3', '快递1', '快递2', '快递3', '文件路径', '内容模板');
    $dfields = array('keyword', 'title', 'brand', 'introduce', 'unit', 'relate_name', 'company', 'truename', 'telephone', 'address', 'email', 'msn', 'qq', 'username', 'editor', 'ip', 'n1', 'n2', 'n3', 'v1', 'v2', 'v3', 'express_name_1', 'express_name_2', 'express_name_3', 'filepath', 'template');
    $sorder = array('结果排序方式', '更新时间降序', '更新时间升序', '添加时间降序', '添加时间升序', VIP . '级别降序', VIP . '级别升序', '商品单价降序', '商品单价升序', '订单数量降序', '订单数量升序', '销售数量降序', '销售数量升序', '库存总量降序', '库存总量升序', '评论次数降序', '评论次数升序', '浏览人气降序', '浏览人气升序', '信息ID降序', '信息ID升序');
    $dorder = array($MOD['order'], 'edittime DESC', 'edittime ASC', 'addtime DESC', 'addtime ASC', 'vip DESC', 'vip ASC', 'price DESC', 'price DESC', 'orders DESC', 'orders ASC', 'sales DESC', 'sales ASC', 'amount DESC', 'amount ASC', 'comments DESC', 'comments ASC', 'hits DESC', 'hits ASC', 'itemid DESC', 'itemid ASC');
    $level = isset($level) ? intval($level) : 0;
    isset($fields) && isset($dfields[$fields]) or $fields = 0;
    isset($order) && isset($dorder[$order]) or $order = 0;
    $elite = isset($elite) ? intval($elite) : 0;
    $cod = isset($cod) ? intval($cod) : 0;
Exemplo n.º 3
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
login();
require DT_ROOT . '/module/' . $module . '/common.inc.php';
$MG['mall_limit'] > -1 or dalert(lang('message->without_permission_and_upgrade'), 'goback');
$MTYPE = get_type('mall-' . $_userid);
require DT_ROOT . '/include/post.func.php';
include load($module . '.lang');
include load('my.lang');
require MD_ROOT . '/mall.class.php';
$do = new mall($moduleid);
if (in_array($action, array('add', 'edit'))) {
    $FD = cache_read('fields-' . substr($table, strlen($DT_PRE)) . '.php');
    if ($FD) {
        require DT_ROOT . '/include/fields.func.php';
    }
    isset($post_fields) or $post_fields = array();
    $CP = $MOD['cat_property'];
    if ($CP) {
        require DT_ROOT . '/include/property.func.php';
    }
    isset($post_ppt) or $post_ppt = array();
}
$sql = $_userid ? "username='******'" : "ip='{$DT_IP}'";
$limit_used = $limit_free = $need_password = $need_captcha = $need_question = $fee_add = 0;
if (in_array($action, array('', 'add'))) {
    $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$sql} AND status>1");
    $limit_used = $r['num'];
    $limit_free = $MG['mall_limit'] > $limit_used ? $MG['mall_limit'] - $limit_used : 0;
}