refactor attendance

This commit is contained in:
xiaomlove
2022-02-25 23:13:34 +08:00
parent 57f1e92998
commit 5ed80ed637
10 changed files with 177 additions and 40 deletions
+6 -4
View File
@@ -2248,7 +2248,7 @@ function get_cat_folder($cat = 101)
if ($caticonrow['multilang'] == 'yes') {
$path .= '/' . trim($CURLANGDIR, '/');
}
do_log("cat: $cat, path: $path");
do_log("cat: $cat, path: $path", 'debug');
$catPath[$cat] = $path;
}
return $catPath[$cat] ?? '';
@@ -2465,8 +2465,10 @@ else {
}
$inboxpic = "<img class=\"".($unread ? "inboxnew" : "inbox")."\" src=\"pic/trans.gif\" alt=\"inbox\" title=\"".($unread ? $lang_functions['title_inbox_new_messages'] : $lang_functions['title_inbox_no_new_messages'])."\" />";
$attend_desk = new Attendance($CURUSER['id']);
$attendance = $attend_desk->check();
// $attend_desk = new Attendance($CURUSER['id']);
// $attendance = $attend_desk->check();
$attendanceRep = new \App\Repositories\AttendanceRepository();
$attendance = $attendanceRep->getAttendance($CURUSER['id'], date('Ymd'))
?>
<table id="info_block" cellpadding="4" cellspacing="0" border="0" width="100%"><tr>
@@ -2481,7 +2483,7 @@ else {
[<a href="torrents.php?inclbookmarked=1&amp;allsec=1&amp;incldead=0"><?php echo $lang_functions['text_bookmarks'] ?></a>]
<font class = 'color_bonus'><?php echo $lang_functions['text_bonus'] ?></font>[<a href="mybonus.php"><?php echo $lang_functions['text_use'] ?></a>]: <?php echo number_format($CURUSER['seedbonus'], 1)?>
<font class = 'color_bonus'><?php echo $lang_functions['text_seed_points'] ?></font>: <?php echo number_format($CURUSER['seed_points'], 1)?>
<?php if($attendance){ printf('&nbsp;'.$lang_functions['text_attended'], $attendance['points']); }else{ printf(' <a href="attendance.php" class="faqlink">%s</a>', $lang_functions['text_attendance']);}?>
<?php if($attendance){ printf('&nbsp;'.$lang_functions['text_attended'], $attendance->points); }else{ printf(' <a href="attendance.php" class="faqlink">%s</a>', $lang_functions['text_attendance']);}?>
<font class = 'color_invite'><?php echo $lang_functions['text_invite'] ?></font>[<a href="invite.php?id=<?php echo $CURUSER['id']?>"><?php echo $lang_functions['text_send'] ?></a>]: <?php echo $CURUSER['invites']?>
<br />
<font class="color_ratio"><?php echo $lang_functions['text_ratio'] ?></font> <?php echo $ratio?>