Beispiel #1
0
"><?php 
        echo $item["title"];
        ?>
</a>
          </div>
          <div class="product-footer">
            <span class="product-price">
              <span class="product-old-price"><?php 
        echo $item["old_price"];
        ?>
 <?php 
        echo $data['currency'];
        ?>
</span>
              <?php 
        echo priceFormat($item["price"]);
        ?>
 <?php 
        echo $data['currency'];
        ?>
            </span>
            <div class="product-buttons">
              <!--Кнопка, кототорая меняет свое значение с "В корзину" на "Подробнее"-->
              <?php 
        echo $item[$data['actionButton']];
        ?>
              <?php 
        echo $item['actionCompare'];
        ?>
            </div>
          </div>
Beispiel #2
0
echo priceFormat($deals->old_price);
?>
</p>
                </div>
                <div class="f-r">
                  <label>Spar</label>
                  <p><?php 
echo priceFormat($deals->old_price - $deals->new_price);
?>
</p>
                </div>
              </div>
              <div class="prices m-t10">
                <label>PRIS</label>
                <p><?php 
echo priceFormat($deals->new_price);
?>
</p>
              </div>
              <div class="expires m-t10">
                <p>Udløber om</p>
                <span style="font-size: 11px;" id="time"></span>
              </div>
              <div class="numVoucher m-t10 m-b10">
                <p>Antal vouchers <span><?php 
echo $deals->quantity;
?>
</span></p>
                <?php 
