Ejemplo n.º 1
0
 function get_list($condition = '1', $order = 'addtime DESC')
 {
     global $pages, $page, $pagesize, $offset, $pagesize, $MOD, $item, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $item = $r['num'];
     }
     $pages = pages($item, $page, $pagesize);
     $lists = $pids = $P = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         $r['linkurl'] = $MOD['linkurl'] . rewrite('price.php?itemid=' . $r['pid']);
         $pids[$r['pid']] = $r['pid'];
         $lists[] = $r;
     }
     if ($pids) {
         $result = $this->db->query("SELECT * FROM {$this->table_product} WHERE itemid IN (" . implode(',', $pids) . ")");
         while ($r = $this->db->fetch_array($result)) {
             $P[$r['itemid']] = $r;
         }
         if ($P) {
             foreach ($lists as $k => $v) {
                 $lists[$k]['unit'] = $P[$v['pid']]['unit'];
                 $lists[$k]['alt'] = $P[$v['pid']]['title'];
                 $lists[$k]['title'] = set_style($P[$v['pid']]['title'], $P[$v['pid']]['style']);
             }
         }
     }
     return $lists;
 }
Ejemplo n.º 2
0
 function get_list($condition, $order = 'listorder ASC,itemid ASC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         if ($r['areaid']) {
             $r['address'] = area_pos($r['areaid'], '') . $r['address'];
         }
         $lists[] = $r;
     }
     return $lists;
 }
Ejemplo n.º 3
0
 function get_list($condition = '1', $order = 'listorder DESC, itemid DESC')
 {
     global $MODULE, $MOD, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     $GROUP = cache_read('group.php');
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['thumb'] = is_file(DT_ROOT . '/' . $MODULE[4]['moduledir'] . '/skin/' . $r['skin'] . '/thumb.gif') ? $MODULE[4]['linkurl'] . 'skin/' . $r['skin'] . '/thumb.gif' : $MODULE[4]['linkurl'] . 'image/nothumb.gif';
         $groupid = explode(',', substr($r['groupid'], 1, -1));
         $group = array();
         foreach ($groupid as $gid) {
             $group[] = $GROUP[$gid]['groupname'];
         }
         $r['group'] = implode('<br/>', $group);
         $lists[] = $r;
     }
     return $lists;
 }
Ejemplo n.º 4
0
 function get_list($condition = 'status=3', $order = 'addtime DESC', $cache = '')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $items, $TYPE, $special, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}", $cache);
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}", $cache);
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         $r['alt'] = $r['title'];
         $r['title'] = set_style($r['title'], $r['style']);
         $r['type'] = $r['typeid'] && isset($TYPE[$r['typeid']]) ? set_style($TYPE[$r['typeid']]['typename'], $TYPE[$r['typeid']]['style']) : '';
         $r['typeurl'] = $r['type'] ? rewrite($MOD['linkurl'] . 'type.php?tid=' . $r['typeid']) : '';
         $lists[] = $r;
     }
     return $lists;
 }
Ejemplo n.º 5
0
 function get_list($condition = 'status=3', $order = 'itemid DESC')
 {
     global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $items, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = $groupids = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $groupids[$r['gid']] = $r['gid'];
         $lists[] = $r;
     }
     if ($groupids) {
         $GRPS = array();
         $result = $this->db->query("SELECT itemid,title,linkurl FROM {$this->db->pre}club_group WHERE itemid IN (" . implode(',', $groupids) . ")");
         while ($r = $this->db->fetch_array($result)) {
             $GRPS[$r['itemid']] = $r;
         }
         if ($GRPS) {
             foreach ($lists as $k => $v) {
                 $lists[$k]['groupname'] = $v['gid'] ? $GRPS[$v['gid']]['title'] : '';
                 $lists[$k]['groupurl'] = $v['gid'] ? $MOD['linkurl'] . $GRPS[$v['gid']]['linkurl'] : '';
             }
         }
     }
     return $lists;
 }
