} } } else { tpl_set_var('confirm', ''); } $stmt = XDb::xSql("SELECT cache_status.id AS cs_id, cache_status.pl AS cache_status, user.username AS username,\n user.user_id AS user_id, caches.cache_id AS cache_id, caches.name AS cachename,\n IFNULL(`cache_location`.`adm3`, '') AS `adm3`, caches.date_created AS date_created\n FROM cache_status, user, (\n `caches` LEFT JOIN `cache_location` ON `caches`.`cache_id` = `cache_location`.`cache_id`)\n WHERE cache_status.id = caches.status\n AND caches.user_id = user.user_id\n AND caches.status = 4\n ORDER BY caches.date_created DESC"); $row_num = 0; while ($report = XDb::xFetchArray($stmt)) { $assignedUserId = getAssignedUserId($report['cache_id']); if ($row_num % 2) { $bgcolor = "bgcolor1"; } else { $bgcolor = "bgcolor2"; } $content .= "<tr>\n"; $content .= "<td class='" . $bgcolor . "'><a class=\"links\" href='viewcache.php?cacheid=" . $report['cache_id'] . "'>" . nonEmptyCacheName($report['cachename']) . "</a><br/><span style=\"font-weight:bold;font-size:10px;color:blue;\">" . $report['adm3'] . "</span></td>\n"; $content .= "<td class='" . $bgcolor . "'>" . $report['date_created'] . "</td>\n"; $content .= "<td class='" . $bgcolor . "'><a class=\"links\" href='viewprofile.php?userid=" . $report['user_id'] . "'>" . $report['username'] . "</a></td>\n"; $content .= "<td class='" . $bgcolor . "'><img src=\"tpl/stdstyle/images/blue/arrow.png\" alt=\"\" /> <a class=\"links\" href='viewpendings.php?user_id=" . $report['user_id'] . "&cacheid=" . $report['cache_id'] . "&action=1'>" . tr('accept') . "</a><br/>\n <img src=\"tpl/stdstyle/images/blue/arrow.png\" alt=\"\" /> <a class=\"links\" href='viewpendings.php?user_id=" . $report['user_id'] . "&cacheid=" . $report['cache_id'] . "&action=2'>" . tr('block') . "</a><br/>\n <img src=\"tpl/stdstyle/images/blue/arrow.png\" alt=\"\" /> <a class=\"links\" href='viewpendings.php?cacheid=" . $report['cache_id'] . "&assign=" . $usr['userid'] . "'>" . tr('assign_yourself') . "</a></td>\n"; $content .= "<td class='" . $bgcolor . "'><a class=\"links\" href='viewprofile.php?userid=" . $assignedUserId . "'>" . getUsername($assignedUserId) . "</a><br/></td>"; $content .= "</tr>\n"; $row_num++; } tpl_set_var('content', $content); } else { $tplname = 'viewpendings_error'; } tpl_BuildTemplate(); ?>
$bgcolor = "bgcolor2"; } $content .= "<tr>\n"; $userLastLogin = XDb::xMultiVariableQueryValue("SELECT last_login FROM user WHERE user_id=:1 ", 0, $report['cache_ownerid']); if ($userLastLogin == "0000-00-00 00:00:00") { $userlogin = "******"; } else { $userlogin = strftime("%Y-%m-%d", strtotime($userLastLogin)); } if ($usr['userid'] == $report['responsible_id']) { $addborder = "style='border-width:2px;'"; } else { $addborder = ""; } $content .= "<td " . $addborder . " class='" . $bgcolor . "'><span class='content-title-noshade-size05'>" . $report['report_id'] . "</span></td>\n"; $content .= "<td " . $addborder . " class='" . $bgcolor . "'><span class='content-title-noshade-size05'>" . $report['submit_date'] . "</span></td>\n"; $content .= "<td " . $addborder . " class='" . $bgcolor . "'><a class='content-title-noshade-size04' title=\"Skrzynka ostatnio modyfikowana: " . strftime("%Y-%m-%d", strtotime($report['lastmodified'])) . "\" href='viewcache.php?cacheid=" . $report['cache_id'] . "'>" . nonEmptyCacheName($report['cachename']) . "</a> <br/> <a title=\"Użytkownik logowal się ostatnio: " . $userlogin . "\" class=\"links\" href=\"viewprofile.php?userid=" . $report['cache_ownerid'] . "\">" . getUsername($report['cache_ownerid']) . "</a><br/><span style=\"font-weight:bold;font-size:10px;color:blue;\">" . $report['adm3'] . "</span></td>\n"; $content .= "<td " . $addborder . " class='" . $bgcolor . "'><span class='content-title-noshade-size05'>" . colorCacheStatus($report['cache_status'], $report['c_status']) . "</span></td>\n"; $content .= "<td " . $addborder . " class='" . $bgcolor . "'><a class='content-title-noshade-size05' href='viewreport.php?reportid=" . $report['report_id'] . "'>" . writeReason($report['type']) . "</a></td></font>\n"; $content .= "<td " . $addborder . " class='" . $bgcolor . "'><a class='content-title-noshade-size05' href='viewprofile.php?userid=" . $report['user_id'] . "'>" . $report['username'] . "</a></td>\n"; $content .= "<td " . $addborder . " class='" . $bgcolor . "'><a class='content-title-noshade-size05' href='viewprofile.php?userid=" . $report['responsible_id'] . "'>" . getUsername($report['responsible_id']) . "</a></td>\n"; $content .= "<td " . $addborder . " class='" . $bgcolor . "' width='60'><span class='content-title-noshade-size05'>" . writeStatus($report['status']) . "</span></td>\n"; $content .= "<td " . $addborder . " class='" . $bgcolor . "'><span class='content-title-noshade-size05'>" . ($report['changed_by'] == '0' ? '' : getUsername($report['changed_by']) . '<br/>(' . $report['changed_date'] . ')') . "</span></td>\n"; $content .= "</tr>\n"; $row_num++; } tpl_set_var('content', $content); } else { $tplname = 'viewreports_error'; } tpl_BuildTemplate();
$username_sql = "SELECT username FROM users WHERE user_id='" . sql_escape($report['user_id']) . "'"; $username_query = mysql_query($sql) or die("DB error"); $username = mysql_result($username_query, 0); $admins_sql = "SELECT user_id, username FROM user WHERE admin=1"; $admins_query = mysql_query($admins_sql); $userloginsql = "SELECT last_login FROM user WHERE user_id='" . sql_escape($report['cache_ownerid']) . "'"; $userlogin_query = mysql_query($userloginsql) or die("DB error"); if (mysql_result($userlogin_query, 0) == "0000-00-00 00:00:00") { $userlogin = "******"; } else { $userlogin = strftime("%Y-%m-%d", strtotime(mysql_result($userlogin_query, 0))); } $content .= "<tr>"; $content .= "<td><span class='content-title-noshade-size05'>" . $report['report_id'] . "</span></td>"; $content .= "<td><span class='content-title-noshade-size05'>" . $report['submit_date'] . "</span></td>"; $content .= "<td><a class='content-title-noshade-size04' href='viewcache.php?cacheid=" . $report['cache_id'] . "'>" . nonEmptyCacheName($report['cachename']) . "</a><br/> <a title=\"Użytkownik logowal się ostatnio: " . $userlogin . "\" class=\"links\" href=\"viewprofile.php?userid=" . $report['cache_ownerid'] . "\">" . getUsername($report['cache_ownerid']) . "</a><br/><span style=\"font-weight:bold;font-size:10px;color:blue;\">" . $report['adm3'] . "</span></td>"; $content .= "<td><span class='content-title-noshade-size05'>" . colorCacheStatus($report['cache_status'], $report['c_status']) . "</span></td>"; $content .= "<td><span class='content-title-noshade-size05'>" . writeReason($report['type']) . "</span></td>"; $content .= "<td><a class='content-title-noshade-size05' href='viewprofile.php?userid=" . $report['user_id'] . "'>" . $report['username'] . "</a></td>"; //$content .= "<td><a href='viewprofile.php?userid=".$report['responsible_id']."'>".getUsername($report['responsible_id'])."</a></td>"; $content .= "<td>"; $content .= "<select name='respSel'>"; $content .= "<option value='0'>brak</option>"; $selected = ""; while ($admins = mysql_fetch_array($admins_query)) { if ($report['responsible_id'] == $admins['user_id']) { $selected = "selected='selected'"; } else { $selected = ""; } $content .= "<option value='" . $admins['user_id'] . "' {$selected}>" . $admins['username'] . "</option>";