forked from domainmod/domainmod
-
Notifications
You must be signed in to change notification settings - Fork 2
/
updates.php
200 lines (159 loc) · 6.47 KB
/
updates.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
<?php
// /updates.php
//
// DomainMOD is an open source application written in PHP & MySQL used to track and manage your web resources.
// Copyright (C) 2010 Greg Chetcuti
//
// DomainMOD is free software; you can redistribute it and/or modify it under the terms of the GNU General
// Public License as published by the Free Software Foundation; either version 2 of the License, or (at your
// option) any later version.
//
// DomainMOD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along with DomainMOD. If not, please see
// http://www.gnu.org/licenses/
?>
<?php
include("_includes/start-session.inc.php");
include("_includes/config.inc.php");
include("_includes/database.inc.php");
include("_includes/software.inc.php");
include("_includes/auth/auth-check.inc.php");
include("_includes/system/functions/pagination.inc.php");
$page_title = $software_title . " Updates";
$software_section = "updates";
// Search Navigation Variables
$numBegin = $_GET['numBegin'];
$begin = $_GET['begin'];
$num = $_GET['num'];
$id = $_GET['id'];
if ($id != "") {
$sql_real_id = "SELECT u.id, ud.id AS update_id
FROM `updates` AS u, update_data AS ud
WHERE u.id = ud.update_id
AND u.id = '" . mysql_real_escape_string($id) . "'";
$result_real_id = mysql_query($sql_real_id,$connection) or die(mysql_error());
if (mysql_num_rows($result_real_id) == 0) {
header("Location: updates.php");
exit;
} else {
/*
*/
}
}
?>
<?php include("_includes/doctype.inc.php"); ?>
<html>
<head>
<title><?=$software_title?> :: <?=$page_title?></title>
<?php include("_includes/layout/head-tags.inc.php"); ?>
</head>
<body>
<?php include("_includes/layout/header.inc.php"); ?>
<?php if ($id == "" && $_SESSION['are_there_updates'] == "1") { ?>
[<a href="_includes/system/mark-updates-read.inc.php?direct=1">mark all updates as read</a>]<BR><BR>
<?php } ?>
<?php
if ($id != "") {
$sql = "SELECT id, name, `update`, insert_time
FROM updates
WHERE id = '" . mysql_real_escape_string($id) . "'
ORDER BY insert_time desc, id desc";
} else {
$sql = "SELECT id, name, `update`, insert_time
FROM updates
ORDER BY insert_time desc, id desc";
}
$result_limit = 15;
$totalrows = mysql_num_rows(mysql_query($sql));
$navigate = pageBrowser($totalrows,15,$result_limit, "",$_GET[numBegin],$_GET[begin],$_GET[num]);
$sql = $sql.$navigate[0];
$result = mysql_query($sql,$connection); ?>
<?php if ($id == "") { ?>
<?php include("_includes/layout/pagination.menu.inc.php"); ?><BR>
<?php } ?>
<table class="update-block-outer"><?php
while ($row = mysql_fetch_object($result)) {
if ($row->update != "") { ?>
<tr>
<td class="update-block-left">
<strong><?=date("Y-m-d", strtotime($row->insert_time))?></strong>
</td>
<td class="update-block-right"><?php
if ($id == "") { ?>
<a href="updates.php?id=<?=$row->id?>"><font class="subheadline"><?=$row->name?></font></a>
<?php
$sql_exists = "SELECT *
FROM update_data
WHERE user_id = '" . $_SESSION['user_id'] . "'
AND update_id = '" . $row->id . "'";
$result_exists = mysql_query($sql_exists,$connection);
if (mysql_num_rows($result_exists) != 0) { ?>
<font class="default_highlight">*NEW*</font> [<a href="_includes/system/mark-updates-read.inc.php?direct=1&id=<?=$row->id?>">mark read</a>]<?php
}
} else { ?>
<font class="subheadline"><?=$row->name?></font>
<?php
$sql_exists = "SELECT *
FROM update_data
WHERE user_id = '" . $_SESSION['user_id'] . "'
AND update_id = '" . $row->id . "'";
$result_exists = mysql_query($sql_exists,$connection);
if (mysql_num_rows($result_exists) != 0) { ?>
<font class="default_highlight">*NEW*</font> [<a href="_includes/system/mark-updates-read.inc.php?direct=1&id=<?=$row->id?>">mark read</a>]<?php
}
} ?>
</td>
</tr>
<tr>
<td class="update-block-left">
</td>
<td class="update-block-right">
<?=$row->update?>
<?php if ($id == "") echo "<BR><BR>"; ?>
</td>
</tr><?php
} else { ?>
<tr>
<td class="update-block-left">
<strong><?=date("Y-m-d", strtotime($row->insert_time))?></strong>
</td>
<td class="update-block-right"><?php
if ($id == "") { ?>
<a href="updates.php?id=<?=$row->id?>"><font class="subheadline"><?=$row->name?></font></a>
<?php
$sql_exists = "SELECT *
FROM update_data
WHERE user_id = '" . $_SESSION['user_id'] . "'
AND update_id = '" . $row->id . "'";
$result_exists = mysql_query($sql_exists,$connection);
if (mysql_num_rows($result_exists) != 0) { ?>
<font class="default_highlight">*NEW*</font> [<a href="_includes/system/mark-updates-read.inc.php?direct=1&id=<?=$row->id?>">mark read</a>]<?php
}
} else { ?>
<font class="subheadline"><?=$row->name?></font>
<?php
$sql_exists = "SELECT *
FROM update_data
WHERE user_id = '" . $_SESSION['user_id'] . "'
AND update_id = '" . $row->id . "'";
$result_exists = mysql_query($sql_exists,$connection);
if (mysql_num_rows($result_exists) != 0) { ?>
<font class="default_highlight">*NEW*</font> [<a href="_includes/system/mark-updates-read.inc.php?direct=1&id=<?=$row->id?>">mark read</a>]<?php
}
}
if ($id == "") echo "<BR><BR>";
?>
</td>
</tr><?php
}
} ?>
</table>
<?php if ($id == "") { ?>
<?php include("_includes/layout/pagination.menu.inc.php"); ?>
<?php } ?>
<?php include("_includes/layout/footer.inc.php"); ?>
</body>
</html>