} echo '<td style="white-space: nowrap"><a target="_blank" href="' . $row['website'] . '">' . $row['host'] . '</a></td>'; echo '<td style="white-space: nowrap">' . ($row['monitorType'] == 'ip' ? 'IP' : 'Domain') . '</td>'; echo '<td>' . $row['description'] . '</td>'; echo '<td style="text-align: center;">'; switch ($row['importance']) { case 3: echo '<span class="label label-primary">High</span>'; break; case 2: echo '<span class="label label-info">Medium</span>'; break; case 1: echo '<span class="label label-default">Low</span>'; break; } echo '</td>'; echo '<td style="white-space: nowrap">' . number_format($row['blocksToday'], 0) . '</td>'; echo '<td style="white-space: nowrap">' . number_format($row['cleanToday'], 0) . '</td>'; echo '<td style="white-space: nowrap">' . number_format($row['blocksYesterday'], 0) . '</td>'; echo '<td style="white-space: nowrap">' . number_format($row['cleanYesterday'], 0) . '</td>'; echo '</tr>'; } $mysql->close(); ?> </tbody> </table> </div> <?php include 'footer.inc.php';
public static function validateLogin($userName, $passwd, $api = false, $apiKey = '') { $mysql = new _MySQL(); $mysql->connect(Setup::$connectionArray); $sql = "\n\t\tselect username\n\t\tfrom users\n\t\twhere "; if (trim($apiKey) != '') { $sql .= " apiKey = '" . $mysql->escape($apiKey) . "'"; } else { $sql .= " passwd = '" . $mysql->escape(md5($passwd)) . "' \n\t\t\tand username = '******'"; } $rs = $mysql->runQuery($sql); $id = 0; while ($row = mysqli_fetch_array($rs, MYSQL_ASSOC)) { $id = 1; } $mysql->close(); return $id; }