View file element_support_admins.php

File size: 7.27Kb
<?php
require_once './element_options/element_options.php';
if (!$user) { header('Location: /'); exit; }

	if ($user['lost_privilege'] != 3) { header('Location: /'); exit; }

	$name_ticket = array('', 'Общие вопросы','Предложение по игре','Вопросы по оплате','Технические вопросы');

		if ($go == 'open') {
			$count = mysql_result(mysql_query("SELECT COUNT(`lost_id`) FROM `element_support` WHERE `lost_close` = '0'"), 0);
			$title = 'Поддержка. Открытые: '.$count.'';
			require_once './element_include/element_head.php';
			require_once './element_include/element_header_user_true.php';
			echo '<div class="nfl p5 small mb5 mt5 mlra">';
			echo '<div class="cntr mb5"><a class="moderator" href="/support/admin">Служба поддержки</a></div>';
		
			if ($count > 0) {
				require_once './element_function/element_function_pagination.php';
				$page = (isset($_GET['page']) AND is_numeric($_GET['page'])) ? (int)$_GET['page'] : 1;
				$pagination = pagination(10, $page, $count);
				$query = mysql_query("SELECT `lost_id`,`lost_type`,`lost_time`,`lost_user` FROM `element_support` WHERE `lost_close` = '0' ORDER BY `lost_time` DESC LIMIT $pagination[start], $pagination[num]");
			
				$i = 1;
				while ($myrrow = mysql_fetch_array($query)) {
				$odd = ($i % 2) ? ' odd' : '';
				$cache_user = cache_user($myrrow['lost_user']);
					echo '
					<div class="ml5 mr5">
					<a class="bl p5 block'.$odd.'" href="/support/ticket?id='.$myrrow['lost_id'].'">
						<span class="small fr pt2"><span class="lngreen">'.rdate("d M H:i", $myrrow['lost_time']).'</span></span>
						<span class="small">№'.$myrrow['lost_id'].' '.$name_ticket[$myrrow['lost_type']].', '.$cache_user['lost_login'].'</span>
					</a>
					</div>';
				$i++;	
				}
			
				echo pagination_echo($pagination['page'],$pagination['total'],'/support/admin?go=open&page=');
				echo '</div>';
			
			} else echo '<div class="nf2 small p5 cntr yellow1 mt5 mlra">Запросов нет</div>';
		
			echo '</div>';
			require_once './element_include/element_foot_user_true.php';
			exit;
		}
		
		if ($go == 'close') {
			$count = mysql_result(mysql_query("SELECT COUNT(`lost_id`) FROM `element_support` WHERE `lost_close` > '0'"), 0);
			$title = 'Поддержка. Закрытые: '.$count.'';
			require_once './element_include/element_head.php';
			require_once './element_include/element_header_user_true.php';
			echo '<div class="nfl p5 small mb5 mt5 mlra">';
			echo '<div class="cntr mb5"><a class="moderator" href="/support/admin">Служба поддержки</a></div>';
		
			if ($count > 0) {
				require_once './element_function/element_function_pagination.php';
				$page = (isset($_GET['page']) AND is_numeric($_GET['page'])) ? (int)$_GET['page'] : 1;
				$pagination = pagination(10, $page, $count);
				$query = mysql_query("SELECT `lost_id`,`lost_type`,`lost_time`,`lost_user` FROM `element_support` WHERE `lost_close` > '0' ORDER BY `lost_time` DESC LIMIT $pagination[start], $pagination[num]");
			
				$i = 1;
				while ($myrrow = mysql_fetch_array($query)) {
				$odd = ($i % 2) ? ' odd' : '';
				$cache_user = cache_user($myrrow['lost_user']);
					echo '
					<div class="ml5 mr5">
					<a class="bl p5 block'.$odd.'" href="/support/ticket?id='.$myrrow['lost_id'].'">
						<span class="small fr pt2"><span class="lngreen">'.rdate("d M H:i", $myrrow['lost_time']).'</span></span>
						<span class="small">№'.$myrrow['lost_id'].' '.$name_ticket[$myrrow['lost_type']].', '.$cache_user['lost_login'].'</span>
					</a>
					</div>';
				$i++;	
				}
			
				echo pagination_echo($pagination['page'],$pagination['total'],'/support/admin?go=close&page=');
				echo '</div>';
			
			} else echo '<div class="nf2 small p5 cntr yellow1 mt5 mlra">Запросов нет</div>';
		
			echo '</div>';
			require_once './element_include/element_foot_user_true.php';
			exit;
		}
		
		if ($id > 0 AND $id < 5) {
			$count = mysql_result(mysql_query("SELECT COUNT(`lost_id`) FROM `element_support` WHERE `lost_type` = '$id'"), 0);
			$title = $name_ticket[$id].': '.$count.'';
			require_once './element_include/element_head.php';
			require_once './element_include/element_header_user_true.php';
			echo '<div class="nfl p5 small mb5 mt5 mlra">';
			echo '<div class="cntr mb5"><a class="moderator" href="/support/admin">Служба поддержки</a></div>';
		
			if ($count > 0) {
				require_once './element_function/element_function_pagination.php';
				$page = (isset($_GET['page']) AND is_numeric($_GET['page'])) ? (int)$_GET['page'] : 1;
				$pagination = pagination(10, $page, $count);
				$query = mysql_query("SELECT `lost_id`,`lost_type`,`lost_time`,`lost_user` FROM `element_support` WHERE `lost_type` = '$id' ORDER BY `lost_time` DESC LIMIT $pagination[start], $pagination[num]");
			
				$i = 1;
				while ($myrrow = mysql_fetch_array($query)) {
				$odd = ($i % 2) ? ' odd' : '';
				$cache_user = cache_user($myrrow['lost_user']);
					echo '
					<div class="ml5 mr5">
					<a class="bl p5 block'.$odd.'" href="/support/ticket?id='.$myrrow['lost_id'].'">
						<span class="small fr pt2"><span class="lngreen">'.rdate("d M H:i", $myrrow['lost_time']).'</span></span>
						<span class="small">№'.$myrrow['lost_id'].' '.$name_ticket[$myrrow['lost_type']].', '.$cache_user['lost_login'].'</span>
					</a>
					</div>';
				$i++;	
				}
			
				echo pagination_echo($pagination['page'],$pagination['total'],'/support/admin?id='.$id.'&page=');
				echo '</div>';
			
			} else echo '<div class="nf2 small p5 cntr yellow1 mt5 mlra">Запросов нет</div>';
		
			echo '</div>';
			require_once './element_include/element_foot_user_true.php';
			exit;
		}
	
	
	$title = 'Служба поддержки';
	require_once './element_include/element_head.php';
	require_once './element_include/element_header_user_true.php';
	echo '<div class="nfl p5 cntr mb5 mt5 mlra">';
		
		echo '<div class="mb5 small yellow1">Служба поддержки, администраторская часть.</div>';
		
		echo '<div class="ml5 mr5">
				<a class="bl p5 block odd" href="/support/admin?go=open">
				<span class="small">Все открытые запросы</span>
				</a></div>';	
				
		echo '<div class="ml5 mr5">
				<a class="bl p5 block" href="/support/admin?go=close">
				<span class="small">Все Закрытые запросы</span>
				</a></div>';
				
		echo '<div class="ml5 mr5">
				<a class="bl p5 block odd" href="/support/admin?id=1">
				<span class="small">Все Общие вопросы</span>
				</a></div>';
				
		echo '<div class="ml5 mr5">
				<a class="bl p5 block" href="/support/admin?id=2">
				<span class="small">Все Предложения по игре</span>
				</a></div>';
				
		echo '<div class="ml5 mr5">
				<a class="bl p5 block odd" href="/support/admin?id=3">
				<span class="small">Все Вопросы по оплате</span>
				</a></div>';			
		
	echo '<div class="ml5 mr5">
				<a class="bl p5 block" href="/support/admin?id=4">
				<span class="small">Все Технические вопросы</span>
				</a></div>';	
			
	echo '</div>';
	require_once './element_include/element_foot_user_true.php';
?>