if ($deals->quantity > $deals->quantitybuy) {
    ?>
Beispiel #3
0
 function sendEmail()
 {
     /** Send mail member buy deal*/
     $configEmail['mailtype'] = 'html';
     $this->load->library('email', $configEmail);
     $this->email->set_newline("\r\n");
     $this->email->initialize($configEmail);
     $userCheck = $this->session->userdata('user');
     if ($userCheck) {
         $user = getUser();
         $to = $user->email;
     } else {
         $to = "*****@*****.**";
     }
     $from = "*****@*****.**";
     $orderID = $this->session->userdata('orderID');
     $subject = "Sugardating.dk Ordrebekræftelse - " . $orderID;
     $ID = $this->session->userdata('ID');
     $order = $this->sugarshop_model->selectOrder($ID);
     $orderItems = $this->sugarshop_model->selectOrderItems($ID);
     $content = '<!DOCTYPE HTML>
                 <html>
                 <head>
                 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                 <title>Tak for dit køb på Sugardating.dk</title>
                 </head>
                 <body style="font-size:100%; color: #000; font: normal 15px  Helvetica, Arial, sans-serif;">
                 <table style="width:830px; margin: 0 auto;" width="800" border="1" cellspacing="0" cellpadding="0">
                  <tr>
                     <td>
                        <table style=" width: 800px; margin: 0 15px; font-family: Helvetica ,Arial, sans-serif;   font-size:14px; color: #282828;"  border="0" cellspacing="0"cellpadding="0" hspace="0" >
                           <tr>
                              <td style=" font-size:34px; color:#000; padding-top:15px;  padding-bottom:5px;" colspan="2">Tak for dit køb på Sugardating.dk</td>
                           </tr>
                           <tr>
                              <td colspan="2" style="font-weight: bold; font-size:20px; padding-bottom:5px;  ">Ordrenummer: ' . $orderID . '</td>
                           </tr>
                           <tr>
                              <td colspan="2">
                                 <table  cellspacing="0" cellpadding="5" style="font-family: Helvetica ,Arial, sans-serif;  border-left: 1px solid #aaa;  margin-bottom:15px; width:800px; font-size:14px;">
                                    <tr style="color: #fff; text-align: left; font-size: 14px; background: #aaaaaa;" bgcolor="#aaaaaa" >
                                       <td style="width:200px;"><strong>Valgt</strong></td>
                                       <td style="width:250px;"><strong>Beskrivelse</strong></td>
                                       <td style="width:90px;"><strong>Stk pris</strong></td>
                                       <td style="width:60px;"><strong>%Sugar</strong></td>
                                       <td style="text-align:center; width:50px;"><strong>Antal</strong></td>
                                       <td style="width:100px;text-align: right;"><strong>Pris</strong></td>
                                    </tr>';
     $total = 0;
     if ($orderItems) {
         foreach ($orderItems as $rows) {
             $total += $rows->quantity * $rows->new_price;
             $content .= '<tr>
                                       <td valign="top" style="border-right:1px solid #aaa; border-bottom:1px solid #aaa;">' . $rows->name . '</td>
                                       <td valign="top" style="border-right:1px solid #aaa; border-bottom:1px solid #aaa;">' . $rows->description . '</td>
                                       <td valign="top" style="border-right:1px solid #aaa; border-bottom:1px solid #aaa;">' . priceFormat($rows->old_price) . '</td>
                                       <td valign="top" style="border-right:1px solid #aaa; border-bottom:1px solid #aaa;">' . priceFormat($rows->old_price - $rows->new_price) . '</td>
                                       <td valign="top" style="border-right:1px solid #aaa; border-bottom:1px solid #aaa;text-align:center;">' . $rows->quantity . '</td>
                                       <td valign="top" style="border-right:1px solid #aaa; border-bottom:1px solid #aaa;width:100px;text-align: right;">' . priceFormat($rows->quantity * $rows->new_price) . '</td>
                                    </tr>';
         }
     }
     $content .= '</table>
                              </td>
                           </tr>
                           <tr>
                              <td width="288">&nbsp;</td>
                              <td width="450" style="text-align: right;">
                                 <table style="font-family: Helvetica ,Arial, sans-serif; float: right; font-weight:bold; font-size: 15px;" width="420"  cellspacing="0" cellpadding="10">
                                    <tr>
                                       <td style="text-align: right; border-bottom: 1px solid #aaaaaa;padding-right: 45px;" >Subtotal inkl. moms:</td>
                                       <td style="text-align: right; border-bottom: 1px solid #aaaaaa; width:100px;text-align: right;">' . priceFormat($total) . '</td>
                                    </tr>
                                    <tr>
                                       <td style="text-align: right; border-bottom: 1px solid #aaaaaa;padding-right: 45px;" >Heraf moms:</td>
                                       <td style="text-align: right; border-bottom: 1px solid #aaaaaa; width:100px;text-align: right;">' . priceFormat($total * 0.2) . '</td>
                                    </tr>
                                    <tr>
                                       <td style="text-align: right; border-bottom: 1px solid #aaaaaa;padding-right: 45px;" >Total inkl. moms:</td>
                                       <td style="text-align: right; border-bottom: 1px solid #aaaaaa; width:100px;text-align: right;">' . priceFormat($total) . '</td>
                                    </tr>
                                 </table>
                              </td>
                           </tr>
                           <tr>
                              <td style="font-weight: bold; font-size:20px;padding-bottom:5px;">
                                 Sugardating.dk<br />
                                 kundeservice@sugardating.dk<br />
                                 CVR-nr. 27 36 46 08<br />
                                 1663 København V<br />
                              </td>
                              <td>&nbsp;</td>
                           </tr>
                        </table>
                     </td>
                  </tr>
               </table>
               </body>
               </html>';
     $this->email->clear();
     $this->email->to($to);
     $this->email->from($from, 'Christina, Sugardating.dk');
     $this->email->subject($subject);
     $this->email->message($content);
     $this->email->send();
 }
 private function _getOrderData(&$rs)
 {
     $printer = F('steward/print_city_' . steadmin::$adminInfo['city_id']);
     if (!$printer) {
         parent::setPrintCache();
         $printer = F('steward/print_city_' . steadmin::$adminInfo['city_id']);
         if (!$printer) {
             showError('没有打印机信息');
         }
     }
     $tmpData = array();
     //先按店铺取商品数据
     foreach ($rs['items'] as $val) {
         if (!isset($tmpData[$val['shop_id']])) {
             $tmpData[$val['shop_id']] = array('items' => array(), 'order_amount' => 0);
         }
         $tmpData[$val['shop_id']]['items'][] = array('goods_name' => $val['goods_name'], 'goods_spec' => $val['goods_spec'], 'goods_counts' => $val['goods_counts'], 'goods_price' => $val['goods_price'], 'goods_number' => $val['goods_number']);
         $tmpData[$val['shop_id']]['order_amount'] += $val['goods_counts'] * $val['goods_price'];
     }
     //        $_getDeploymentUsers = array();
     foreach ($tmpData as $key => $val) {
         $tmpData[$key]['order_amount'] = priceFormat($tmpData[$key]['order_amount']);
         $tmpData[$key]['shop_name'] = parent::_getShopName($key);
         //            $tmpData[$key]['deployment'] = $this->_getDeploymentUser($key);
         $tmpData[$key]['print'] = isset($printer['shop'][$key]) ? $printer['shop'][$key][array_rand($printer['shop'][$key], 1)] : '';
         if (!$tmpData[$key]['print']) {
             showError('店铺' . $tmpData[$key]['shop_name'] . '没有打印机信息');
         }
         //            $_getDeploymentUsers[] = $tmpData[$key]['deployment'];
     }
     $objData = array('info' => array('order_id' => $rs['order_id'], 'order_sn' => $rs['order_sn'], 'address' => $rs['address'], 'phone' => $rs['phone'], 'username' => $rs['username'], 'desc' => $rs['desc'], 'order_time' => outTime($rs['order_time']), 'arrive_date' => outTime($rs['arrive_date'], 2), 'arrive_time' => $rs['arrive_time'], 'order_amount' => $rs['order_amount'], 'shipping_fee' => $rs['shipping_fee'], 'offset' => $rs['credit_offset'] + $rs['coupon_offset'] + $rs['sales_offset'], 'printCounts' => count($tmpData), 'order_no' => sprintf("%04d", D('steorder')->where(array('status[>=]' => 3, 'status[<=]' => 11, 'arrive_date' => $rs['arrive_date'], 'service_id' => $rs['service_id']))->count() + 1)), 'print' => isset($printer['zone'][$rs['service_id']]) ? $printer['zone'][$rs['service_id']][array_rand($printer['zone'][$rs['service_id']], 1)] : '', 'order' => $tmpData);
     if (!$objData['print']) {
         showError('该服务点没有打印机信息');
     }
     //        F('test_order_data',$objData);
     //        z($objData);
     return $objData;
 }
Beispiel #5
0
        ?>
</td>
    		<!--td><?php 
        echo $rows->customer;
        ?>
</td-->
    		<td class="txt-center"><?php 
        echo $rows->quantity;
        ?>
</td>
    		<td><?php 
        echo $rows->name;
        ?>
</td>
    		<td><?php 
        echo priceFormat($rows->new_price);
        ?>
</td>
    		<td class="no-boder-r pr0">
    			<p><?php 
        echo $rows->codes;
        ?>
</p>
    		</td>
    		<td>
    			<p><input id="checkOK_<?php 
        echo $rows->id;
        ?>
" value="<?php 
        echo $rows->id;
        ?>
Beispiel #6
0
                echo $item['recommend']?'<span class="sticker-recommend"></span>':'';
            ?>
          </div>
          <div class="product-image">
            <a href="<?php echo SITE ?>/<?php echo isset($item["category_url"])?$item["category_url"]:'catalog' ?>/<?php echo htmlspecialchars($item["product_url"]) ?>">
               <?php echo mgImageProduct($item); ?>
            </a>
          </div>

          <div class="product-name">
            <a href="<?php echo SITE ?>/<?php echo isset($item["category_url"])?$item["category_url"]:'catalog' ?>/<?php echo htmlspecialchars($item["product_url"]) ?>"><?php echo $item["title"] ?></a>
          </div>
          <div class="product-footer">
            <span class="product-price">
              <span class="product-old-price"><?php echo $item["old_price"] ?> <?php echo $data['currency']; ?></span>
              <?php echo priceFormat($item["price"]) ?> <?php echo $data['currency']; ?>
            </span>
            <div class="product-buttons">
              <!--Кнопка, кототорая меняет свое значение с "В корзину" на "Подробнее"-->
              <?php echo $item[$data['actionButton']] ?>
              <?php echo $item['actionCompare'] ?>
            </div>
          </div>
        </div>
      <?php endforeach; ?>
    </div>
  </div>
  <div class="js_clear"></div>
  </div>
<?php endif; ?> 
Beispiel #7
0
        <div class="w65 f-l"><?php 
        echo priceFormat($rows['price']);
        ?>
</div>
        <div class="w65 f-l"><?php 
        echo priceFormat($rows['qty'] * $rows['price']);
        ?>
</div>
    </div>
    <?php 
    }
} else {
    ?>
        <div class="clearfix bor-b2 p10">
            Din Indkøbsvogn er tom
        </div>
    <?php 
}
?>
    <div class="clearfix text-r">
        <div class="f-l m-l85">
            <h4>Pris ialt</h4>
        </div>
        <div class="f-r p-r20 m-b20">
            <h4><?php 
