<?php
ob_start();
require_once('../classes/body.class.php');
require_once('../classes/db.class.php');
require_once('../classes/system.class.php');
$title= new Body;
if (!isset($_GET['nick'])) {
header ('location: /');
exit;
}
$query = DB :: $dbs -> query ("SELECT * FROM `blogger` WHERE `id` = ?", [abs((int)$_GET['nick'])]);
if ($query -> rowCount () == 0) {
header ('location: /');
exit;
}
$a = $query -> fetch ();
$title->SetTitle(homeurl.' - Страница ' . $a['nick'].'');
$title->GetProfHeader();
$level = strtr($a['level'], [0=>'Пользователи', 1=>'Модераторы', 2=>'Старшие модераторы',3=>'Администраторы', 4=>'Гл. Администраторы', 5=>'Разработчики']);
$spec = strtr($a['spec'], [0=>'Мастер', 1=>'Кодер', 2=>'Дизайнер', 3=>'Хостер', 4=>'Продавец', 5=>'Программист']);
$row = strtr($a['row'], [0=>'Новичок', 1=>'Постоялец', 2=>'Старожил', 3=>'PRO', 4=>'MASTER', 5=>'Знаток']);


echo'        <link href="/assets/admin/css/reset.css" rel="stylesheet">
<!-- Начало контента -->
                <div class="body-content animated fadeIn">

                    <div class="row">
                    <div class="col-lg-3 col-md-3 col-sm-4">
                        <div class="panel rounded shadow">
                            <div class="panel-body">
                                <div class="inner-all">
                                    <ul class="list-unstyled">
                                        <li class="text-center">';
if (!empty($a['ava'])) { echo '<a href="/'.$a['ava'].'"><img class="img-responsive" src="/'.$a['ava'].'" alt="' . $a['name'] . ' ' . $a['family'] . '" title="' . $a['name'] . ' ' . $a['family'] . '"></a>';} else {echo'<a href="/assets/img/4.jpg"><img src="/assets/img/4.jpg" alt=""></a>';}
echo'</li><li class="text-center"><h4 class="text-capitalize">' . $a['name'] . ' ' . $a['family'] . '</h4><p class="text-muted text-capitalize"> ' . $spec. '</p></li>';

if ($a['level']!= 0) {
echo'<div class="btn-group-vertical btn-block"><a class="btn btn-default"style="text-decoration:none; color:black;"><span data-toggle="tooltip" title="Команда '.home.'"> <img src="/assets/img/support.png"style="width:16px;height:16px;">  Служба поддержки</span>  <img src="/assets/img/support.png"style="width:16px;height:16px;"></a></div>';
}
if ($a['jur']==1) {
echo'<div class="btn-group-vertical btn-block"><a class="btn btn-default"style="text-decoration:none; color:black;"><span data-toggle="tooltip" title="Журналист газеты"> <img src="/assets/img/support.png"style="width:16px;height:16px;">  Журналист газеты</span>  <img src="/assets/img/support.png"style="width:16px;height:16px;"></a></div>';
}
echo'</br></br>';
if ($a['id'] !=$b['id']) { echo'<div class="btn-group-vertical btn-block"style="text-decoration:none; color:black;"><a href="/mail.php?nick='.$a['id'].'" class="btn btn-default"><i class="fa fa-envelope pull-right"></i> Написать сообщение</a></div>';
}
if ($a['id'] == $b['id']) { 
echo'<li><div class="btn-group-vertical btn-block"><a href="/info/update.photo.php" class="btn btn-default"style="text-decoration:none; color:black;"><i class="fa fa-camera-retro pull-right"></i>Обновить фотографию</a></div></li>';
}

if ($a['id'] ==$b['id']) {
echo'<li><div class="btn-group-vertical btn-block">
<a href="/setting" class="btn btn-default"style="text-decoration:none; color:black;"><i class="fa fa-cog pull-right"></i>Личные настройки</a>
<a href="/logout" class="btn btn-default"style="text-decoration:none; color:black;"><i class="fa fa-sign-out pull-right"></i>Выход</a></div></li>';
}
                                    echo'</ul></div></div></div>


                        <div class="panel panel-theme rounded shadow"><div class="panel-heading">
                                <div class="pull-left"><h3 class="panel-title"><i class="fa fa-feed"></i> Контакты</h3></div>
                                <div class="pull-right">
                                    <a href="#" class="btn btn-sm btn-success"><i class="fa fa-whatsapp"></i></a>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                            <div class="panel-body no-padding rounded"><ul class="list-group no-margin">';
