View file fotov4/foto/complaints.php

File size: 9.39Kb
<?

/*
 * Автор: Tw1nGo
*/

define("H", $_SERVER["DOCUMENT_ROOT"].'/');
include_once H.'sys/inc/start.php';
include_once H.'sys/inc/compress.php';
include_once H.'sys/inc/sess.php';
include_once H.'sys/inc/settings.php';
include_once H.'sys/inc/db_connect.php';
include_once H.'sys/inc/ipua.php';
include_once H.'sys/inc/fnc.php';
include_once H.'sys/inc/user.php';

if (!user_access('foto_foto_edit') || !isset($user) || $user['level'] <= 2){
	header("Location: /foto/".SID);
	exit;
}

$set['title'] = 'Жалобы на фото';
include_once H.'sys/inc/thead.php';

title();
aut();

?>
<link rel="stylesheet" href="/foto/style/style-foto.css" type="text/css" />
<div class="foto_head_bg">    

<div class="lc_br wbg font0 relative oh" id="header_path">  
<a href="/" style="font-size:0;"> <img src="/foto/style/ico/home.png" alt=""> </a>        
<span class="lc_brw"> 
<img src="/foto/style/ico/sep.png" alt="" class="lc_br_sep"> <a href="/foto/">Фото</a> 
</span>  
<span class="lc_brw"> 
<img src="/foto/style/ico/sep.png" alt="" class="lc_br_sep"> <span class="lc_br_text">Жалобы на фотографии</span> 
</span>    
</div>   
<?



$act = isset($_GET['S']) ? my_esc($_GET['S']) : null;

switch ($act) {

default:


?>
<div class="tabs_block oh relative">    
<a href="/foto/" class="tab_item left"> Альбомы </a>  
<a href="/foto/?S=1" class="tab_item left"> Коллекции </a>   
<?
$k_complain = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto_complain` WHERE `read` = '1'"), 0);
?>
<div class="tab_item left tab_active black"> Жалобы <?= ($k_complain > 0 ? '<span class="complain__cnt">'.$k_complain.'</span>' : '')?></div>
</div>
              
<?


$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto_complain`"), 0);

if ($k_post == 0){
?>
<div class="wrapper"> <div class="block grey"> Список жалоб пуст. </div> </div>
<?
} 
else {

$set['p_str'] = '10';
$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];

?>

<div class="wrapper"> 
<table class="table__wrap table_no_borders nowrap"> <tbody><tr>  
<td class="table__cell m break-word sub_selected" width="50%">  <div class="link b"> Все   </div>  </td>    
<td class="table__cell m break-word" width="50%">  <a href="/foto/complaints.php?S=1" class="link b"> Нерассмотренные  </a>  </td>  
</tr> </tbody></table> 
</div>
<div class="wrapper bb0"> 
<?

$q = mysql_query("SELECT * FROM `gallery_foto_complain` ORDER BY `time` DESC LIMIT $start, $set[p_str]");

while ($post = mysql_fetch_array($q))
{

// Кто подал жалобу
$ank = get_user($post['id_user']);    

// Тип причины
if($post['types'] == 1){
        $prichina = 'СПАМ, реклама';
}elseif($post['types'] == 2){
        $prichina = 'Мошенничество';
}elseif($post['types'] == 3){
        $prichina = 'Неправильная категория';
}elseif($post['types'] == 4){
        $prichina = 'Намеки на ДП';
}elseif($post['types'] == 5){
        $prichina = 'ДП';
}elseif($post['types'] == 6){
        $prichina = 'Педофилия';
}elseif($post['types'] == 7){
        $prichina = 'Нет метки 18+';
}elseif($post['types'] == 8){
        $prichina = 'Сцены жестокости, насилия, смерти';
}elseif($post['types'] == 9){
	$prichina = 'Иное';
}

$foto = mysql_fetch_assoc(mysql_query("SELECT * FROM `gallery_foto` WHERE `id` = '".$post['id_foto']."' LIMIT 1"));

?>
<div class="block oh bord-botm">  
<div class="left font0 padd_right p80">      
<a class="tdn gview_link" href="/foto/<?= $foto['id_user']?>/<?= $foto['id_gallery']?>/<?= $foto['id']?>/">   
<div class="inl_bl relative"> 
<img src="/foto/foto128/<?= $foto['id']?>.<?= $foto['ras']?>" alt="" class="preview s81_80">
<?
if ($foto['metka'] == 1){
?>  
<img class="Tw1nGo_pic_45 Tw1nGo_pic_44" src="/foto/style/ico/adult.png" alt="" content="18"> 
<?  
}
?>
</div>      
</a>         
</div> 
<div class="oh">  
<span class="grey right" style="font-size: 12px;">  <?= vremja($post['time'])?></span>    
<a href="/foto/<?= $foto['id_user']?>/<?= $foto['id_gallery']?>/<?= $foto['id']?>/" class="arrow_link strong_link">    
<b class="m break-word darkblue break-word"><?= text($foto['name'])?></b><b class="break-word lgrey3 m break-word">.<?= $foto['ras']?></b> 
</a>    
  
<div class="oh pad_t_a2">  
<span class="m  grey">Причина:</span> <span class="m"><?= $prichina?></span> 
</div>  
<div class="oh pad_t_a2">  
<span class="m  grey">Сообщение:</span> <span class="m"><?= text($post['text'])?></span> 
</div>  
<div class="oh pad_t_a2">  
<span class="m  grey">Жалоба от:</span> <a class="b" href="/info.php?id=<?= $ank['id']?>"><span class="m"><?= $ank['nick']?></span></a>
</div> 
<div class="oh pad_t_a2">  
<span class="m  grey">Статус:</span> <span class="m b"><?= ($post['read'] == 0 ? '<span style="color: green;">Рассмотрена</span>' : '<span style="color: red;">Не расмотрена</span>')?></span> 
</div>  

</div>  
</div>
<?

}

?>
</div>
<?

if ($k_page > 1)str('?', $k_page, $page);
    
}

