3 include_once("auth.php");
4 include_once("header.php");
5 include_once("time.php");
9 $sql = 'select count(*) from users';
11 $result = mysql_query($sql);
12 $row = mysql_fetch_row($result);
13 $user_count = $row[0];
16 $sql = 'select count(*), max(timeposted) from schedule';
18 $result = mysql_query($sql);
19 $row = mysql_fetch_row($result);
20 $assignment_count = $row[0];
21 if($assignment_count == 0) {
22 $assignment_max = "Never";
23 $assignment_time = "Never";
25 $assignment_max = $row[1];
26 $assignment_time = absHumanTiming($assignment_max);
29 $sql ='select count(*), max(timeposted) from comments';
31 $result = mysql_query($sql);
32 $row = mysql_fetch_row($result);
33 $comment_count = $row[0];
34 if($comment_count == 0) {
35 $comment_max = "Never";
36 $comment_time = "Never";
38 $comment_max = $row[1];
39 $comment_time = absHumanTiming($comment_max);
42 $sql = 'select count(*), max(timeposted) from filecom';
44 $result = mysql_query($sql);
45 $row = mysql_fetch_row($result);
46 $filecomm_count = $row[0];
47 if($filecomm_count == 0) {
48 $filecomm_max = "Never";
49 $filecomm_time = "Never";
51 $filecomm_max = $row[1];
52 $filecomm_time = absHumanTiming($filecomm_max);
55 $sql = 'select count(*), max(time_post) from files';
57 $result = mysql_query($sql);
58 $row = mysql_fetch_row($result);
59 $file_count = $row[0];
60 if($file_count == 0) {
65 $file_time = absHumanTiming($file_max);
70 $sql = 'select count(*) from users where attempts > 100';
72 $result = mysql_query($sql);
73 $row = mysql_fetch_row($result);
74 $std_locked = $row[0];
76 $sql = 'select max(chat_time) from chat';
78 $result = mysql_query($sql);
79 $row = mysql_fetch_row($result);
81 $chat_max_time = absHumanTiming($chat_max);
83 $sql = 'select count(*) from chat';
84 $result = mysql_query($sql);
85 $row = mysql_fetch_row($result);
86 $chat_count = $row[0];
88 // number of chat messages by hour
89 //$sql = 'select hour(chat_time) as chat_hour, count(*) from chat group by chat_hour order by chat_hour';
91 // ADIMINISTRATOR MENU
96 <tr
><td
><img src
="gfx/rss.png"></td
><td
class="link_header">Feeds
</td
></tr
>
97 <tr
><td
></td
><td
><a href
="comment_feed.php">Full Comments
</a
></td
></tr
>
98 <tr
><td
></td
><td
><a href
="assignment_feed.php">Assignments Modified
</a
></td
></tr
>
102 <tr
><td
><img src
="gfx/report.png"></td
><td
class="link_header">Assignments
</td
></tr
>
103 <tr
><td
></td
><td
><a href
="assignment_add.php">Add
New Assignment
</a
></td
></tr
>
107 <tr
><td
><img src
="gfx/user_female.png"></td
><td
class="link_header">Users
</td
></tr
>
108 <tr
><td
></td
><td
><a href
="enrollment.php">Enrollment Manager
</a
></td
></tr
>
109 <tr
><td
></td
><td
><a href
="enrollment_new.php">New Enrollment
</a
></td
></tr
>
110 <tr
><td
></td
><td
><a href
="password_change.php">Change Personal Password
</a
></td
></tr
>
111 <tr
><td
></td
><td
><a href
="password_change_user.php">Change User Password
</a
></td
></tr
>
115 <tr
><td
><img src
="gfx/cog.png"></td
><td
class="link_header">Workflows
</td
></tr
>
116 <tr
><td
></td
><td
><a href
="index.php">Comments From Students
</a
></td
></tr
>
117 <tr
><td
></td
><td
><a href
="workflow_comments.php">Most Recent Comments
</a
></td
></tr
>
118 <tr
><td
></td
><td
><a href
="workflow_ungraded.php">Assignments Ready
For Grading
</a
></td
></tr
>
122 <tr
><td
><img src
="gfx/database.png"></td
><td
class="link_header">System Admin
</td
></tr
>
123 <tr
><td
></td
><td
><a href
="adminer.php">SQL Admin
</a
></td
></tr
>
127 <table
class="gridtable">
128 <tr
><th
>Stat
</th
><th
>Value
</th
><th
>Human Time
</th
><th
>Last Updated
</th
></tr
>
129 <tr
><td
>Chat Messages
:</td
><td
><?php
echo $chat_count ?
></td
><td
><?php
echo $chat_max_time ?
></td
><td
><?php
echo $chat_max ?
></td
></tr
>
130 <tr
><td
>Files
:</td
><td
><?php
echo $file_count; ?
></td
><td
><?php
echo $file_time; ?
></td
><td
><?php
echo $file_max; ?
></td
></tr
>
131 <tr
><td
>File Comments
:</td
><td
><?php
echo $filecomm_count; ?
></td
><td
><?php
echo $filecomm_time; ?
></td
><td
><?php
echo $filecomm_max; ?
></td
></tr
>
132 <tr
><td
>Comments
:</td
><td
><?php
echo $comment_count; ?
></td
><td
><?php
echo $comment_time; ?
></td
><td
><?php
echo $comment_max; ?
></td
></tr
>
133 <tr
><td
>Assignments
:</td
><td
><?php
echo $assignment_count; ?
></td
><td
><?php
echo $assignment_time; ?
></td
><td
><?php
echo $assignment_max; ?
></td
></tr
>
134 <tr
><td
>Users
:</td
><td colspan
=3><?php
echo $user_count; ?
></td
></tr
>
135 <tr
><td
>Users Locked
:</td
><td colspan
=3><?php
echo $std_locked; ?
></td
></tr
>
136 <tr
><td
>Current Time
:</td
><td colspan
=3><?php
echo date("F d, Y h:i" ,time()); ?
></td
></tr
>
141 } else { // STUDENT MENU
144 $sql = 'select count(*), max(time_post) from files where user_id = '.$user_id;
146 $result = mysql_query($sql);
147 $row = mysql_fetch_row($result);
148 $file_count = $row[0];
149 if($file_count == 0) {
151 $file_time = "Never";
154 $file_time = absHumanTiming($file_max);
157 $sql ='select count(*), max(timeposted) from comments where user_id = '.$user_id;
159 $result = mysql_query($sql);
160 $row = mysql_fetch_row($result);
161 $comment_count = $row[0];
162 if($comment_count == 0) {
163 $comment_max = "Never";
164 $comment_time = "Never";
166 $comment_max = $row[1];
167 $comment_time = absHumanTiming($comment_max);
170 $sql = 'select count(*), max(timeposted) from filecom where user_id = '.$user_id;
172 $result = mysql_query($sql);
173 $row = mysql_fetch_row($result);
174 $filecomm_count = $row[0];
175 if($filecomm_count == 0) {
176 $filecomm_max = "Never";
177 $filecomm_time = "Never";
179 $filecomm_max = $row[1];
180 $filecomm_time = absHumanTiming($filecomm_max);
186 <tr
><td
><img src
="gfx/rss.png"></td
><td
class="link_header">Feeds
</td
></tr
>
187 <tr
><td
></td
><td
><a href
="comment_feed.php">Full Comments
</a
></td
></tr
>
188 <tr
><td
></td
><td
><a href
="assignment_feed.php">Assignments Modified
</a
></td
></tr
>
192 <tr
><td
><img src
="gfx/world_link.png"></td
><td
class="link_header">Links
</td
></tr
>
193 <tr
><td
></td
><td
><a href
="password_change.php">Change Password
</a
></td
></tr
>
197 <table
class="gridtable">
198 <tr
><th
>Stat
</th
><th
>Count
</th
><th
>Human Time
</th
><th
>Last Updated
</th
></tr
>
199 <tr
><td
>Files
:</td
><td
><?php
echo $file_count; ?
></td
><td
><?php
echo $file_time; ?
></td
><td
><?php
echo $file_max; ?
></td
></tr
>
200 <tr
><td
>File Comments
:</td
><td
><?php
echo $filecomm_count; ?
></td
><td
><?php
echo $filecomm_time; ?
></td
><td
><?php
echo $filecomm_max; ?
></td
></tr
>
201 <tr
><td
>Comments
:</td
><td
><?php
echo $comment_count; ?
></td
><td
><?php
echo $comment_time; ?
></td
><td
><?php
echo $comment_max; ?
></td
></tr
>