<?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]?>
(<?=$level_r[$r[groupid]][groupname]?>)
<!--班級<?=$ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[tmsn]))?>-->
<?php
if($tmgetgroupid==3){echo $ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[tmsn]))."班";}elseif($tmgetgroupid==1){echo $ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[msn])).">班";}
?>
</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個公告循環開始 -->
<div align="right"> 準備分頁</div>
<table style="width:100%;text-align:center; " border="1px doted black">
<tr style="text-align:center">
<th style="text-align:center">班級</th>
<th style="text-align:center">學生</th>
<th style="text-align:center">練習題</th>
<th style="text-align:center">得分</th>
<th style="text-align:center">練習時間</th>
</tr>
<?php
//以下是應用程序,取出教師任課班級tmsn數組並處理,學生所在班級msn,匹配後查詢出老師所教授班級和學生
if($tmgetgroupid==3){
$sql=$empire->query( "select a.userid,a.username,b.userid,b.msn,b.truename,b.tmsn,c.userid,c.username,c.classid,c.id,c.zongfen,c.saytime,d.id,d.classid,d.title,d.titleurl from {$dbtbpre}enewsmember as a,{$dbtbpre}enewsmemberadd as b ,{$dbtbpre}enewspl_1 as c,{$dbtbpre}ecms_news as d where a.userid=b.userid&&a.userid=c.userid &&a.checked=1&&c.id=d.id&& a.groupid=1 order by b.msn asc,d.newstime desc,a.username desc "); //將會員表和自定義字段會員表連表查詢吃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);
if(in_array($r[msn], $tclass)){ //判斷學生班級號存在與當前教師用戶所教授班級的數組tclas中
//echo $r [msn]."班--";
//echo $r [username]."--";
//echo $r[title]."--得分";
//echo $r[zongfen]."--答題時間";
//echo date('Y-m-d',$r[saytime])."</br>";
?>
<tr>
<td><?= $r [msn] ?></td>
<td><?= $r [username] ?></td>
<td><?= $r[title] ?></td>
<td><?= $r[zongfen] ?></td>
<td><?= date('Y-m-d',$r[saytime]) ?></td>
</tr>
<?php
};
}
?>
</table> 分頁結束
<?php
}elseif($tmgetgroupid==1){
$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 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
$infosql=$empire->query("select * from phome_ecms_news order by newstime desc limit 5");
while($info=$empire->fetch($infosql)){
echo"<li style=' list-style-type:none; 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>
<!-- /.row -->
</div>
</div>
<?php
require(ECMS_PATH.'e/template/incfile/footer.php');
?>