<?php

	# mark core  v1.0
    # author Drk in
	# date 24.10.19 	

	# core

	require_once ( $_SERVER['DOCUMENT_ROOT']."/_core/system.php" );

	# user

	system::access(true);

	# meta

	$title = 'Мой кабинет » Мобильные WAP сайты';
	$description = system::check($config['description']);
	$keywords = system::check($config['keywords']);
	$tl = 'Площадки | <small>Всего площадок: <strong>'.$user['pf_cn'].'</strong> из <strong>'.$config['pf_max'].'</strong></small>';

	# head

	require_once ( head );

	$cn = DB :: $dbh -> querySingle("SELECT count(id) FROM platforms WHERE user = ?", array($user['id']));	

	if($cn == 0)echo '<div class="err">Cписок пуст!</div>';

	$page = new page($cn);

	$limit = $cn > $page -> elements ? $page -> limit : null;

	$query = DB :: $dbh -> query("SELECT id FROM platforms WHERE user = ? ORDER BY time DESC {$limit}", array($user['id']));	

	while ($act = $query -> fetch()):

	$act = cache_pf::check($act['id']);

	echo '
	<div class="touch"><img src="'.save_img::fav($act['url']).'"> 
	<a href="'.site.'ou/'.$act['id'].'" target="_blank"><strong>'.system::check($act['url']).'</strong>
	</a> '.($act['gold'] > time() ? system::gold():'').' [ID: '.$act['id'].' | '.($act['ban'] == 1 ? '<font color="red">БАН</font>':''.($act['mode'] == 0 ? '<font color="green">Активен</font>':'<font color="red">Модерация</font>').'').'] 
	<a href="'.site.'link/'.$act['id'].'"><img src="'.ico.'s.png" alt="?"></a> 
	<br> '.system::check($act['message']).'
	<br>
	<a href="'.site.'office/platforms/edit/id'.$act['id'].'">Ред</a> |
	<a href="'.site.'office/platforms/code/id'.$act['id'].'"> Счетчик</a> |
	<a href="'.site.'office/platforms/gold/id'.$act['id'].'">Купить GOLD</a></div>
	';	

	endwhile;	
	
	$page -> get('?');
	
	echo '
	<a href="'.site.'office/platforms/add" class="touch"> Добавить cайт</a>
	<a href="'.site.'" class="touch">« На главную</a>
	';

	# foot

	require_once ( foot ) ;

?>

