-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck.php
executable file
·211 lines (183 loc) · 6.71 KB
/
check.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" language="javascript" src="admin/admin_scripts.js" ></script>
</head>
<body>
<?php
print_r($_POST);
?>
<form name="adminForm" method="post" action="check.php">
<input type="checkbox" name="toggle" value="" onClick="checkAll(4);" >
<br>
<input name="cid[]" id="cb0" type="checkbox" value="" onClick="isChecked(this.checked);"><br>
<input name="cid[]" id="cb1" type="checkbox" value="" onClick="isChecked(this.checked);"><br>
<input name="cid[]" id="cb2" type="checkbox" value="" onClick="isChecked(this.checked);"><br>
<input name="cid[]" id="cb3" type="checkbox" value="" onClick="isChecked(this.checked);"><br>
<input type="submit">
</form>
</body>
</html>
//print_r($_POST);
$db = new database;
$sql = " select * from article_versions av ";
$sql .= " where av.stageID=5 and av.status='published'";
if (!($result = $db->query( $sql ))){
die ( 'Error:' . $db->error());
}
$article_versions = array();
while( $row = $db->fetcharray() ) {
$article_versions[] = $row;
}
$row_data = '';
for( $i = 0; $i < count($article_versions) ; $i++ ) {
if ( $article_versions[$i]->articleID ) {
(($i % 2) == 0 )? $bgcolor = "" : $bgcolor="#F5F5F5";
$row_data .= '<tr class="tdhover" id="tdata" bgcolor = "'. $bgcolor . '">';
$row_data .= '<td>';
$row_data .= $i+1;
$row_data .= '</td>';
$row_data .= '<td>';
$row_data .= '<input type="checkbox" name="checkitem[]" id="checkitem[]" value="' . $article_versions[$i]->articleID . '">';
$row_data .= '</td>';
$row_data .= '<td>';
$row_data .= '<a href="' . VIEW_ARTICLE_URL . $article_versions[$i]->articleID . '">';
$row_data .= ' ' . $article_versions[$i]->title;
$row_data .= '</a>';
$row_data .= '</td>';
$row_data .= '<td>';
$author_name = getArticle_authors ( $article_versions[$i]->articleID );
$row_data .= ' ' . $author_name;
$row_data .= '</td>';
$row_data .= '<td>';
$category_name = getCategory_name( $article_versions[$i]->articleID );
$row_data .= ' ' . $category_name;
$row_data .= '</td>';
$row_data .= '<td>';
$category_name = getFrontpage_type( $article_versions[$i]->articleID );
$row_data .= ' ' . $category_name;
$row_data .= '</td>';
$row_data .= '<td>';
$row_data .= ' ' . getStage_name ( $article_versions[$i]->stageID );
$row_data .= '</td>';
$row_data .= '<td>';
$row_data .= ' ' . friendlyDate2($article_versions[$i]->created);
$row_data .= '</td>';
switch ( $_SESSION['stageID'] ) {
case 5:// published date of the article..can be viewd by the admin only???
$row_data .= '<td>';
$date = ($article_versions[$i]->dateline)?friendlyDate2($article_versions[$i]->dateline):'0';
$row_data .= ' ' . $date;
$row_data .= '</td>';
break;
default:
$row_data .= '<td>';
$date = ($article_versions[$i]->modified)?friendlyDate2($article_versions[$i]->modified):'0';
$row_data .= ' ' . $date;
$row_data .= '</td>';
break;
}
$row_data .= '</tr>';
}
}
if ( isset($_POST['submit'] )) {
$year = $_POST['year'];
$month = $_POST['month'];
$month2 = strdate("$month",'');
if ($_POST['reportype']==2 ){
$optreportype .= '<option value="1" >Usage Report</option>';
$optreportype .= '<option value="2" selected>Lists of member Report</option>';
$optreportype .= '<option value="3" >News Contents Report</option>';
// obtain list of users
$sql = " select * from content_users ";
if (!($result = $db->query( $sql ))){
die ( 'Error:' . $db->error());
}
$content_users = array();
while ( $row = $db->fetcharray() ) $content_users[] = $row;
$row_data2 = '';
for( $i = 0; $i < count($content_users); $i++ ){
if ( $content_users[$i]->userID ) {
(($i % 2) == 0 )? $bgcolor = "" : $bgcolor="#F5F5F5";
$row_data2 .= '<tr class="tdhover" id="tdata" bgcolor = "'. $bgcolor . '" align = "left">';
$row_data2 .= '<td>';
$row_data2 .= $i+1;
$row_data2 .= '</td>';
$row_data2 .= '<td align="left">';
$row_data2 .= '<a href="' . VIEW_PROFILE_URL_MANAGER . $content_users[$i]->userID . '">';
$row_data2 .= '<input type="hidden" value = "' . $content_users[$i]->userID . '">';
$row_data2 .= ' '. $content_users[$i]->fullname;
$row_data2 .= '</td>';
$row_data2 .= '<td align="left">';
$row_data2 .= ' '. $content_users[$i]->username;
$row_data2 .= '</td>';
$row_data2 .= '<td align="left">';
if ($content_users[$i]->is_enabled) {
$row_data2 .= '<img src="images/publish_x.png" width="12" height="12" border="0" alt="" />';
}
else{
$row_data2 .= '<img src="images/tick.png" width="12" height="12" border="0" alt="" />';
}
$row_data2 .= '</td>';
$row_data2 .= '<td align="left">';
$group_name = getGroup_name ( $content_users[$i]->usertypeID );
$row_data2 .= ' '.$group_name;
$row_data2 .= '</td>';
$row_data2 .= '<td>';
$row_data2 .= ' '.$content_users[$i]->email;
$row_data2 .= '</td>';
$row_data2 .= '<td>';
if ($content_users[$i]->phoneno){
$contactno = $content_users[$i]->phoneno;
}
else{
if ($content_users[$i]->celno){
$contactno = $content_users[$i]->celno;
}
else $contactno = '--';
}
$row_data2 .= ' '. $contactno;
$row_data .= '</td>';
$row_data2 .= '</tr>';
}
}
}
if ($_POST['reportype']==3 ){
$optreportype .= '<option value="1" >Usage Report</option>';
$optreportype .= '<option value="2" >Lists of member Report</option>';
$optreportype .= '<option value="3" selected >News Contents Report</option>';
}
if( $_POST['reportype'] == 1 ) {
include('../graph/graph_creator.php');
$sql1 = "select count(people_online.member) as Visitors from people_online where
people_online.member = 'n'
and month = '$month'
and year = '$year'
";
$sql2 = "select count(people_online.member) as Members from people_online where
people_online.member = 'y'
and month = '$month'
and year = '$year'
";
$v=$db->query( $sql1 );
$m=$db->query( $sql2 );
$visitors=$db->fetcharray($v);
$members=$db->fetcharray($m);
if ($visitors->Visitors == 0 ) {
$data[0] = "-1";
}else{
$data[0] = $visitors->Visitors;
}
if ($members->Members == 0 ) {
$data[1] = "0";
}else{
$data[1] = $members->Members;
}
$leg[0] = 'Visitors';
$leg[1] = 'Members';
$graph = new graph_creator( 300, 460, "Usage Report as of $month2 $year" , $leg, $data );
$graph->create_pie_graph();
}
}