if (!empty ($a['icq'])) {echo '<li class="list-group-item"><i class="fa fa-whatsapp mr-5"></i>ICQ: ' . $a['icq'] . '</li>';}
if (!empty ($a['mobtel'])) {echo'<li class="list-group-item"><i class="fa fa-phone mr-5"></i>Телефон: ' . $a['mobtel'] . '</li>';}
if (!empty ($a['skype'])) {echo'<li class="list-group-item"><i class="fa fa-skype mr-5"></i>Skype ' . $a['skype'] . '</li>';}
if (!empty ($a['email'])) {echo'<li class="list-group-item"><i class="fa fa-envelope mr-5"></i>E-mail: ' . $a['email'] . '</li>';}
if (!empty ($a['vk'])) {echo'<li class="list-group-item"><i class="fa fa-vk mr-5"></i>VK: ' . $a['vk'] . '</li>';}


                                    echo'</ul></div></div>';
if ($b['level'] > 0) {

                            echo' <div class="panel panel-theme rounded shadow"><div class="panel-heading">
                                <div class="pull-left"><h3 class="panel-title"><i class="fa fa-yelp"></i> Управление</h3></div>
                                <div class="pull-right">
                                    <a href="#" class="btn btn-sm btn-success"><i class="fa fa-spinner"></i></a>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                            <div class="panel-body no-padding rounded"><ul class="list-group no-margin">';

if ($a['id'] != $b['id'])echo '<li class="list-group-item"><i class="fa fa-safari mr-5"></i> <a href="/administration/ban.php?id=' . $a['id'] . '">Заблокировать [БАН]</a></li>';
echo '<li class="list-group-item"><i class="fa fa-openid mr-5"></i> IP: <b>' . $a[ 'ip' ] . '</b> <a href="/administration/klon.php?ip='.$a['ip'].'"> [!!!]</a>';
$tst = DB::$dbs->querySingle("SELECT COUNT(id) FROM blogger WHERE ip = ?", [$a['ip']]);
$IP = ($tst > 0) ? '<span class="color:#FF3030;"><a href="/administration/klon.php?ip='.$a['ip'].'">' .$a['ip'] . '</a></span>' : $a['ip'];
echo'</li>';
echo '<li class="list-group-item"><i class="fa fa-slack mr-5"></i> Софт: <b>' . $a['soft'] . '</b></li>';
if ($a['level'] <= $b['level'])echo '<li class="list-group-item"><i class="fa fa-user mr-5"></i> <a href="/administration/user.edit.php?id=' . $a['id'] . '">Редактировать '.$a['nick'].'!</a></li>';
echo'</ul></div></div>';
}
echo'</div>';



                   echo' <div class="col-lg-9 col-md-9 col-sm-8">
                    <div class="profile-cover">
                        <div class="cover rounded shadow no-overflow">
                            <div class="inner-cover">
                                <div class="btn-group cover-menu-mobile hidden-lg hidden-md">
                                    <button type="button" class="btn btn-theme btn-sm dropdown-toggle" data-toggle="dropdown">
                                        <i class="fa fa-bars"></i>
                                    </button>
                                    <ul class="dropdown-menu pull-right no-border" role="menu">
                           <li class="active"><a href="#"><i class="fa fa-fw fa-clock-o"></i> <span>Активность</span></a></li>
                           <li><a href="#"><i class="fa fa-fw fa-user"></i> <span>Анкета</span></a></li>
      <li><a href="/gallery/personal.html?id=' . $a['id'] . '"><i class="fa fa-fw fa-photo"></i> <span>Галерея</a></li>
                               <li><a href="/notebook"><i class="fa fa-fw fa-users"></i><span> Блокнот </span></a></li>
                               <li><a href="/billing"><i class="fa fa-fw fa-envelope"></i> <span>Биллинг</span></a></li>
                                    </ul>
                                </div>
                                <img data-no-retina src="/assets/img/6.jpg" class="img-responsive full-width" alt="cover">
                            </div>
                            <ul class="list-unstyled no-padding hidden-sm hidden-xs cover-menu">
                                <li class="active"><a href="#"><i class="fa fa-fw fa-clock-o"></i> <span>Активность</span></a></li>
                                <li><a href="#"style="font-size: 12px;"><i class="fa fa-fw fa-user"></i> <span>Анкета</span></a></li>
                                <li><a href="/gallery/personal.html?id=' . $a['id'] . '"style="font-size: 12px;"><i class="fa fa-fw fa-photo"></i> <span>Галерея</span></a></li>
                                <li><a href="/notebook"style="font-size: 12px;"><i class="fa fa-fw fa-users"></i><span> Блокнот </a></li>
                                <li><a href="/billing"style="font-size: 12px;"><i class="fa fa-fw fa-envelope"></i> <span>Биллинг</span></a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="divider"></div>
                    <div class="panel rounded shadow">
                        <form action="...">
                            <textarea class="form-control" rows="5" placeholder="Статусы в разработке... "></textarea>
                        </form>
                        <div class="panel-footer">
                            <button class="btn btn-success pull-right">Отправить</button>
                            <ul class="nav nav-pills">
                                <li><a href="#"><i class="fa fa-camera"></i></a></li>
                                <li><a href="#"><i class="fa fa-smile-o"></i></a></li>
                            </ul>
                        </div>
                    </div>';
