/[LeafOK_CVS]/fenglin/bbs/section_master_list.php
ViewVC logotype

Annotation of /fenglin/bbs/section_master_list.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Wed Apr 23 11:19:34 2025 UTC (10 months, 3 weeks ago) by sysadm
Branch: MAIN
Rename master_list.php to section_master_list.php

1 sysadm 1.1 <?php
2     require_once "../lib/db_open.inc.php";
3     require_once "./session_init.inc.php";
4     ?>
5     <html>
6     <head>
7     <meta HTTP-EQUIV="Content-Type" Content="text-html; charset=UTF-8">
8     <title>论坛版主名单</title>
9     <style>
10     TR
11     {
12     height: 30px;
13     }
14     TD
15     {
16     font-size: 14px;
17     text-align: center;
18     }
19     </style>
20     </head>
21     <body bgcolor="#ccffcc">
22     <center>
23     <p style="FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #ff0000">
24     论坛版主名单
25     </p>
26     <TABLE WIDTH="1050" BORDER="1" CELLSPACING="0" CELLPADDING="10">
27     <TR>
28     <TD>
29     昵称
30     </TD>
31     <TD>
32     版块及职务
33     </TD>
34     <TD>
35     任职时间
36     </TD>
37     <TD>
38     上次上线时间
39     </TD>
40     </TR>
41     <?php
42     $sql = "SELECT username, section_config.title, begin_dt, end_dt, major, last_login_dt
43     FROM section_master INNER JOIN section_config ON section_master.SID = section_config.SID
44     INNER JOIN user_list ON section_master.UID = user_list.UID
45     INNER JOIN user_pubinfo ON section_master.UID = user_pubinfo.UID
46     WHERE section_master.enable AND section_config.enable
47     ORDER BY user_list.UID, begin_dt, MID";
48    
49     $rs = mysqli_query($db_conn, $sql);
50     if ($rs == false)
51     {
52     echo "Query data error: " . mysqli_error($db_conn);
53     exit();
54     }
55    
56     $last_user = "";
57     while ($row = mysqli_fetch_array($rs))
58     {
59     $days_left = (new DateTimeImmutable($row["last_login_dt"]))->diff(new DateTimeImmutable("now"))->days;
60    
61     if ($days_left <= 3)
62     {
63     $status = "<font color=green>很勤快</font>";
64     }
65     else if ($days_left<=7)
66     {
67     $status="<font color=orange>比较勤快</font>";
68     }
69     else if ($days_left<=15)
70     {
71     $status="<font color=blue>有点偷懒</font>";
72     }
73     else if ($days_left<=30)
74     {
75     $status="<font color=red>失职";
76     }
77     else
78     {
79     $status="<font color=white>严重失职</font>";
80     }
81     ?>
82     <TR>
83     <TD>
84     <?= ($last_user == $row["username"] ? "&nbsp;" : ($last_user = $row["username"])); ?>
85     </TD>
86     <TD>
87     <?= $row["title"] . "/" . ($row["major"] ? "正版主" : "副版主"); ?>
88     </TD>
89     <TD>
90     <?= (new DateTimeImmutable($row["begin_dt"]))->setTimezone($_SESSION["BBS_user_tz"])->format("Y年m月d日"); ?>--<?= (new DateTimeImmutable($row["end_dt"]))->setTimezone($_SESSION["BBS_user_tz"])->format("Y年m月d日"); ?>
91     </TD>
92     <TD>
93     <?= $days_left; ?>天前(<?= $status; ?>)
94     </TD>
95     </TR>
96     <?php
97     }
98     mysqli_free_result($rs);
99    
100     mysqli_close($db_conn);
101     ?>
102     </TABLE>
103     </center>
104     </body>
105     </html>

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1