Размер файла: 5.93Kb
<?php
/*
Класс: HtmlPage
*/
class HtmlPage
{
function HtmlPage($url='')
//
// Конструктор класса, создает header HTML-документа
//
{
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>'.GB_TITLE.'</title><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><link rel="stylesheet" href="'.UP_PATH.'css/style.css"></head><body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" bgcolor="#f7f7f7"><script language="JavaScript">function paste(text){ var input=document.poster.post; input.value=input.value+text+" "; input.focus();}</script><center>';
}
function ShowTitle()
//
// Выводит шапку страницы
//
{
echo '<table class="main" width="610" cellspacing="0" cellpadding="0"><tbody><tr><td align="center" bgcolor="#747474"><br /></td></tr><tr><td align="center" bgcolor="#747474"></td></tr><tr><td align="center">';
}
function ShowAddForm()
//
// Выводит форму добавления сообщения
//
{
$name = (isset($_POST['name']) ? $_POST['name'] : (isset($_SESSION['name']) ? $_SESSION['name'] : (isset($_COOKIE['name']) ? $_COOKIE['name'] : '')));
$email = (isset($_POST['email']) ? $_POST['email'] : (isset($_SESSION['email']) ? $_SESSION['email'] : (isset($_COOKIE['email']) ? $_COOKIE['email'] : '')));
$post = (isset($_POST['post']) ? $_POST['post'] : '');
echo
<<<END
<form method="post" name="poster" action="{$_SERVER['PHP_SELF']}"><table width="100%" cellspacing="0" cellpadding="0"><tbody><tr><td class="inputTitle">Ник:</td><td><input type="text" name="name" value="{$name}" maxlength="32" /></td></tr><tr><td class="inputTitle">E-mail:</td><td><input type="text" name="email" value="{$email}" maxlength="32" /></td></tr></tbody></table><textarea name="post">{$post}</textarea><br /><input type="submit" value="Добавить" /><table class="include" cellspacing="0" cellpadding="0" align="left"><tbody><tr class="buttons"><td><a href="javascript:paste('[b][/b]')"><img src="img/bold.gif" width="20" height="20" alt="Bold" border="0" /><br /></a></td><td><a href="javascript:paste('[i][/i]')"><img src="img/italic.gif" width="20" height="20" alt="Italic" border="0" /><br /></a></td><td><a href="javascript:paste('[link][/link]')"><img src="img/link.gif" width="20" height="20" alt="Link" border="0" /><br /></a></td><td><a href="javascript:paste('[email][/email]')"><img src="img/email.gif" width="20" height="20" alt="E-mail" border="0" /><br /></a></td><td><!--a href=""><img src="/img/smiles.gif" width="60" height="20" alt="Смайлы" border="0" /--><br /></a></td></tr></tbody></table></form><br clear="all" />
END;
}
function ShowAuthoriseForm()
//
// Выводит форму авторизации
//
{
echo '</td></tr><tr><td bgcolor="#747474" align="left"><form class="admin" method="post" action="'.$_SERVER['PHP_SELF'].'"><input type="text" name="login" maxlength="32" /><BR><input type="password" name="password" maxlength="32" /><BR><input type="submit" value="Вход" /></form>';
}
function ShowAdminBottom()
//
// Выводит средства управления на странице гостевой книги
//
{
echo '</td></tr><tr><td class="record_head" style="background-color: #747474; border: #747474;" align="left"><a href="admin/">Администраторская</a> | <a href="?exit">Выйти</a>';
}
function ShowNavLine($cur_page, $max_page)
{
if ($max_page>1)
{
echo '<table class="navigation" cellspacing="0" cellpadding="0"><tbody><tr><td class="nav_title" width="100" align="center">навигация</td><td align="center">';
for ($i=1; $i<=$max_page; $i++)
{
if ($i == $cur_page)
{
echo ' [ '.$i.' ]';
} else {
echo ' <a href="?page='.$i.'">'.$i.'</a>';
}
}
if (0==$cur_page)
{
echo ' [ '.MAX_ON_SCREEN.' последних ]';
} else {
echo ' <a href="'.$_SERVER['PHP_SELF'].'">'.MAX_ON_SCREEN.' последних</a>';
}
echo '<td class="nav_title" width="100" align="center">навигация</td></td></tr></tbody></table>';
}
}
function ShowRecords($records=array(), $auth = false)
{
foreach($records as $record){
echo '<table class="record" cellspacing="0" cellpadding="0"><tbody><tr><td class="record_head" id="right"><a href="javascript:paste(\'[b]'.$record['name'].'[/b]\')">'.$record['name'].'</a>';
if(!empty($record['email'])) echo ' | <a href="mailto:'.$record['email'].'">'.$record['email'].'</a>';
echo '</td><td class="record_head" align="right">Записано: '.$record['date'].'</td></tr><tr><td colspan="2" class="record_post">'.$record['message'].'</td></tr>';
if ($auth) {
echo '<tr><td colspan="2" class="record_head">Ip: '.$record['ip'].' | <a href="?edit=del&id='.$record['id'].'">Удалить</a></td></tr>';
}
echo '</tbody></table>';
}
}
function ShowAdminMenu()
{
echo '<table class="record" cellspacing="0" cellpadding="0"><tbody><tr><td class="record_head" align="left"><h4 align="center">Администраторская</h4><a href="javascript: if (confirm(\'Очистить всю гостевую книгу?\')) { window.location = \'?edit=clear\';};">Очистить гостевую книгу</a><hr size="1" width="100%" color="#ffffff" noshade />Cменить пароль(введите новый пароль дважды)<br /><form class="admin" method="post" action="'.$_SERVER['PHP_SELF'].'"><input type="password" name="password" maxlength="32" /><br /><input type="password" name="password2" maxlength="32" /><br /><input type="submit" value="Сменить"></form><hr size="1" width="100%" color="#ffffff" noshade /><a href="../">На главную</a> | <a href="?exit">Выйти</a></td></tr></tbody></table>';
}
function ShowFooter()
//
// Выводит завершение HTML-документа
//
{
echo '<a href="/">На Главную</a><br /></td></tr><tr><td style="padding-left: 4px;" bgcolor="#747474" align="left"><img src="'.UP_PATH.'img/aisys-guestbook.gif" width="88" height="31" border="0" alt="by “mod ADMIN99”" title=" mod ADMIN99" /></a><br /></td></tr></tbody></table>
</body></html>';
}
}
?>