<?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[tcompany]));echo $ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[tgrade]))."年級";echo $ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[tmsn]))."班";}elseif($tmgetgroupid==1){echo $ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[company]));echo $ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[grade]))."年級";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/" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >
<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/" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >
<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/" target="_blank" rel="external nofollow" >
<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 style=' overflow-y:auto; height:1000px;' class="list-group">
<!--8個公告循環開始 -->
<?php
//以下是應用程式,取出教師任課班級tmsn數組并處理,學生所在班級msn,比對後查詢出老師所教授班級和學生
if($tmgetgroupid==3){
$sql=$empire->query( "select a.userid,a.username,b.userid,b.msn,b.grade,b.company,b.tgrade,b.tcompany,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的會員列出
?>
<table style="width:100%;text-align:center; overflow-y:auto; height:100px;" >
<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
$tcompany=$ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[tcompany]));
$tgrade=$ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[tgrade]));
$tmsn=$ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[tmsn]));
$tclass=explode("|",$tmsn);
while ( $r = $empire ->fetch( $sql )){
//echo $ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[tcompany]));
//echo $ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($addr[tmsn])); //列印出目前使用者的tmsn教師任課班級資料 以1|4|形式出現
if($tcompany==$r[company]&&$tgrade==$r[grade]&&in_array($r[msn], $tclass) ){ //判斷學生班級号存在與目前教師使用者所教授班級的數組tclas中
//echo $r[company];
//echo $r[username]."--";
//echo $r[title]."--得分";
//echo $r[zongfen]."--答題時間";
//echo date('Y-m-d',$r[saytime])."</br>";
?>
<tr>
<td><?= $r[title] ?></td>
<td><?= $r [msn] ?></td>
<td><?= $r [username] ?></td>
<td><?= $r[zongfen] ?></td>
<td><?= date('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 10"); //查詢評論
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']." target="_blank" rel="external nofollow" > ".$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 10");
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');
?>