?>
<a href="/foto/" class="link darkblue return full_link">  <img src="/foto/style/ico/arr_back.png" alt="" class="ico_arrow-back">   Назад  </a>
</div>
<?  


break;

case '1':


?>
<div class="tabs_block oh relative">    
<a href="/foto/" class="tab_item left"> Альбомы </a>  
<a href="/foto/?S=1" class="tab_item left"> Коллекции </a>   
<?
$k_complain = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto_complain` WHERE `read` = '1'"), 0);
?>
<div class="tab_item left tab_active black"> Жалобы <?= ($k_complain > 0 ? '<span class="complain__cnt">'.$k_complain.'</span>' : '')?></div>
</div>
              
<?


$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto_complain` WHERE `read` = '1'"), 0);

if ($k_post == 0){
?>
<div class="wrapper"> <div class="block grey"> Список жалоб пуст. </div> </div>
<?
} 
else {

$set['p_str'] = '10';
$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];

?>

<div class="wrapper"> 
<table class="table__wrap table_no_borders nowrap"> <tbody><tr>  
<td class="table__cell m break-word" width="50%">  <a href="/foto/complaints.php" class="link b"> Все   </a>  </td>    
<td class="table__cell m break-word sub_selected" width="50%"> <div class="link b"> Нерассмотренные  </div>  </td>  
</tr> </tbody></table> 
</div>
<div class="wrapper bb0"> 
<?

$q = mysql_query("SELECT * FROM `gallery_foto_complain` WHERE `read` = '1' ORDER BY `time` DESC LIMIT $start, $set[p_str]");

while ($post = mysql_fetch_array($q))
{

// Кто подал жалобу
$ank = get_user($post['id_user']);    

// Тип причины
if($post['types'] == 1){
        $prichina = 'СПАМ, реклама';
}elseif($post['types'] == 2){
        $prichina = 'Мошенничество';
}elseif($post['types'] == 3){
        $prichina = 'Неправильная категория';
}elseif($post['types'] == 4){
        $prichina = 'Намеки на ДП';
}elseif($post['types'] == 5){
        $prichina = 'ДП';
}elseif($post['types'] == 6){
        $prichina = 'Педофилия';
}elseif($post['types'] == 7){
        $prichina = 'Нет метки 18+';
}elseif($post['types'] == 8){
        $prichina = 'Сцены жестокости, насилия, смерти';
}elseif($post['types'] == 9){
	$prichina = 'Иное';
}

$foto = mysql_fetch_assoc(mysql_query("SELECT * FROM `gallery_foto` WHERE `id` = '".$post['id_foto']."' LIMIT 1"));


?>
<div class="block oh bord-botm">  
<div class="left font0 padd_right p80">      
<a class="tdn gview_link" href="/foto/<?= $foto['id_user']?>/<?= $foto['id_gallery']?>/<?= $foto['id']?>/">   
<div class="inl_bl relative"> 
<img src="/foto/foto128/<?= $foto['id']?>.<?= $foto['ras']?>" alt="" class="preview s81_80">
<?
if ($foto['metka'] == 1){
?>  
<img class="Tw1nGo_pic_45 Tw1nGo_pic_44" src="/foto/style/ico/adult.png" alt="" content="18"> 
<?  
}
?>
</div>      
</a>         
</div> 
<div class="oh">  
<span class="grey right" style="font-size: 12px;">  <?= vremja($post['time'])?></span>    
<a href="/foto/<?= $foto['id_user']?>/<?= $foto['id_gallery']?>/<?= $foto['id']?>/" class="arrow_link strong_link">    
<b class="m break-word darkblue break-word"><?= text($foto['name'])?></b><b class="break-word lgrey3 m break-word">.<?= $foto['ras']?></b> 
</a>    
  
<div class="oh pad_t_a2">  
<span class="m  grey">Причина:</span> <span class="m"><?= $prichina?></span> 
</div>  
<div class="oh pad_t_a2">  
<span class="m  grey">Сообщение:</span> <span class="m"><?= text($post['text'])?></span> 
</div>  
<div class="oh pad_t_a2">  
<span class="m  grey">Жалоба от:</span> <a class="b" href="/info.php?id=<?= $ank['id']?>"><span class="m"><?= $ank['nick']?></span></a>
</div>  
<div class="oh pad_t_a2">  
<span class="m  grey">Статус:</span> <span class="m b"><?= ($post['read'] == 0 ? '<span style="color: green;">Рассмотрена</span>' : '<span style="color: red;">Не расмотрена</span>')?></span> 
</div> 

</div>  
</div>
<?

}

?>
</div>
<?

if ($k_page > 1)str('?S=1&', $k_page, $page);
    
}

?>
<a href="/foto/" class="link darkblue return full_link">  <img src="/foto/style/ico/arr_back.png" alt="" class="ico_arrow-back">   Назад  </a>
</div>
<? 

break;
}

include_once H.'sys/inc/tfoot.php';
    	
?>