Файл: selemege.tk/partners/index.php
Строк: 71
<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
only_reg();
$set['title']='Партнёры';
include_once '../sys/inc/thead.php';
title();
if (isset($_GET['id']) && isset($_GET['act']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `partners` WHERE `id` = '".intval($_GET['id'])."'"),0))
{
if ($_GET['act']=='del')
{
mysql_query("DELETE FROM `partners` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1");
msg('Партнёр успешно удалён.');
}
}
err();
aut();
$partners=mysql_query("SELECT * FROM `partners`");
while ($partner = mysql_fetch_assoc($partners))
{
if ($user['id']==1)$x="[<a href='?id=$partner[id]&act=del'>х</a>]";
else $x="";
if ($partner['type']=='razd')echo "<div class='menu_razd'>$partner[name] $x</div>";
elseif ($partner['type']=='link')echo "<div class='p_m'><img src='icons/accept.png'> <a href='http://$partner[url]'>$partner[name]</a> $x</div>";
}
if ($user['id']=='1'){
echo "<div align='right' class='p_m'><img src='/partners/icons/add.png'> <a href='/partners/add.php?add=$passgen'>Добавить партнёра</a></div>";
echo "<div align='right' class='p_m'><img src='/partners/icons/add.png'> <a href='/partners/razd.php?add=$passgen'>Добавить раздел</a></div>";
}
include_once '../sys/inc/tfoot.php';
?>