echo priceFormat($tatal);
?>
</h4>
        </div>
    </div>
</div>
Beispiel #8
0
          </tr>
        <?php 
}
?>
        <!--                <tr>-->
        <!--                    <td colspan="4" style="text-align:right;"></td>-->
        <!--                    <td class="total-sum-cell">-->
        <!---->
        <!--                    </td>-->
        <!--                </tr>-->
      </table>
    </form>
    <div class="total-sum">
      <span>Стоимость всех товаров:</span>
      <strong> <?php 
echo priceFormat($data['totalSumm']);
?>
 <?php 
echo $data['currency'];
?>
</strong>
    </div>
  </div>


  <?php 
if (class_exists('PromoCode')) {
    ?>
    [promo-code] 
  <?php 
}
    ?>
</td>
                        <td align="left" valign="middle"><?php 
    echo outTime($value['add_time']);
    ?>
</td>
                      </tr>
                      <?php 
    $goodsNum += $value['goods_counts'] * $value['goods_price'];
    $creditsNum += $value['goods_counts'] * $value['credits'];
}
$downNum = priceFormat($rs['credit_offset'] + $rs['coupon_offset'] + $rs['sales_offset']);
?>
                      <tr>
                        <td colspan="20">订单总计:商品<span class="red" style="font-size:20px"><?php 
