<?php
if(!defined('InEmpireCMS'))
{
exit();
}
?>
<?php
$public_diyr['pagetitle']='会员中心';
$url="<a href=../../../>首页</a> > <a href=../cp/>会员中心</a>";
require(ECMS_PATH.'e/template/incfile/header.php');
?>
<div class="app-content-body ">
<div class="bg-light lter b-b wrapper-md">
<h1 class="m-n font-thin h3">会员中心</h1>
<small class="text-muted">欢迎你 <?=$user[username]?> 任课班级<?=$ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[tmsn]))?>(<?=$level_r[$r[groupid]][groupname]?>)</small>
</div>
<div class="wrapper-md">
<div class="row">
<div class="col-md-12">
<div class="row row-sm text-center">
<div class="col-lg-3 col-md-6">
<a class="block panel padder-v item">
<div class="h1 text-info font-thin h1"><?=$level_r[$r[groupid]][groupname]?></div>
<span class="text-muted text-xs">当前用户组</span>
</a>
</div>
<div class="col-lg-3 col-md-6">
<a class="block panel padder-v bg-primary item" href="<?=$public_r['newsurl']?>e/member/my/">
<span class="text-white font-thin h1 block"><?=$r[money]?>元</span>
<span class="text-muted text-xs">余额</span>
</a>
</div>
<div class="col-lg-3 col-md-6">
<a class="block panel padder-v bg-info item" href="<?=$public_r['newsurl']?>e/member/my/">
<span class="text-white font-thin h1 block"><?=$r[userfen]?>
点</span>
<span class="text-muted text-xs">点数</span>
</a>
</div>
<div class="col-lg-3 col-md-6">
<a class="block panel padder-v item" href="<?=$public_r['newsurl']?>e/ShopSys/ListDd/">
<div class="font-thin h1">我的订单</div>
<span class="text-muted text-xs">充值</span>
</a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list fa-fw"></i>
<?php if($tmgetgroupid==3){echo"我的学生";}elseif($tmgetgroupid==1){echo"最新试题";} ?>
</h3>
</div>
<div class="panel-body">
<div class="list-group">
<!--8个公告循环开始 -->
<?php
$sql=$empire->query( "select a.userid,a.username,b.userid,b.msn,b.truename,b.tmsn from {$dbtbpre}enewsmember as a,{$dbtbpre}enewsmemberadd as b where a.userid=b.userid&&a.groupid=1");
while ( $r = $empire ->fetch( $sql )){
//echo $r [username]."--";echo $r [msn];
//echo $ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[tmsn])); //打印出当前用户的tmsn教师任课班级数据 以1|4|形式出现
$tmsn=$ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[tmsn])); //将取出的数组赋值给变量$tmsn,以1|4|形式出现
$tclass=explode("|",$tmsn); // 去掉数组中的竖线
$tc1= $tclass[1]; //数组第一个值取出赋给变量$tc1
$tc2 = $tclass[2]; //数组第二个值取出赋给变量$tc2,未来会直接执行inArray函数,解决教师多班授课问题
};
if($tmgetgroupid==3){
$sql=$empire->query( "select a.userid,a.username,b.userid,b.msn,b.truename,b.tmsn from {$dbtbpre}enewsmember as a,{$dbtbpre}enewsmemberadd as b where a.userid=b.userid&&a.groupid=1"); //将会员表和自定义字段会员表连表查询吃userid相同且班级字段msn=1的会员列出
while ( $r = $empire ->fetch( $sql )){
//echo $r [username]."--";echo $r [msn];
//echo $ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[tmsn])); //打印出当前用户的tmsn教师任课班级数据 以1|4|形式出现
$tmsn=$ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[tmsn]));
$tclass=explode("|",$tmsn);
$tc1= $tclass[1]; //数组第一个值取出赋给变量$tc1
$tc2 = $tclass[2]; //数组第二个值取出赋给变量$tc2,未来会直接执行inArray函数,解决教师多班授课问题
//echo $r [username]."--";echo $r [msn];
if(in_array($r[msn], $tclass)){
echo $r [username]."--";echo $r [msn];
};
}
}elseif($tmgetgroupid==1){
$infosql=$empire->query("select * from phome_ecms_news order by newstime desc limit 5");
while($info=$empire->fetch($infosql)){
echo"<li style=' height:100px;line-height:31px;text-indent:10px;border-top:1px solid #eee;font-size:16px;'><a target=_blank href='"."$info[titleurl]"."'> "."$info[title]"." <br/> 共: "."$info[Exnum]"." 题, 更新时间:".date('Y-m-d',$info[newstime])."</a></li>";
};
}
?>
<!--8个公告循环结束-->
</div>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list fa-fw"></i> 我的答题</h3>
</div>
<div class="panel-body">
<div class="list-group">
<!--8个文章循环开始 -->
<?php
$sql=$empire->query("select A.id,A.saytime,A.zongfen,A.mistakes,A.jiexi,B.Exnum,B.title,B.titleurl from {$dbtbpre}enewspl_1 as A, {$dbtbpre}ecms_news as B where A.id=B.id && A.userid=$user[userid] order by A.saytime desc limit 5"); //查询评论
while($r=$empire->fetch($sql)) //循环获取查询记录
{
echo "
<li style=' overflow-y:auto; height:100px;line-height:31px;text-indent:10px;border-top:1px solid #eee;font-size:16px;'><a target=_blank href=".$r['titleurl']."> ".$r['title']." <br/>
共: ".$r['Exnum']." 题,你得到了: ".$r['zongfen']." 分<br/>
错题:".$r['mistakes']." <br/>
答题时间: ".date('Y-m-d',$r[saytime])." </a></li>";
}
?>
<!--8个文章循环结束-->
</div>
</div>
</div>
</div>
</div>
<!-- /.row -->
</div>
</div>
<?php
require(ECMS_PATH.'e/template/incfile/footer.php');
?>
来源:CSDN
作者:左岸天使
链接:https://blog.csdn.net/gc025/article/details/104633299