Файл: _rootadmin/_whoislogs.inc.php
Строк: 111
<?
    if ($sub == "delete" and $id) {
        checkAdminAccess('whoisLogsDelete',1);
        @mysql_query("delete from whois_logs where id='$id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
        writeAdminLog("Удалена запись из логов WHOIS ID # $id");
        print "Запись успешно удалена.<BR><BR>";
        $sub = "";
    }
    if (!$sub) {
        checkAdminAccess('whoisLogsRead',1);
            $myShow = $_SESSION["whoisLogsShow"]; if (!$myShow) { $myShow="all"; }
            if ($show and $show != $myShow) { $myShow = $show; $_SESSION["whoisLogsShow"] = $myShow; }
            if ($myShow == "all") {
                    $where = "";
            } else if ($myShow == "free") {
                    $where = "where result='free'";
            } else if ($myShow == "registered") {
                    $where = "where result='registered'";
            } else if ($myShow == "error") {
                    $where = "where result='error'";
            }
            ?>
            <table width=99%>
            <tr>
            <Td valign=top>
                    <table width=250>
                    <tr><td align=center bgcolor=<? print $font_head?>><B>Фильтр</b></td></tr>
                    <tr><td bgcolor=<? print $font_row?> align=center>
                            <form method=post>
                            <select name=show>
                            <option value=all <? if ($myShow == 'all') {print "selected";} ?>>Все логи</option>
                            <option value=free <? if ($myShow == 'free') {print "selected";} ?>>Домен свободен</option>
                            <option value=registered <? if ($myShow == 'registered') {print "selected";} ?>>Домен занят</option>
                            <option value=error <? if ($myShow == 'error') {print "selected";} ?>>Ошибка</option>
                            </select>
                            <input type=submit value=Показать>
                            </form>
                    </td></tr>
                    </table>
            </td>
            <td width=100%></td>
            </tr>
            </table><BR>
            <?
            $r = @mysql_query("select * from whois_logs $where order by id desc") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
            $rows = mysql_num_rows($r);
            list($start, $perPage, $txt) = MakePages($page, $rows, $linkAddon);
            ?>
            <table cellpadding=3 width=99%>
            <tr><td colspan=8 align=right><? print $txt?></td></tr>
            <tr><td colspan=8 align=center bgcolor=<? print $font_head?>><B>Логи WHOIS</b></td></tr>
            <tr bgcolor=<? print $font_head?> align=center><td>ID #</td><td>Дата</td><td>Логин</td><td>IP</td><td>Домен</td><td>Результат</td><td></td></tr>
            <?
            $r = @mysql_query("select * from whois_logs $where order by id desc LIMIT $start,$perPage") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
            $cnt=0;
            while ($rr = @mysql_fetch_object($r)) {
            getfont();
            $cnt++;
            $user = GetUserById($rr->uid);
            if ($user->id) {
                $user->login = "<a href=?do=fullinfo&id=$user->id>$user->login</a>";
            }
            $delete="<A href=?do=$do&sub=delete&id=$rr->id onclick="javascript: return confirm('Вы уверены, что хотите удалить запись?');"><img src=./_rootimages/del.gif border=0 alt='Удалить запись' ></a>";
            if ($rr->result == "error") { $rr->result = "<font color=red>".$rr->result."</font>"; }
            else if ($rr->result == "free") { $rr->result = "<font color=green>".$rr->result."</font>"; }
            ?>
            <tr bgcolor="<? print $font_row?>" height=30>
            <td valign=middle align=center> <? print $rr->id?> </td>
            <td align=center> <? print $rr->dt?> </td>
            <td align=center> <? print $user->login?> </td>
            <td align=center> <? print $rr->ip?> </td>
            <td align=center> <? print $rr->domain?> </td>
            <td align=center> <? print $rr->result?> </td>
            <td align=center><? print $delete?></td>
            </tr>
            <?
        }
        ?>
        <tr bgcolor=<? print $font_head?>><Td colspan=8>Всего записей: <? print $rows?>, записей на странице: <? print $cnt?></td></td></tr>
            <tr><td colspan=8 align=right><? print $txt?></td></tr>
        </table><br><Center>
        <?
    }
?>