コード例 #1
0
ファイル: mall.inc.php プロジェクト: hiproz/zhaotaoci.cc
 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);
 }
 require DT_ROOT . '/module/' . $module . '/global.func.php';
 $RL = $relate_id ? get_relate($item) : array();
 $P1 = get_nv($n1, $v1);
 $P2 = get_nv($n2, $v2);
 $P3 = get_nv($n3, $v3);
 if ($step) {
     extract(unserialize($step));
 } else {
     $a1 = 1;
     $p1 = $item['price'];
     $a2 = $a3 = $p2 = $p3 = '';
 }
 $unit or $unit = $L['unit'];
 $adddate = timetodate($addtime, 3);
 $editdate = timetodate($edittime, 3);
 $linkurl = $MOD['linkurl'] . $linkurl;
 $thumbs = get_albums($item);
 $albums = get_albums($item, 1);
 $album_js = 1;
 $amount = number_format($amount, 0, '.', '');
コード例 #2
0
ファイル: cart.inc.php プロジェクト: hcd2008/destoon
         $datas[$v1] = $t2;
     }
 }
 if ($_ids) {
     $itemids = implode(',', $_ids);
     $result = $db->query("SELECT * FROM {$table} WHERE itemid IN ({$itemids})");
     while ($r = $db->fetch_array($result)) {
         if ($r['username'] == $_username || $r['status'] != 3) {
             continue;
         }
         $r['alt'] = $r['title'];
         $r['title'] = dsubstr($r['title'], 40, '..');
         $r['linkurl'] = $MOD['linkurl'] . $r['linkurl'];
         $r['p1'] = get_nv($r['n1'], $r['v1']);
         $r['p2'] = get_nv($r['n2'], $r['v2']);
         $r['p3'] = get_nv($r['n3'], $r['v3']);
         $price += $r['price'];
         $total++;
         $_tags[$r['itemid']] = $r;
     }
     foreach ($datas as $k => $v) {
         if (isset($_tags[$v['itemid']])) {
             $t = $_tags[$v['itemid']];
             $t['key'] = $k;
             $t['s1'] = $v['s1'];
             $t['s2'] = $v['s2'];
             $t['s3'] = $v['s3'];
             $t['m1'] = isset($t['p1'][$t['s1']]) ? $t['p1'][$t['s1']] : '';
             $t['m2'] = isset($t['p2'][$t['s2']]) ? $t['p2'][$t['s2']] : '';
             $t['m3'] = isset($t['p3'][$t['s3']]) ? $t['p3'][$t['s3']] : '';
             $tags[] = $t;
コード例 #3
0
ファイル: cart.class.php プロジェクト: hiproz/zhaotaoci.cc
 function get_list($cart)
 {
     global $MOD, $table, $_username;
     $lists = $tags = $data = $_cart = array();
     $itemids = '';
     foreach ($cart as $k => $v) {
         $t = array_map('intval', explode('-', $k));
         $itemids .= ',' . $t[0];
         $r = array();
         $r['itemid'] = $t[0];
         $r['s1'] = $t[1];
         $r['s2'] = $t[2];
         $r['s3'] = $t[3];
         $r['a'] = $v;
         $data[$k] = $r;
     }
     if ($itemids) {
         $itemids = substr($itemids, 1);
         $result = $this->db->query("SELECT * FROM {$table} WHERE itemid IN ({$itemids})");
         while ($r = $this->db->fetch_array($result)) {
             if ($r['username'] == $_username || $r['status'] != 3) {
                 continue;
             }
             $r['alt'] = $r['title'];
             $r['title'] = dsubstr($r['title'], 40, '..');
             $r['linkurl'] = $MOD['linkurl'] . $r['linkurl'];
             $r['P1'] = get_nv($r['n1'], $r['v1']);
             $r['P2'] = get_nv($r['n2'], $r['v2']);
             $r['P3'] = get_nv($r['n3'], $r['v3']);
             if ($r['step']) {
                 $s = unserialize($r['step']);
                 foreach (unserialize($r['step']) as $k => $v) {
                     $r[$k] = $v;
                 }
             } else {
                 $r['a1'] = 1;
                 $r['p1'] = $r['price'];
                 $r['a2'] = $r['a3'] = 0;
                 $r['p2'] = $r['p3'] = 0.0;
             }
             $tags[$r['itemid']] = $r;
         }
         if ($tags) {
             foreach ($data as $k => $v) {
                 if (isset($tags[$v['itemid']])) {
                     $r = $tags[$v['itemid']];
                     $r['key'] = $k;
                     $r['s1'] = $v['s1'];
                     $r['s2'] = $v['s2'];
                     $r['s3'] = $v['s3'];
                     $r['a'] = $v['a'];
                     if ($r['a'] > $r['amount']) {
                         $r['a'] = $r['amount'];
                     }
                     if ($r['a'] < $r['a1']) {
                         $r['a'] = $r['a1'];
                     }
                     $r['price'] = get_price($r['a'], $r['price'], $r['step']);
                     $r['m1'] = isset($r['P1'][$r['s1']]) ? $r['P1'][$r['s1']] : '';
                     $r['m2'] = isset($r['P2'][$r['s2']]) ? $r['P2'][$r['s2']] : '';
                     $r['m3'] = isset($r['P3'][$r['s3']]) ? $r['P3'][$r['s3']] : '';
                     $_cart[$k] = $r['a'];
                     $lists[] = $r;
                 }
             }
         }
     }
     if (count($_cart) != count($cart) || count($_cart) != get_cookie('cart')) {
         $this->set($_cart);
     }
     return $lists;
 }
コード例 #4
0
ファイル: cart.php プロジェクト: hiproz/zhaotaoci.cc
 if ($number < $t['a1']) {
     $number = $t['a1'];
 }
 if ($number > $t['amount']) {
     $number = $t['amount'];
 }
 if ($number < 1) {
     $number = 1;
 }
 $price = get_price($number, $t['price'], $t['step']);
 $amount = $number * $price;
 $_note = convert(input_trim($v['note']), 'UTF-8', DT_CHARSET);
 $note = '';
 $t['P1'] = get_nv($t['n1'], $t['v1']);
 $t['P2'] = get_nv($t['n2'], $t['v2']);
 $t['P3'] = get_nv($t['n3'], $t['v3']);
 $t['s1'] = $s1;
 $t['s2'] = $s2;
 $t['s3'] = $s3;
 $t['m1'] = isset($t['P1'][$t['s1']]) ? $t['P1'][$t['s1']] : '';
 $t['m2'] = isset($t['P2'][$t['s2']]) ? $t['P2'][$t['s2']] : '';
 $t['m3'] = isset($t['P3'][$t['s3']]) ? $t['P3'][$t['s3']] : '';
 $t['m1'] = isset($t['P1'][$t['s1']]) ? $t['P1'][$t['s1']] : '';
 $t['m2'] = isset($t['P2'][$t['s2']]) ? $t['P2'][$t['s2']] : '';
 $t['m3'] = isset($t['P3'][$t['s3']]) ? $t['P3'][$t['s3']] : '';
 if ($t['m1']) {
     $note .= $t['n1'] . ':' . $t['m1'] . ' ';
 }
 if ($t['m2']) {
     $note .= $t['n2'] . ':' . $t['m2'] . ' ';
 }
コード例 #5
0
ファイル: purchase.php プロジェクト: hiproz/zhaotaoci.cc
 case 'mall':
     $itemid or dheader(mobileurl($moduleid));
     $item = $db->get_one("SELECT * FROM {$table} WHERE itemid={$itemid}");
     if (!$item || $item['status'] != 3) {
         mobile_msg($L['purchase_msg_goods']);
     }
     if ($item['username'] == $_username) {
         mobile_msg($L['purchase_msg_self']);
     }
     $s1 = isset($s1) ? intval($s1) : 0;
     $s2 = isset($s2) ? intval($s2) : 0;
     $s3 = isset($s3) ? intval($s3) : 0;
     $a = isset($a) ? intval($a) : 1;
     $item['P1'] = get_nv($item['n1'], $item['v1']);
     $item['P2'] = get_nv($item['n2'], $item['v2']);
     $item['P3'] = get_nv($item['n3'], $item['v3']);
     if ($item['step']) {
         $s = unserialize($item['step']);
         foreach (unserialize($item['step']) as $k => $v) {
             $item[$k] = $v;
         }
     } else {
         $item['a1'] = 1;
         $item['p1'] = $item['price'];
         $item['a2'] = $item['a3'] = 0;
         $item['p2'] = $item['p3'] = 0.0;
     }
     $item['s1'] = $s1;
     $item['s2'] = $s2;
     $item['s3'] = $s3;
     $item['a'] = $a;