<?php
include("require.php");
if($_COOKIE['core_user_rank']!="2" && $shop_open=="0")
  jump("close.php?action=shop");
//公告
$phpcolor->table="placard";
$phpcolor->field="tid,theme";
$phpcolor->where="type = 2 order by placardtime desc limit 5";
$notice=$phpcolor->assignment();
for ($count=0;$count<count($notice);$count++)
{ 
  $notice[$count]['url']=htmlurl($core_url,"read",$notice[$count]['tid'],0,$core_rewrite);
}
$phpcolor->table="shop_card";
$phpcolor->field="*";
$phpcolor->where="1=1 order by queue";
$card=$phpcolor->assignment();
if(isset($_COOKIE['core_user_name']))
{
  $phpcolor->table="user";
  $phpcolor->field="picture,integral,money";
  $phpcolor->where="username='".$_COOKIE['core_user_name']."'";
  $users=$phpcolor->exist(1);
}
$phpcolor->table="shop_cards";
$phpcolor->field="*";
$phpcolor->where="status='3' order by selltime desc";
$cardzr=$phpcolor->assignment();
for ($count=0;$count<count($cardzr);$count++)
{
  $phpcolor->table="shop_card";
  $phpcolor->field="cardname";
  $phpcolor->where="id='".$cardzr[$count]['cardid']."'";
  $rs=$phpcolor->exist(1);
  $cardzr[$count]['cardname']=$rs['cardname'];
  $phpcolor->table="user";
  $phpcolor->field="username";
  $phpcolor->where="id='".$cardzr[$count]['uid']."'";
  $rs=$phpcolor->exist(1);
  $cardzr[$count]['username']=$rs['username'];
}
$tpl -> assign("cardzr", $cardzr);
$tpl -> assign("shop_drmm", $shop_drmm);
$tpl -> assign("shop_drmy", $shop_drmy);
$tpl -> assign("shop_vipmm", $shop_vipmm);
$tpl -> assign("shop_vipmy", $shop_vipmy);
$tpl -> assign("shop_dri", $shop_dri);
$tpl -> assign("shop_vipi", $shop_vipi);
$tpl -> assign("users", $users);
$tpl -> assign("card", $card);
$tpl -> assign("notice", $notice);
$tpl -> assign("core_header_title", $core_barname."增值服务中心 - ");
$tpl -> display("$core_style/shop.htm");
?>