Ejemplo n.º 6
0
 function get_list($condition = 'status=3', $order = 'itemid DESC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $items, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         if (strpos($r['content'], '<hr class="club_break" />') !== false) {
             $r['content'] = substr($r['content'], strpos($r['content'], '<hr class="club_break" />'));
         }
         $r['title'] = get_intro($r['content'], 50);
         $r['alt'] = get_intro($r['content'], 500);
         $r['linkurl'] = $MOD['linkurl'] . 'goto.php?itemid=' . $r['itemid'];
         $lists[] = $r;
     }
     return $lists;
 }
Ejemplo n.º 7
0
 function get_list($condition = '1', $order = 'addtime DESC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         $r['title'] = set_style($r['title'], $r['style']);
         $r['linkurl'] = $MOD['linkurl'] . rewrite('expert.php?itemid=' . $r['itemid']);
         $r['rate'] = $r['answer'] && $r['best'] < $r['answer'] ? dround($r['best'] * 100 / $r['answer'], 2, true) . '%' : '100%';
         $lists[] = $r;
     }
     return $lists;
 }
Ejemplo n.º 8
0
 function get_list($condition = '1', $order = 'listorder DESC, itemid DESC')
 {
     global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['title'] = set_style($r['title'], $r['style']);
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         $r['typename'] = $TYPE[$r['typeid']]['typename'];
         $r['typeurl'] = $MOD['link_url'] . list_url($r['typeid']);
         $lists[] = $r;
     }
     return $lists;
 }
Ejemplo n.º 9
0
 function get_list($condition = 'status=3', $order = 'itemid DESC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['content'] = nl2br($r['content']);
         $r['editdate'] = '--';
         if ($r['reply']) {
             $r['reply'] = nl2br($r['reply']);
             $r['editdate'] = timetodate($r['edittime'], 5);
         }
         $lists[] = $r;
     }
     return $lists;
 }
Ejemplo n.º 10
0
function nexttime($schedule, $time)
{
    if (strpos($schedule, ',') !== false) {
        list($h, $m) = explode(',', $schedule);
        $t = strtotime(timetodate($time, 3) . ' ' . ($h < 10 ? '0' . $h : $h) . ':' . ($m < 10 ? '0' . $m : $m) . ':00');
        return $t > $time ? $t : $t + 86400;
    } else {
        $m = intval($schedule);
        return $time + ($m ? $m : 1800) * 60;
    }
}
Ejemplo n.º 11
0
 function get_list($condition, $order = 'itemid DESC')
 {
     global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $items, $sum, $L;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = $groupids = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         if ($r['typeid'] == 1) {
             $r['linkurl'] = "javascript:alert('" . $L['manage_has_del'] . "');";
         } else {
             $r['linkurl'] = $r['tid'] ? DT_PATH . 'api/redirect.php?mid=' . $MOD['moduleid'] . '&itemid=' . $r['tid'] : $MOD['linkurl'] . 'goto.php?itemid=' . $r['rid'];
         }
         $r['value'] = '';
         if ($r['typeid'] == 3) {
             $r['value'] = $r['content'] ? $L['manage_level'] . $r['content'] : $L['manage_cancel'];
         } else {
             if ($r['typeid'] == 4) {
                 $r['value'] = $r['content'] ? $r['content'] == 1 ? $L['manage_ontop_1'] : $L['manage_ontop_2'] : $L['manage_cancel'];
             } else {
                 if ($r['typeid'] == 5) {
                     $r['value'] = $r['content'] ? '<div style="width:10px;height:10px;line-height:10px;background:' . $r['content'] . ';">&nbsp;</div>' : $L['manage_cancel'];
                 }
             }
         }
         $groupids[$r['gid']] = $r['gid'];
         $lists[] = $r;
     }
     if ($groupids) {
         $GRPS = array();
         $result = $this->db->query("SELECT itemid,title,linkurl FROM {$this->db->pre}club_group WHERE itemid IN (" . implode(',', $groupids) . ")");
         while ($r = $this->db->fetch_array($result)) {
             $GRPS[$r['itemid']] = $r;
         }
         if ($GRPS) {
             foreach ($lists as $k => $v) {
                 $lists[$k]['groupname'] = $v['gid'] ? $GRPS[$v['gid']]['title'] : '';
                 $lists[$k]['groupurl'] = $v['gid'] ? $MOD['linkurl'] . $GRPS[$v['gid']]['linkurl'] : '';
             }
         }
     }
     return $lists;
 }
