Файл: pages/journal.php
Строк: 51
<?
include_once('../apahe/ini.php');
$urlup='/pages/journal';
$inc['title'] = 'Журнал';
include_once('../apahe/top.php');
if (!isset($apache)){
header ('location: /input.dll');
exit;
}
switch ($_GET['selest']){
default:
$apa_j = mysql_result(mysql_query("SELECT COUNT(*) FROM `apache-j` WHERE `id-apache` = '".$apache['id']."'"), 0);
if ($apa_j!=0){
echo '<div class="main-text">';
echo '<a href="journal.dll?selest=j-delete" title="Очистить журнал">Очистить журнал</a>';
echo '</div>';
}
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `apache-j` WHERE `id-apache` = '".$apache['id']."'"), 0);
nav_start($total, 10);
if ($total != 0) {
$journal_c = mysql_query("SELECT * FROM `apache-j` WHERE `id-apache` = '".$apache['id']."' ORDER BY `date` DESC LIMIT $start, 10");
while ($journal = mysql_fetch_assoc($journal_c)) {
mysql_query("UPDATE `apache-j` SET `read` = '0' WHERE `id-apache` = '".$apache['id']."'");
echo '<div class="main-href">';
echo '<table width="100%" cellspacing="0" cellpadding="0">';
echo '<tr><td class="apa-l">';
echo '<a href="/id-'.int($journal['id-apach']).'.dll" title="'.name($journal['id-apach']).'">';
echo ''.apache($journal['id-apach']).''.name($journal['id-apach']).'</a>';
echo '</td>';
echo '<td class="apa-r">';
echo '<time>'.vtime($journal['date']).'</time>';
echo '</td></tr>';
echo '</table>';
echo ''.out($journal['message']).' ';
if ($journal['name-url'])echo '<a href="'.$journal['url'].'.dll" title="'.$journal['name-url'].'">'.$journal['name-url'].'</a></br>';
echo '<a href="journal.dll?selest=delete&id='.$journal['id'].'" title="Удалить">[Удал]</a>';
echo '</div>';
}}else{
error('Журнал пуст.');
}
view_nav('/pages/journal.dll');
break;
case 'delete':
$journal = mysql_fetch_assoc(mysql_query("SELECT * FROM `apache-j` WHERE `id` = '".int($_GET['id'])."'"));
if (!$journal){
header ('location: /pages/journal.dll');
exit;
}
mysql_query("DELETE FROM `apache-j` WHERE `id` = '".int($_GET['id'])."'");
header('Location: /pages/journal.dll');
break;
case 'j-delete':
mysql_query("DELETE FROM `apache-j` WHERE `id-apache` = '".$apache['id']."'");
header('Location: /pages/journal.dll');
break;
}
include_once('../apahe/bottom.php');
?>