Example #1
0
            $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_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>";
 }