Ejemplo n.º 12
0
 function get_list($condition, $order = 'listorder ASC,itemid ASC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $nums;
     $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
     $nums = $r['num'];
     $pages = pages($nums, $page, $pagesize);
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $lists[] = $r;
     }
     return $lists;
 }
Ejemplo n.º 13
0
 function get_list($condition = 'status=3', $order = 'itemid DESC')
 {
     global $TYPE, $pages, $page, $pagesize, $offset, $L, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['dcompany'] = set_style($r['company'], $r['style']);
         $r['type'] = $r['typeid'] && isset($TYPE[$r['typeid']]) ? set_style($TYPE[$r['typeid']]['typename'], $TYPE[$r['typeid']]['style']) : $L['default_type'];
         $lists[] = $r;
     }
     return $lists;
 }
Ejemplo n.º 14
0
 function feedback($r)
 {
     global $DT_TIME, $L;
     $r or $r = $this->get_one();
     $message = array();
     $message['typeid'] = 0;
     $message['touser'] = $r['fromuser'];
     $message['title'] = lang($L['message_feedback_title'], array(dsubstr($r['title'], 20, '...')));
     $message['content'] = lang($L['message_feedback_content'], array($this->username, timetodate($DT_TIME, 5), $r['title'], timetodate($r['addtime'], 5), $r['content']));
     $this->send($message);
 }
