Skip to content

Commit

Permalink
教师查看学生详情页面修改
Browse files Browse the repository at this point in the history
  • Loading branch information
daizeyao authored and daizeyao committed Oct 30, 2024
1 parent 9788b8e commit a760d4e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
11 changes: 6 additions & 5 deletions web/OJ/student_daily_detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@

$filter_sql = "";

$order_by = "submit, reg_time";
$order_by = "user_id, reg_time";
if (isset($_GET['order_by'])) {
$first_order_by = $_GET['order_by'];
if ($order_by == 'user_id') $order_by = $first_order_by . ", strength DESC, " . $order_by;
else $order_by = $first_order_by." DESC , " . $order_by;
if ($first_order_by !== 'user_id') {
$order_by = $first_order_by . " DESC , " . $order_by;
}
}

$page_size = 100;
Expand Down Expand Up @@ -168,15 +169,15 @@ function getColor($value)
$view_rank[$i][1] = "<div class='am-text-center'><a href='userinfo.php?user=" . $row['user_id'] . "'>" . $row['user_id'] . "</a>" . "</div>";
$view_rank[$i][2] = "<div class='am-text-center'>" . htmlentities($row['real_name']) . "</div>";
$view_rank[$i][3] = "<div class='am-text-center'><a href='status.php?user_id=" . $row['user_id'] . "&jresult=4'>" . $row['solved'] . "</a>" . "</div>";
$view_rank[$i][4] = "<div class='am-text-center' style='dispaly:flex;flex-warp:wrap;position:relative;'>";
$view_rank[$i][4] = "<div class='am-text-center' style='dispaly:flex;height:24px;flex-warp:wrap;position:relative;'>";

$previous_month = null;
foreach ($filtered_data as $record) {
// 日期
if ($i == 0) {
$current_month = date('Y-m', strtotime($record[0]));
if ($current_month !== $previous_month) {
$view_rank[$i][4] .= "<span style='position:absolute;top:-32px;transform:translateX(-50%);'>$current_month</span>";
$view_rank[$i][4] .= "<span style='position:absolute;top:-32px;transform:translateX(-50%);white-space:nowrap;'>$current_month</span>";
$previous_month = $current_month;
}
}
Expand Down
29 changes: 17 additions & 12 deletions web/OJ/template/hznu/student_daily_detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
<?php
require_once("header.php");
?>

<style>
.am-selected {
width: 12vw;
}
</style>
<div class="am-avg-md-1" style="width: 90%; margin:5vh auto">
<form class="am-form am-form-inline" action='student_daily_detail.php'>
<input type="hidden" name="csrf_token" value="f31605cce38e27bcb4e8a76188e92b3b">
<div class='am-form-group' style="margin-right: 40px;">
<div class='am-form-group' style="margin-right: 20px;">
<label for="class" style="margin-right: 10px;">班级:</label>
<select data-am-selected=" {searchBox: 1, maxHeight: 400}" id='class' name='class' style='width:110px'>
<select data-am-selected=" {searchBox: 1, maxHeight: 400}" id='class' name='class'>
<option value='all' <?php if (isset($_GET['class']) && $_GET['class'] == "" || !isset($_GET['class'])) echo "selected"; ?>>全部</option>
<?php
foreach ($classSet as $class) {
Expand All @@ -20,18 +24,19 @@
?>
</select>
</div>
<div class="am-form-group" style="margin-right: 40px;">
<div class="am-form-group" style="margin-right: 20px;">
<label for="start_date" style="margin-right:10px;">开始日期:</label>
<input type="date" id="start_date" style="display:inline-block;width:200px;" name="start_date" value="<?php echo $start_date; ?>">
<input type="date" id="start_date" style="display:inline-block;width:10vw;" name="start_date" value="<?php echo $start_date; ?>">
</div>
<div class="am-form-group" style="margin-right: 40px;">
<div class="am-form-group" style="margin-right: 20px;">
<label for="end_date" style="margin-right: 10px;">结束日期:</label>
<input type="date" style="display:inline-block;width:200px;" name="end_date" value="<?php echo $end_date; ?>">
<input type="date" style="display:inline-block;width:10vw;" name="end_date" value="<?php echo $end_date; ?>">
</div>
<div class="am-form-group" style="margin-right: 40px;">
<div class="am-form-group" style="margin-right: 20px;">
<label for="order_by" style="margin-right: 10px;">排序:</label>
<select data-am-selected="{searchBox: 1, maxHeight: 400}" name='order_by'>
<option value="solved" <?php echo ($first_order_by == "solved") ? 'selected' : ''; ?>>过题数</option>
<option value="submit" <?php echo ($first_order_by == "submit") ? 'selected' : ''; ?>>提交数</option>
<option value="user_id" <?php echo ($first_order_by == "user_id") ? 'selected' : ''; ?>>学号</option>
<option value="strength" <?php echo ($first_order_by == "strength") ? 'selected' : ''; ?>>能力值</option>
</select>
Expand All @@ -42,10 +47,10 @@
<table class="am-table am-table-striped am-margin-top">
<thead>
<tr>
<th class='am-text-center' style='width:4%;'>Rank</th>
<th class='am-text-center' style='width:1%;'>Rank</th>
<th class='am-text-center' style='width:10%;'>User</th>
<th class='am-text-center' style='width:10%;'>Name</th>
<th class='am-text-center' style='width:4%;'>Solved</th>
<th class='am-text-center' style='width:8%;'>Name</th>
<th class='am-text-center' style='width:2%;'>Solved</th>
<th class='am-text-center'>Daily</th>
</tr>
</thead>
Expand All @@ -54,7 +59,7 @@
foreach ($view_rank as $row) {
echo "<tr>";
foreach ($row as $table_cell) {
echo "<td align='center'>";
echo "<td align='center' style='padding:3px'>";
echo $table_cell;
echo "</td>";
}
Expand Down

0 comments on commit a760d4e

Please sign in to comment.