View file apanel/apanel.php

File size: 5.09Kb
<?php
/**********************************************/
/* Автор скрипта: Александр Есин              */
/* E-Mail: [email protected] ([email protected]) */
/* ICQ: 6464729                               */
/* Site: http://ticlove.ru                    */
/**********************************************/
?>
<?php define ('SECURED', true); ?>
<?php require (dirname(__FILE__).'/../_inc/sql.php'); ?>
<?php require (dirname(__FILE__).'/../_inc/config.php'); ?>
<?php require (dirname(__FILE__).'/../_inc/function.php'); ?>
<?php
if (isset($_POST['action'])) {
     $login = trim($_POST['login']);
     $password = trim($_POST['password']);
     
     if ($login == ADMIN_LOGIN && $password == ADMIN_PASS)
     {
          $_SESSION['auth_admin'] = 1;
          header('Location: '.$_SERVER['REQUEST_URI']);
	  exit;
     }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ru" xml:lang="ru">
<head>
<title>Админ панель</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../apanel/css.css" type="text/css" media="screen" />
<link href="../favicon.ico" rel="shortcut icon" type="image/x-icon" />
<script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="../js/jquery.tools.min.js"></script>
<script type="text/javascript" src="../js/functions.js"></script>
<script type="text/javascript" src="../js/jquery.arcticmodal.min.js"></script>
</head>
<body>
<div id="content">
<h2>Админ панель</h2>
<?php if (!isset($_SESSION['auth_admin'])) { ?>
<div id="auth">
<div class="form">
<form action="<?php echo str_replace('&', '&amp;', $_SERVER['REQUEST_URI']); ?>" method="post">
<div style="padding-bottom: 10px;">
<div class="left" style="width: 80px;">Логин:</div>
<div class="left"><input class="input" name="login" type="text" maxlength="" /></div>
<div class="clear"></div>
</div>
<div style="padding-bottom: 10px;">
<div class="left" style="width: 80px;">Пароль:</div>
<div class="left"><input class="input" name="password" type="password" maxlength="" /></div>
<div class="clear"></div>
</div>
<div style="padding-bottom: 10px;">
<input type="hidden" name="action" value="1" />
<div style="text-align: center;"><input class="submit" type="submit" value="Войти" /></div>
</div>
</form>
</div>
<?php } else { ?>
<?php $page = isset($_GET['page']) ? $_GET['page'] : NULL; ?>
<div class="content_left">
<h4>Выберите необходимое действие:</h4>
<div style="padding-top: 10px;">
<a href="<?php echo $_SERVER['PHP_SELF']; ?>">Главная</a>
</div>
<div style="padding-top: 15px;">
<strong>Настройки:</strong><br/>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?page=city">Добавление/Удаление стран-регионов-городов</a><br/>
</div>
<div style="padding-top: 15px;">
<strong>Фотографии:</strong><br/>
<?php $photo_all = mysql_result(mysql_query("SELECT COUNT(*) FROM `q_photo` WHERE `moder` = '0';"), 0); ?>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?page=moder_photo">Одобрить фотографии (<?php echo $photo_all; ?>)</a>
</div>
<div style="padding-top: 15px;">
<strong>Новости:</strong><br/>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?page=news">Добавить новость</a><br/>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?page=news&mode=open">Просмотр / удаление новостей</a><br/>
</div>
<div style="padding-top: 15px;">
<strong>Обратная связь:</strong><br/>
<?php $feedback_all = mysql_result(mysql_query("SELECT COUNT(*) FROM `q_feedback` WHERE `new` = '0';"), 0); ?>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?page=feedback&amp;mode=new">Новые письма (<?php echo $feedback_all; ?>)</a><br/>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?page=feedback">Прочитанные</a>
</div>
<div style="padding-top: 15px;">
<strong>Счётчик:</strong><br/>
<?php $sql = mysql_query("SELECT * FROM `q_count_day` WHERE `date` = '".date('d.m.Y')."' LIMIT 1;"); ?>
<?php $count_array = mysql_fetch_array($sql); ?>
<div>[host: <?php echo intval($count_array['host']); ?> | hit: <?php echo intval($count_array['hit']); ?>]</div>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?page=">Подробнее...</a><br/>
</div>
</div>
<div class="content_right">
<?php
switch($page) {
case 'city':
include(dirname(__FILE__).'/pages/city.php');
break;

case 'moder_photo':
include(dirname(__FILE__).'/pages/moder_photo.php');
break;

case 'news':
include(dirname(__FILE__).'/pages/news.php');
break;

case 'feedback':
include(dirname(__FILE__).'/pages/feedback.php');
break;

case 'delete_users':
include(dirname(__FILE__).'/pages/delete_users.php');
break;

default:
include(dirname(__FILE__).'/pages/default.php');
break;
}
?>
</div>
<div class="clear"></div>
<?php } ?>
<div id="foot">&#169; <?php echo $_SERVER["HTTP_HOST"]; ?></div>
</div>
</body>
</html>