Ejemplo n.º 15
0
 }
 if ($submit) {
     if ($item['islink']) {
         $post['islink'] = 1;
     } else {
         if (isset($post['islink'])) {
             unset($post['islink']);
         }
     }
     //$post['clear_link'] = $MOD['clear_link'];
     if ($do->pass($post)) {
         $CAT = get_cat($post['catid']);
         if (!$CAT || !check_group($_groupid, $CAT['group_add'])) {
             dalert(lang($L['group_add'], array($CAT['catname'])));
         }
         $post['addtime'] = timetodate($item['addtime']);
         $post['level'] = $item['level'];
         $post['fee'] = $item['fee'];
         $post['style'] = $item['style'];
         $post['template'] = $item['template'];
         $post['filepath'] = $item['filepath'];
         $post['note'] = $item['note'];
         $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add'];
         $post['status'] = get_status($item['status'], $need_check);
         $post['hits'] = $item['hits'];
         $post['save_remotepic'] = $MOD['save_remotepic'] ? 1 : 0;
         $post['clear_link'] = $MOD['clear_link'] ? 1 : 0;
         $post['get_introduce'] = $MOD['get_introduce'] ? 1 : 0;
         $post['introduce_length'] = $MOD['introduce_length'] ? $MOD['introduce_length'] : 0;
         if ($FD) {
             fields_check($post_fields);
Ejemplo n.º 16
0
 function get_list($condition = '1', $order = 'addtime DESC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = $catids = $CATS = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         $r['alt'] = $r['title'];
         $r['title'] = set_style($r['title'], $r['style']);
         $r['linkurl'] = $MOD['linkurl'] . $r['linkurl'];
         $catids[$r['catid']] = $r['catid'];
         $lists[] = $r;
     }
     if ($catids) {
         $result = $this->db->query("SELECT catid,catname,linkurl FROM {$this->db->pre}category WHERE catid IN (" . implode(',', $catids) . ")");
         while ($r = $this->db->fetch_array($result)) {
             $CATS[$r['catid']] = $r;
         }
         if ($CATS) {
             foreach ($lists as $k => $v) {
                 $lists[$k]['catname'] = $v['catid'] ? $CATS[$v['catid']]['catname'] : '';
                 $lists[$k]['caturl'] = $v['catid'] ? $MOD['linkurl'] . $CATS[$v['catid']]['linkurl'] : '';
             }
         }
     }
     return $lists;
 }
Ejemplo n.º 17
0
    default:
        $typeid = isset($typeid) ? $typeid === '' ? -1 : intval($typeid) : -1;
        $type_select = type_select($TYPE, 1, 'typeid', '请选择分类', $typeid);
        $condition = '1';
        if ($keyword) {
            $condition .= " AND title LIKE '%{$keyword}%'";
        }
        if ($typeid > 0) {
            $condition .= " AND typeid={$typeid}";
        }
        if ($page > 1 && $sum) {
            $items = $sum;
        } else {
            $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}mail WHERE {$condition}");
            $items = $r['num'];
        }
        $pages = pages($items, $page, $pagesize);
        $mails = array();
        $result = $db->query("SELECT * FROM {$DT_PRE}mail WHERE {$condition} ORDER BY itemid DESC LIMIT {$offset},{$pagesize}");
        while ($r = $db->fetch_array($result)) {
            $r['addtime'] = timetodate($r['addtime'], 5);
            $r['edittime'] = timetodate($r['edittime'], 5);
            $r['sendtime'] = $r['sendtime'] ? timetodate($r['sendtime'], 5) : '<span style="color:red;">未发送</span>';
            $r['type'] = $r['typeid'] && isset($TYPE[$r['typeid']]) ? set_style($TYPE[$r['typeid']]['typename'], $TYPE[$r['typeid']]['style']) : '<span style="color:red;">未分类</span>';
            $num = $db->get_one("SELECT count(itemid) as num FROM {$DT_PRE}mail_list WHERE typeids LIKE '%," . $r['typeid'] . ",%' ");
            $r['num'] = $num['num'];
            $mails[] = $r;
        }
        include tpl('mail', $module);
        break;
}
Ejemplo n.º 18
0
if (is_array($tags)) {
    foreach ($tags as $i => $t) {
        ?>
<li><?php 
        if ($datetype) {
            ?>
<span class="f_r"><?php 
            if ($showpage) {
                echo $t['filesize'];
                ?>
 <?php 
                echo $t['unit'];
                ?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php 
            }
            echo timetodate($t['addtime'], $datetype);
            ?>
</span><?php 
        }
        ?>
<img src="<?php 
        echo DT_PATH;
        ?>
file/ext/<?php 
        echo $t['fileext'];
        ?>
.gif" align="absmiddle"/> <a href="<?php 
        echo $t['linkurl'];
        ?>
" target="_blank" title="<?php 
        echo $t['alt'];
Ejemplo n.º 19
0
    }
    unset($item['template']);
    extract($item);
    $CAT = get_cat($catid);
    $content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data);
    $t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid={$itemid}");
    $content = $t['content'];
    $CP = $MOD['cat_property'] && $CAT['property'];
    if ($CP) {
        require DT_ROOT . '/include/property.func.php';
        $options = property_option($catid);
        $values = property_value($moduleid, $itemid);
    }
    $adddate = timetodate($addtime, 5);
    $editdate = timetodate($edittime, 5);
    $todate = $totime ? timetodate($totime, 3) : 0;
    $expired = $totime && $totime < $DT_TIME ? true : false;
    $linkurl = $MOD['linkurl'] . $linkurl;
    $thumbs = get_albums($item);
    $albums = get_albums($item, 1);
    $album_js = 1;
    $update = '';
    include DT_ROOT . '/include/update.inc.php';
    $head_canonical = $linkurl;
    $head_title = $title . $DT['seo_delimiter'] . $head_title;
    $head_keywords = $keyword;
    $head_description = $introduce ? $introduce : $title;
    if ($EXT['mobile_enable']) {
        $head_mobile = $EXT['mobile_url'] . mobileurl($moduleid, 0, $itemid, $page);
    }
} else {
Ejemplo n.º 20
0
 $trade_no = $_GET['trade_no'];
 //获取支付宝交易号
 $total_fee = $_GET['price'];
 //获取总价格
 $itemid = $out_trade_no;
 $td = $db->get_one("SELECT * FROM {$DT_PRE}mall_order WHERE itemid={$itemid}");
 $money = $td['amount'] + $td['fee'];
 if (!$td || $total_fee != $money) {
     message('金额不符(Code:002)', $MODULE[2]['linkurl'] . 'trade.php?error=2');
 }
 $seller = $td['seller'];
 $seller_email = $_GET['seller_email'];
 $buyer = $td['buyer'];
 $buyer_email = $_GET['buyer_email'];
 $mallid = $td['mallid'];
 $timenow = timetodate($DT_TIME, 3);
 $memberurl = $MODULE[2]['linkurl'];
 include load('member.lang');
 if ($_GET['trade_status'] == 'WAIT_SELLER_SEND_GOODS') {
     //判断该笔订单是否在商户网站中已经做过处理(可参考“集成教程”中“3.4返回数据处理”)
     //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
     //如果有做过处理,不执行商户的业务程序
     if ($td['status'] == 1) {
         $db->query("UPDATE {$DT_PRE}mall_order SET trade_no='{$trade_no}',status=2,updatetime={$DT_TIME} WHERE itemid={$itemid}");
         $db->query("UPDATE {$DT_PRE}member SET trade='{$seller_email}',vtrade=1 WHERE username='******' AND vtrade=0");
         $db->query("UPDATE {$DT_PRE}member SET trade='{$buyer_email}',vtrade=1 WHERE username='******' AND vtrade=0");
         $myurl = userurl($td['buyer']);
         $_username = $td['seller'];
         //send message
         $touser = $td['seller'];
         $title = lang($L['trade_message_t2'], array($itemid));
Ejemplo n.º 21
0
</a><?php 
    } else {
        ?>
不限<?php 
    }
    ?>
</td>
<td class="px11 f_gray"><?php 
    echo timetodate($v['addtime'], 5);
    ?>
</td>
<?php 
    if ($v['sendtime']) {
        ?>
<td class="px11 f_gray"><?php 
        echo timetodate($v['sendtime'], 5);
        ?>
</td>
<?php 
    } else {
        ?>
<td class="f_gray">从未</td>
<?php 
    }
    ?>
<td class="f_red"><?php 
    if ($v['rate']) {
        echo $v['rate'];
        ?>
天<?php 
    } else {
Ejemplo n.º 22
0
switch ($action) {
    case 'add':
        if ($submit) {
            if ($do->pass($post)) {
                $do->add($post);
                dmsg('添加成功', '?moduleid=' . $moduleid . '&file=' . $file . '&action=' . $action . '&typeid=' . $post['typeid']);
            } else {
                msg($do->errmsg);
            }
        } else {
            foreach ($do->fields as $v) {
                isset(${$v}) or ${$v} = '';
            }
            $linkurl = 'http://';
            $status = 3;
            $addtime = timetodate($DT_TIME);
            $menuid = 0;
            include tpl('link_edit', $module);
        }
        break;
    case 'edit':
        $itemid or msg();
        $do->itemid = $itemid;
        if ($submit) {
            if ($do->pass($post)) {
                $do->edit($post);
                dmsg('修改成功', $forward);
            } else {
                msg($do->errmsg);
            }
        } else {
Ejemplo n.º 23
0
     $condition = "status=3" . $condition;
 }
 $pagesize = $MOD['pagesize'];
 $offset = ($page - 1) * $pagesize;
 $items = $db->count($table, $condition, $DT['cache_search']);
 $pages = pages($items, $page, $pagesize);
 if ($items) {
     $order = $dorder[$order] ? " ORDER BY {$dorder[$order]}" : '';
     $result = $db->query("SELECT {$fds} FROM {$table} WHERE {$condition}{$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']);
     if ($kw) {
         $replacef = explode(' ', $kw);
         $replacet = array_map('highlight', $replacef);
     }
     while ($r = $db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         if ($lazy && isset($r['thumb']) && $r['thumb']) {
             $r['thumb'] = DT_SKIN . 'image/lazy.gif" original="' . $r['thumb'];
         }
         $r['alt'] = $r['title'];
         $r['title'] = set_style($r['title'], $r['style']);
         if ($kw) {
             $r['title'] = str_replace($replacef, $replacet, $r['title']);
         }
         if ($kw) {
             $r['introduce'] = str_replace($replacef, $replacet, $r['introduce']);
         }
         $r['linkurl'] = $MOD['linkurl'] . $r['linkurl'];
         $tags[] = $r;
     }
     $db->free_result($result);
Ejemplo n.º 24
0
 function clear()
 {
     @rename(DT_CACHE . '/php/', DT_CACHE . '/' . timetodate($this->time, 'YmdHis') . '.tmp/');
 }
Ejemplo n.º 25
0
             }
             if ($FD) {
                 fields_update($post_fields, $table, $do->itemid);
             }
             if ($CP) {
                 property_update($post_ppt, $moduleid, $post['catid'], $do->itemid);
             }
             $do->edit($post);
             dmsg('修改成功', $forward);
         } else {
             msg($do->errmsg);
         }
     } else {
         $item = $do->get_one();
         extract($item);
         $addtime = timetodate($addtime);
         $menuon = array('4', '3', '2', '1');
         $menuid = $menuon[$status];
         include tpl($action, $module);
     }
     break;
 case 'move':
     if ($submit) {
         $fromids or msg('请填写来源ID');
         if ($tocatid) {
             $db->query("UPDATE {$table} SET catid={$tocatid} WHERE `{$fromtype}` IN ({$fromids})");
             dmsg('移动成功', $forward);
         } else {
             msg('请选择目标分类');
         }
     } else {
Ejemplo n.º 26
0
     }
     if ($maxamount) {
         $condition .= " AND amount<={$maxamount}";
     }
     $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}finance_charge WHERE {$condition}");
     $pages = pages($r['num'], $page, $pagesize);
     $charges = array();
     $amount = $fee = $money = $repay = 0;
     $result = $db->query("SELECT * FROM {$DT_PRE}finance_charge WHERE {$condition} ORDER BY itemid DESC LIMIT {$offset},{$pagesize}");
     while ($r = $db->fetch_array($result)) {
         $r['repay'] = $r['status'] == 0 && $DT_TIME - $r['sendtime'] > 600 ? 1 : 0;
         if ($r['repay']) {
             $repay = 1;
         }
         $r['sendtime'] = timetodate($r['sendtime'], 5);
         $r['receivetime'] = $r['receivetime'] ? timetodate($r['receivetime'], 5) : '--';
         $r['dstatus'] = $_status[$r['status']];
         $amount += $r['amount'];
         $fee += $r['fee'];
         $money += $r['money'];
         $charges[] = $r;
     }
     $head_title = $L['charge_title_record'];
     break;
 case 'card':
     if ($submit) {
         if (!preg_match("/^[0-9a-zA-z]{6,}\$/", $number)) {
             message($L['charge_pass_card_number']);
         }
         if (!preg_match("/^[0-9]{6,}\$/", $password)) {
             message($L['charge_pass_card_password']);
Ejemplo n.º 27
0
extract($item);
$CAT = get_cat($catid);
$content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data);
$t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid={$itemid}");
$content = $t['content'];
if ($lazy) {
    $content = img_lazy($content);
}
$CP = $MOD['cat_property'] && $CAT['property'];
if ($CP) {
    require_once DT_ROOT . '/include/property.func.php';
    $options = property_option($catid);
    $values = property_value($moduleid, $itemid);
}
$adddate = timetodate($addtime, 3);
$editdate = timetodate($edittime, 3);
if ($voteid) {
    $voteid = explode(' ', $voteid);
}
if ($fromurl) {
    $fromurl = fix_link($fromurl);
}
$fileurl = $linkurl;
$linkurl = $MOD['linkurl'] . $linkurl;
$titles = array();
if ($subtitle) {
    $titles = explode("\n", $subtitle);
    $titles = array_map('trim', $titles);
}
$keytags = $tag ? explode(' ', $tag) : array();
$fee = get_fee($item['fee'], $MOD['fee_view']);
Ejemplo n.º 28
0
             if ($FD) {
                 fields_update($post_fields, $table, $do->itemid);
             }
             if ($CP) {
                 property_update($post_ppt, $moduleid, $post['catid'], $do->itemid);
             }
             $do->edit($post);
             dmsg('修改成功', $forward);
         } else {
             msg($do->errmsg);
         }
     } else {
         $item = $do->get_one();
         extract($item);
         $addtime = timetodate($addtime);
         $totime = $totime ? timetodate($totime, 3) : '';
         $menuon = array('5', '4', '2', '1', '3');
         $menuid = $menuon[$status];
         include tpl($action, $module);
     }
     break;
 case 'move':
     if ($submit) {
         $fromids or msg('请填写来源ID');
         if ($tocatid) {
             $db->query("UPDATE {$table} SET catid={$tocatid} WHERE `{$fromtype}` IN ({$fromids})");
             dmsg('移动成功', $forward);
         } else {
             msg('请选择目标分类');
         }
     } else {
Ejemplo n.º 29
0
     $itemid or msg();
     $do->itemid = $itemid;
     if ($submit) {
         if ($do->edit($post)) {
             dmsg('操作成功', $forward);
         } else {
             msg($do->errmsg);
         }
     } else {
         extract($do->get_one());
         $user = $username ? userinfo($username) : array();
         $addtime = timetodate($addtime);
         $edittime = timetodate($edittime);
         $fromtime = timetodate($DT_TIME, 3);
         $days = $promo_amount && $promo_type == 1 ? $promo_amount : 365;
         $totime = timetodate($DT_TIME + 86400 * $days);
         $UG = cache_read('group-' . $groupid . '.php');
         $fee = $UG['fee'];
         $pay = $fee - $amount;
         if ($promo_amount) {
             $pay = $promo_type == 1 ? 0 : $pay - $promo_amount;
         }
         include tpl('grade_edit', $module);
     }
     break;
 case 'delete':
     $itemid or msg('请选择记录');
     $do->delete($itemid);
     dmsg('删除成功', $forward);
     break;
 case 'reject':
Ejemplo n.º 30
0
        if ($keyword) {
            $condition .= " AND {$dfields[$fields]} LIKE '%{$keyword}%'";
        }
        if ($fromtime) {
            $condition .= " AND addtime>" . strtotime($fromtime . ' 00:00:00');
        }
        if ($totime) {
            $condition .= " AND addtime<" . strtotime($totime . ' 23:59:59');
        }
        if ($action) {
            $condition .= " AND type='{$action}'";
        }
        if ($status) {
            $condition .= " AND status={$status}";
        }
        if ($page > 1 && $sum) {
            $items = $sum;
        } else {
            $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$condition}");
            $items = $r['num'];
        }
        $pages = pages($items, $page, $pagesize);
        $lists = array();
        $result = $db->query("SELECT * FROM {$table} WHERE {$condition} ORDER BY itemid DESC LIMIT {$offset},{$pagesize}");
        while ($r = $db->fetch_array($result)) {
            $r['addtime'] = timetodate($r['addtime'], 5);
            $lists[] = $r;
        }
        include tpl('validate', $module);
        break;
}