echo priceFormat($goodsNum);
?>
</span> 元,运费<span class="red" style="font-size:20px"><?php 
echo $rs['shipping_fee'];
?>
</span> 元,采购费<span class="red" style="font-size:20px"><?php 
echo $rs['purchase_fee'];
?>
</span> 元,抵扣<span class="red" style="font-size:20px"><?php 
echo $downNum;
?>
</span> 元,订单金额<span class="red" style="font-size:20px"><?php 
echo $rs['order_amount'];
?>
</span> 元,返结邻币:<span class="red" style="font-size:20px"><?php 
echo $creditsNum;
Beispiel #10
0
 public function shareImageFormat(&$share, $pic_num = 0)
 {
     $images = $share['cache_data']['imgs'];
     foreach ($images['all'] as $ik => $img) {
         if ($img['type'] == 'g') {
             $img['goods_url'] = $img['url'];
             if (empty($img['taoke_url'])) {
                 $img['to_url'] = FU('tgo', array('url' => $img['url']));
             } else {
                 $img['to_url'] = FU('tgo', array('url' => $img['taoke_url']));
             }
             $img['price_format'] = priceFormat($img['price']);
         }
         $img['url'] = FU('note/' . $img['type'], array('sid' => $img['share_id'], 'id' => $img['id']));
         $images['all'][$ik] = $img;
         $share['imgs'][] = $img;
     }
     foreach ($images['dapei'] as $ik) {
         $share['dapei_imgs'][] = $images['all'][$ik];
     }
     foreach ($images['look'] as $ik) {
         $share['look_imgs'][] = $images['all'][$ik];
     }
     if ($pic_num > 0 && count($share['imgs']) > $pic_num) {
         $share['imgs'] = array_slice($share['imgs'], 0, $pic_num);
     }
     unset($images);
 }
    public function run()
    {
        global $_FANWE;
        $root = array();
        $root['return'] = 1;
        $share_id = (int) $_FANWE['requestData']['share_id'];
        $share = FS('Share')->getShareById($share_id);
        if ($share) {
            $cache_data = fStripslashes(unserialize($share['cache_data']));
            unset($share['cache_data']);
            $share['time'] = getBeforeTimelag($share['create_time']);
            $share['url'] = FU('note/index', array('sid' => $share_id), true);
            $parses = m_express(&$share['content']);
            $share['parse_users'] = $parses['users'];
            $share['parse_events'] = $parses['events'];
            $share_user = FS('User')->getUserById($share['uid']);
            $share['user_name'] = $share_user['user_name'];
            $share['user_avatar'] = avatar($share_user['uid'], 'm', $share_user['server_code'], 1, true);
            if ($_FANWE['uid'] == $share['uid']) {
                $share['is_follow_user'] = -1;
            } else {
                if (FS('User')->getIsFollowUId($share['uid'])) {
                    $share['is_follow_user'] = 1;
                } else {
                    $share['is_follow_user'] = 0;
                }
            }
            $share['collects'] = array();
            if (!empty($cache_data['collects'])) {
                $collect_ids = array_slice($cache_data['collects'], 0, 20);
                if ($share['is_follow_user'] == 1) {
                    if ($ckey = array_search($_FANWE['uid'], $collect_ids) === FALSE) {
                        array_unshift($collect_ids, $_FANWE['uid']);
                        array_pop($collect_ids);
                    } else {
                        unset($collect_ids[$ckey]);
                        array_unshift($collect_ids, $_FANWE['uid']);
                    }
                }
                $collect_ids = implode(',', $collect_ids);
                $res = FDB::query("SELECT uid,user_name,server_code FROM " . FDB::table('user') . ' 
					WHERE uid IN (' . $collect_ids . ')');
                while ($item = FDB::fetch($res)) {
                    $item['user_avatar'] = avatar($item['uid'], 'm', $item['server_code'], 1, true);
                    unset($item['server_code']);
                    $share['collects'][] = $item;
                }
            }
            $share['imgs'] = array();
            if (!empty($cache_data['imgs'])) {
                foreach ($cache_data['imgs']['all'] as $img) {
                    if ($img['type'] == 'g') {
                        $img['goods_url'] = $img['url'];
                        $img['price_format'] = priceFormat($img['price']);
                    } else {
                        $img['name'] = '';
                        $img['price'] = '';
                        $img['goods_url'] = '';
                        $img['taoke_url'] = '';
                        $img['price_format'] = '';
                    }
                    unset($img['url']);
                    $img['small_img'] = getImgName($img['img'], 468, 468, 0, true);
                    $share['imgs'][] = $img;
                }
            }
        }
        $root['item'] = $share;
        m_display($root);
    }
Beispiel #12
0
          <p><?php 
if ($order) {
    echo priceFormat($order->total * 0.2);
} else {
    echo "0,-";
}
?>
</p>
        </div>
        <div class="f-r price3">
          <p>Heraf moms:</p>
        </div><br style="clear: both;" />
        <div class="f-r w120 price3 m-l m-l85">
          <p><?php 
if ($order) {
    echo priceFormat($order->total);
} else {
    echo "0,-";
}
?>
</p>
        </div>
        <div class="f-r price3">
          <p>Total inkl. moms:</p>
        </div>
      </div><!--.cartItem-->
      <div class="clear"></div>
      <div class="address f-l">
        <h4>Sugardating</h4>
        <p>
            <a class="color-golden" href="mailto:kundeservice@sugardating.dk">kundeservice@sugardating.dk</a> eller telefon 45 31 22 91 99<br />
 public function checkCoupon($couponUsed, $orderAmount, $cityId, $uid, $isNoNew = false, &$goodsInfo = array(), $type = 1)
 {
     $rs = $this->where(array('coupon_code' => $couponUsed, 'city_id' => $cityId))->find();
     if (!$rs) {
         return array('status' => 0, 'info' => '抵价券不存在');
     }
     if ($rs['is_used']) {
         return array('status' => 0, 'info' => '该券已失效');
     }
     if ($rs['start_time'] && $rs['start_time'] > TIME) {
         return array('status' => 0, 'info' => '该券尚未生效');
     }
     if ($rs['end_time'] && $rs['end_time'] < TIME) {
         return array('status' => 0, 'info' => '该券已过期');
     }
     if ($rs['start_amount'] > $orderAmount) {
         return array('status' => 0, 'info' => '订单满' . $rs['start_amount'] . '元才可使用');
     }
     if ($rs['used_uid'] && $rs['used_uid'] != $uid) {
         return array('status' => 0, 'info' => '该券已绑定到其他帐户');
     }
     //新人券
     if (!$isNoNew && $rs['stype'] == 2 && !D('steorder')->checkIsNewShopper($uid)) {
         return array('status' => 0, 'info' => '您不满足新人券使用条件');
     }
     //        z($goodsInfo);
     //检查客户端
     if ($rs['use_client'] && $rs['use_client'] != $type) {
         return array('status' => 0, 'info' => '不支持当前客户端使用');
     }
     //检查品类券
     if ($rs['use_cate']) {
         $rs['use_cate'] = explode(',', $rs['use_cate']);
         //循环取出所有类目的子类目
         $cate = M('ste_goods_cate')->field('id,name,sort,pid,path,depth')->where(array('city_id' => $cityId, 'is_show' => 1, 'is_del' => 0))->order('sort DESC')->select('id');
         $cateList = array();
         foreach ($rs['use_cate'] as $val) {
             $cates = D('tree')->getSubs($cate, $val, true);
             if (isset($cates['list']) && $cates['list']) {
                 $cateList = array_merge($cateList, $cates['list']);
             }
         }
         $totalAmount = 0;
         foreach ($goodsInfo as $val) {
             if (in_array($val['cate_id'], $cateList)) {
                 $totalAmount += $val['price'] * $val['goods_counts'];
             }
         }
         if (!$totalAmount || $rs['start_amount'] && $rs['start_amount'] > $totalAmount) {
             return array('status' => 0, 'info' => '该品类券需指定品类下商品满' . $rs['start_amount'] . '元才可使用');
         }
         if ($totalAmount <= $rs['coupon_money']) {
             $rs['coupon_money'] = priceFormat($totalAmount);
         }
     }
     //检查商家券
     if ($rs['use_shop']) {
         $rs['use_shop'] = explode(',', $rs['use_shop']);
         $totalAmount = 0;
         foreach ($goodsInfo as $val) {
             if (in_array($val['shop_id'], $rs['use_shop'])) {
                 $totalAmount += $val['price'] * $val['goods_counts'];
             }
         }
         if (!$totalAmount || $rs['start_amount'] && $rs['start_amount'] > $totalAmount) {
             return array('status' => 0, 'info' => '该商家券需指定商家的商品满' . $rs['start_amount'] . '元才可使用');
         }
         if ($totalAmount <= $rs['coupon_money']) {
             $rs['coupon_money'] = priceFormat($totalAmount);
         }
     }
     /*
      * 临时加上,限制每天只能使用一张
      */
     $stime = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
     $etime = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
     if ($this->where(array('used_uid' => $uid, 'city_id' => $cityId, 'used_time[>=]' => $stime, 'used_time[<=]' => $etime, 'is_used' => 1))->count() >= 2) {
         return array('status' => 0, 'info' => '每天只能使用2张抵价券');
     }
     return array('status' => 1, 'info' => 'ok', 'type' => $rs['stype'], 'offset' => $rs['coupon_money']);
 }