/*
/////////////////////////////////////////////////////////////////////вывод комментов/////////////////////////////////////////////////
?>

                    echo'<div class="row">
                        <div class="col-md-12">
                            <div class="panel panel-success rounded shadow">
                                <div class="panel-heading no-border">
                                    <div class="pull-left half">
                                        <div class="media">
                                            <div class="media-object pull-left">
                                                <img src="../../../img/avatar/35/1.png" alt="..." class="img-circle"/>
                                            </div>
                                            <div class="media-body">
                                                <a href="#" class="media-heading block mb-0 h4 text-white">Tol Lee</a>
                                                <span class="text-white h6">on 8th June, 2014</span>
                                            </div>
                                        </div>
                                    </div><!-- /.pull-left -->
                                    <div class="pull-right">
                                        <a href="#" class="text-white h4"><i class="fa fa-heart"></i> 15.5K</a>
                                    </div><!-- /.pull-right -->
                                    <div class="clearfix"></div>
                                </div><!-- /.panel-heading -->
                                <div class="panel-body no-padding">
                                    <div class="inner-all block">
                                  <blockquote class="mb-10">первый запись</blockquote>

                                        <img data-no-retina src="../../../img/media/food/2.jpg" alt="..." width="100"/>
                                        <img data-no-retina src="../../../img/media/food/3.jpg" alt="..." width="100"/>
                                        <img data-no-retina src="../../../img/media/food/4.jpg" alt="..." width="100"/>
                                    </div><!-- /.inner-all -->
                                    <div class="inner-all bg-success">
                                        view all <a href="#">7 comments</a>
                                    </div>
                                </div><!-- /.panel-body -->
                                <div class="panel-footer no-padding no-border">
                                    <div class="media inner-all no-margin">
                                        <div class="pull-left">
                                            <img src="../../../img/avatar/50/15.png" alt="..."/>
                                        </div><!-- /.pull-left -->
                                        <div class="media-body">
                                            <a href="#" class="h4">Jeck Joko</a>
                                            <small class="block text-muted">Lorem ipsum dolor sit amet, consectetur adipisicing elit. </small>
                                            <em class="text-xs text-muted">Posted on <span class="text-danger">Dec 08, 2014</span></em>
                                        </div><!-- /.media-body -->
                                    </div><!-- /.media -->
                                    <div class="line no-margin"></div><!-- /.line -->
                                    <div class="media inner-all no-margin">
                                        <div class="pull-left">
                                            <img src="../../../img/avatar/50/16.png" alt="..."/>
                                        </div><!-- /.pull-left -->
                                        <div class="media-body">
                                            <a href="#" class="h4">Tenny Imoet</a>
                                            <small class="block text-muted">Quaerat, impedit minus non commodi facere doloribus nemo ea voluptate nesciunt deleniti.</small>
                                            <em class="text-xs text-muted">Posted on <span class="text-danger">Dec 08, 2014</span></em>
                                        </div><!-- /.media-body -->
                                    </div><!-- /.media -->
                                    <div class="line no-margin"></div><!-- /.line -->
                                    <form action="#" class="form-horizontal inner-all">
                                        <div class="form-group has-feedback no-margin">
                                            <input class="form-control" type="text" placeholder="Your comment here...">
                                            <button type="submit" class="btn btn-theme fa fa-search form-control-feedback"></button>
                                        </div>
                                    </form><!-- /.form-horizontal -->
                                </div><!-- /.panel-footer -->
                            </div><!-- /.panel -->
                        </div>
                    </div>
                    </div>
                    </div><?
*/



$title->GetMenu();
$title->GetFooter();
?>