

</div>
<div class="main-content">
    <?php
        if(!defined('panel'))
        	die('Nope.');
        if(!isset($_SESSION['user']) && !isset(Config::$_url[1])) echo '<meta http-equiv="refresh" content="0;URL=\''.Config::$_PAGE_URL.'login\'/>';
        if(isset(Config::$_url[1])) $user = (int)Config::$_url[1];
        if(!isset(Config::$_url[1])) echo '<meta http-equiv="refresh" content="0;URL=\''.Config::$_PAGE_URL.'\'/>';
        $q = Config::$g_con->prepare('SELECT * FROM `users` WHERE `id` = ?');
        $q->execute(array(Config::$_url[1]));
        if(!$q->rowCount()) {
        	echo '
        <title>This user doesn\'t exist</title>
        	<div class="breadcrumbs" id="breadcrumbs">
        		<ul class="breadcrumb">
        			<li>
        				<i class="ace-icon fa fa-home home-icon"></i>
        					<a href="<?php echo Config::$_PAGE_URL; ?>">Home</a>
    </li>
    <li class="active">This user doesn\'t exist</li>
    </ul><!-- /.breadcrumb -->
    <div class="nav-search" id="nav-search">
        <form method="POST" action="search">
            <span class="input-icon">
            <input type="text" placeholder="Search ..." name="sname" id="username" type="submit" class="nav-search-input" autocomplete="on"> 
            <i class="ace-icon fa fa-search nav-search-icon"></i>
            </span>
        </form>
    </div>
    <!-- /.nav-search -->
</div>
<div class="page-content">
<div class="row-fluid">
<div class="span12">
<div class="alert alert-danger">This user doesn\'t exist.</div>
';
return;
}
$data = $q->fetch(PDO::FETCH_OBJ);
//include 'inc/config.php';
$respect = $data->Level*3+3;
?>
<title><?php echo $data->name; ?>'s Profile - <?php echo Config::$_SITE_NAME; ?></title>
<div class="breadcrumbs" id="breadcrumbs">
    <script type="text/javascript">
        try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
    </script>
    <ul class="breadcrumb">
        <li>
            <i class="ace-icon fa fa-home home-icon"></i>
            <a href="<?php echo Config::$_PAGE_URL; ?>">Home</a>
        </li>
        <li class="active"><?php echo $data->name; ?>'s profile</li>
    </ul>
    <!-- /.breadcrumb -->
    <div class="nav-search" id="nav-search">
        <form method="POST" action="<?php echo Config::$_PAGE_URL; ?>search">
            <span class="input-icon">
            <input type="text" placeholder="Search ..." name="sname" id="username" type="submit" class="nav-search-input" autocomplete="on"> 
            <i class="ace-icon fa fa-search nav-search-icon"></i>
            </span>
        </form>
    </div>
    <!-- /.nav-search -->
</div>
<div class="page-content">
<div class="row-fluid">
<div class="span12">
<?php
    if(isset($_POST['stergerestrictiapepanel']) && Config::getData('users','Admin',$_SESSION['user']) >= 5) {
    		$q = Config::$g_con->prepare('DELETE FROM `panel_restrict` WHERE `PlayerName` = ?');
    		$q->execute(array($data->name));
    		echo '<div class="alert alert-success">Jucatorul a fost scos din panel suspend cu succes.
			<button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
            </button></div>';
    }
    
    if(isset($_POST['unban']) && Config::getData('users','Admin',$_SESSION['user']) >= 1) {
    		$q = Config::$g_con->prepare('UPDATE `bans` SET `Active` = 0 WHERE `PlayerName` = ?');
    		$q->execute(array(Config::getID('users','name',$data->name)));
    		echo '<div class="alert alert-success">Jucatorul a primit unban cu succes.
			<button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
            </button></div>';
    }
    
    if(isset($_POST['warn']) && Config::getData('users','Admin',$_SESSION['user']) >= 1) {
    	if(!$_POST['reason']) echo '<div class="alert alert-danger">Ai lasat campuri necompletate.</div>';
    	else {
    		echo '<div class="alert alert-success">Jucatorul a primit warn cu succes.
			<button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
            </button></div>';
    		if($_POST['duration']) {
    			$duration = 0;
    		} else { $duration = 0; }
    
    		$q = Config::$g_con->prepare('INSERT INTO `panelactions` (`actiontime`, `actionid`, `playerid`, `playername`, `giverid`, `givername`, `reason`) VALUES (?, ?, ?, ?, ?, ?, ?)');
    		$q->execute(array($duration,4,Config::getID('users','id',$data->name),Config::getID('users','name',$data->name),Config::getData('users','id',$_SESSION['user']),Config::getData('users','name',$_SESSION['user']),$_POST['reason']));
    		
    		$q = Config::$g_con->prepare('UPDATE `users` SET `Warnings` = ? WHERE `id` = ?');
    		$q->execute(array(Config::getID('users','Warnings',$data->name)+1,Config::getID('users','id',$data->name)));
    
    		}
    }
    
    if(isset($_POST['restrictiepepanel']) && Config::getData('users','Admin',$_SESSION['user']) >= 5) {
    	if(!$_POST['reason'] && !$_POST['duration']) echo '<div class="alert alert-danger">Ai lasat campuri necompletate.</div>';
    	else {
    		echo '<div class="alert alert-success">Jucatorul a primit panel suspend cu succes.
			<button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
            </button></div>';
    		if($_POST['duration'] == 0) {
    			$permanentban = 1;	
    			$duration = 6578976578976;
    			$days = 0;
    		} else {
    			$permanentban = 0;	
    			$duration = (time()+$_POST['duration']*43200);
    			$days = $_POST['duration'];
    		}
    
    
    		$q = Config::$g_con->prepare('INSERT INTO `panel_restrict` (
    		`Permanent`, 
    		`Time`, 
    		`PlayerName`, 
    		`Days`, 
    		`AdminName`, 
    		`Reason`
    		) VALUES (?, ?, ?, ?, ?, ?)');
    		$q->execute(array(
    		$permanentban,
    		$duration,
    		Config::getID('users','name',$data->name),
    		$days,
    		Config::getData('users','name',$_SESSION['user']),
    		$_POST['reason']
    		));				
    	}
    }
    
    if(isset($_POST['ban']) && Config::getData('users','Admin',$_SESSION['user']) >= 5) {
    	if(!$_POST['reason'] && !$_POST['duration']) echo '<div class="alert alert-danger">Ai lasat campuri necompletate.</div>';
    	else {
    		echo '<div class="alert alert-success">Jucatorul a primit ban cu succes.
			<button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
            </button></div>';
    		if($_POST['duration'] == 0) {
    			$permanentban = 1;	
    			$duration = 0; 
    		} else {
    			$permanentban = 0;	
    			$duration = $_POST['duration'];		
    		}
    
    
    		$q = Config::$g_con->prepare('INSERT INTO `panelactions` (`actiontime`, `actionid`, `playerid`, `playername`, `giverid`, `givername`, `reason`) VALUES (?, ?, ?, ?, ?, ?, ?)');
    		$q->execute(array($duration,1,Config::getID('users','id',$data->name),Config::getID('users','name',$data->name),Config::getData('users','id',$_SESSION['user']),Config::getData('users','name',$_SESSION['user']),$_POST['reason']));
    		
    		$q = Config::$g_con->prepare('INSERT INTO `bans` (
    		`BanTimeDate`,
    		`IP`, 
    		`Active`, 
    		`Permanent`, 
    		`IPBan`, 
    		`Time`, 
    		`PlayerName`, 
    		`Days`, 
    		`AdminName`, 
    		`Reason`
    		) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
    		$q->execute(array(
    		date("Y-m-d H:i:s"),
    		Config::getID('users','IP',$data->name),
    		1,
    		$permanentban,
    		$_POST['banip'],
    		(time()+$duration*43200),
    		Config::getID('users','name',$data->name),
    		$duration,
    		Config::getData('users','name',$_SESSION['user']),
    		$_POST['reason']
    		));				
    	}
    }
    
    if(isset($_POST['jail']) && Config::getData('users','Admin',$_SESSION['user']) >= 5) {
    	if(!$_POST['reason'] || !$_POST['duration']) echo '<div class="alert alert-danger">Ai lasat campuri necompletate.</div>';
    	else {
    		echo '<div class="alert alert-success">Jucatorul a primit jail cu succes.
			<button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
            </button></div>';
    		if($_POST['duration']) {
    			$duration = $_POST['duration'];
    		}
    
    		$q = Config::$g_con->prepare('INSERT INTO `panelactions` (`actiontime`, `actionid`, `playerid`, `playername`, `giverid`, `givername`, `reason`) VALUES (?, ?, ?, ?, ?, ?, ?)');
    		$q->execute(array($duration,3,Config::getData('users','id',$data->id),Config::getID('users','name',$data->name),Config::getData('users','id',$_SESSION['user']),Config::getData('users','name',$_SESSION['user']),$_POST['reason']));		
    
    		$q = Config::$g_con->prepare('UPDATE `users` SET `Jailed` = ? AND `JailTime` = ? WHERE `id` = ?');
    		$q->execute(array(2,Config::getID('users','JailTime',$data->name)+$duration,Config::getID('users','id',$data->name)));
    
    		}
    }
    
    if(isset($_POST['changeemail']) && Config::getData('users','Admin',$_SESSION['user']) >= 5) {
    	if(!$_POST['email']) echo '<div class="alert alert-danger">Ai lasat campuri necompletate.</div>';
    	else {
    		echo '<div class="alert alert-success">Ai schimbat emailul jucatorului.
			<button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
            </button></div>';
    
    		$q = Config::$g_con->prepare('DELETE FROM `changemail`  WHERE `name` = ?');
    		$q->execute(array($data->name));
    		
    		$q = Config::$g_con->prepare('UPDATE `users` SET `Email` = ?  WHERE `name` = ?');
    		$q->execute(array($_POST['email'],$data->name));
            
            echo '<meta http-equiv="refresh" content="2">'; 
    
    		}
    }
    
    if(isset($_POST['addmoney']) && Config::getData('users','Admin',$_SESSION['user']) >= 5) {
    	if(!$_POST['moneyy'] || !$_POST['reasonmon']) echo '<div class="alert alert-danger">Ai lasat campuri necompletate.</div>';
    	else {
    		echo '<div class="alert alert-success">Suma de bani a fost adaugata pe acest cont.
			<button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
            </button></div>';
			
			$q = Config::$g_con->prepare('INSERT INTO `panelactions` (`actiontime`, `actionid`, `playerid`, `playername`, `giverid`, `givername`, `reason`) VALUES (?, ?, ?, ?, ?, ?, ?)');
    		$q->execute(array($_POST['moneyy'],6,$data->id,$data->name,Config::getData('users','id',$_SESSION['user']),Config::getData('users','name',$_SESSION['user']),$_POST['reasonmon']));

			$q = Config::$g_con->prepare('INSERT INTO `panellogs` (`text`) VALUES (?)');
    		$q->execute(array("".Config::getData('users','Name',$_SESSION['user'])."[user: ".Config::getData('users','id',$_SESSION['user'])."]  a adaugat ".$_POST['moneyy']."$ pe contul lui ".$data->name."[user: ".$data->id."]. Reason: ".$_POST['reasonmon'].""));

    		$q = Config::$g_con->prepare('UPDATE `users` SET `Money` = ?  WHERE `name` = ?');
    		$q->execute(array(Config::getData('users','Money',$data->id)+$_POST['moneyy'],$data->name));

            echo '<meta http-equiv="refresh" content="2">'; 

    		}
    }
    
    if(isset($_POST['addpp']) && Config::getData('users','Admin',$_SESSION['user']) >= 5) {
    	if(!$_POST['premiumpp'] || !$_POST['reasonpp']) echo '<div class="alert alert-danger">Ai lasat campuri necompletate.</div>';
    	else {
    		echo '<div class="alert alert-success">Punctele premium au fost adaugate pe acest cont.
			<button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
            </button></div>';

			$q = Config::$g_con->prepare('INSERT INTO `panelactions` (`actiontime`, `actionid`, `playerid`, `playername`, `giverid`, `givername`, `reason`) VALUES (?, ?, ?, ?, ?, ?, ?)');
    		$q->execute(array($_POST['premiumpp'],7,$data->id,$data->name,Config::getData('users','id',$_SESSION['user']),Config::getData('users','name',$_SESSION['user']),$_POST['reasonpp']));

			$q = Config::$g_con->prepare('INSERT INTO `panellogs` (`text`) VALUES (?)');
    		$q->execute(array("".Config::getData('users','Name',$_SESSION['user'])."[user: ".Config::getData('users','id',$_SESSION['user'])."]  a adaugat ".$_POST['premiumpp']." puncte premium pe contul lui ".$data->name."[user: ".$data->id."]. Reason: ".$_POST['reasonpp'].""));

    		$q = Config::$g_con->prepare('UPDATE `users` SET `PremiumPoints` = ?  WHERE `name` = ?');
    		$q->execute(array(Config::getData('users','PremiumPoints',$data->id)+$_POST['premiumpp'],$data->name));

            echo '<meta http-equiv="refresh" content="2">'; 

    		}
    }
    
    if(isset($_POST['setstatus']) && Config::getData('users','Admin',$_SESSION['user']) >= 5) {
        if(!$_POST['reasonstatus']) echo '<div class="alert alert-danger">Ai lasat campuri necompletate.</div>';
        else {
            echo '<div class="alert alert-success">Status-ul a fost modificat.
            <button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
            </button></div>';

            $q = Config::$g_con->prepare('INSERT INTO `panellogs` (`text`) VALUES (?)');
            $q->execute(array("".Config::getData('users','Name',$_SESSION['user'])."[user: ".Config::getData('users','id',$_SESSION['user'])."]  a setat status-ul ".$_POST['statuslevel']." pe contul lui ".$data->name."[user: ".$data->id."]. Reason: ".$_POST['reasonstatus'].""));

            $q = Config::$g_con->prepare('UPDATE `users` SET `Status` = ?  WHERE `name` = ?');
            $q->execute(array($_POST['statuslevel'],$data->name));

            echo '<meta http-equiv="refresh" content="2">'; 

            }
    }

    if(isset($_POST['setadmin']) && Config::getData('users','Admin',$_SESSION['user']) >= 5) {
    	if(!$_POST['reasonadmin']) echo '<div class="alert alert-danger">Ai lasat campuri necompletate.</div>';
    	else {
    		echo '<div class="alert alert-success">Admin level-ul a fost modificat.
			<button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
            </button></div>';
            if($_POST['adminlevel'] == 0) {  
                $duration = 0; 
            } else {
                $duration = $_POST['adminlevel'];     
            }

			$q = Config::$g_con->prepare('INSERT INTO `panelactions` (`actiontime`, `actionid`, `playerid`, `playername`, `giverid`, `givername`, `reason`) VALUES (?, ?, ?, ?, ?, ?, ?)');
    		$q->execute(array($_POST['adminlevel'],8,$data->id,$data->name,Config::getData('users','id',$_SESSION['user']),Config::getData('users','name',$_SESSION['user']),$_POST['reasonadmin']));

			$q = Config::$g_con->prepare('INSERT INTO `panellogs` (`text`) VALUES (?)');
    		$q->execute(array("".Config::getData('users','Name',$_SESSION['user'])."[user: ".Config::getData('users','id',$_SESSION['user'])."]  i-a setat lui ".$data->name."[user: ".$data->id."] admin level-ul la ".$_POST['adminlevel'].". Reason: ".$_POST['reasonadmin'].""));

            $q = Config::$g_con->prepare('INSERT INTO `staff_logs` (`text`) VALUES (?)');
            $q->execute(array("*Panel Admin ".Config::getData('users','name',$_SESSION['user'])." set ".Config::getID('users','name',$data->name)."'s admin level to ".$_POST['adminlevel'].""));
            

    		$q = Config::$g_con->prepare('UPDATE `users` SET `Admin` = ?  WHERE `name` = ?');
    		$q->execute(array($_POST['adminlevel'],$data->name));

            echo '<meta http-equiv="refresh" content="2">'; 

    		}
    }
    
    if(isset($_POST['sethelper']) && Config::getData('users','Admin',$_SESSION['user']) >= 5) {
    	if(!$_POST['reasonhelper']) echo '<div class="alert alert-danger">Ai lasat campuri necompletate.</div>';
    	else {
    		echo '<div class="alert alert-success">Helper level-ul a fost modificat.
			<button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
            </button></div>';

			$q = Config::$g_con->prepare('INSERT INTO `panelactions` (`actiontime`, `actionid`, `playerid`, `playername`, `giverid`, `givername`, `reason`) VALUES (?, ?, ?, ?, ?, ?, ?)');
    		$q->execute(array($_POST['helperlevel'],9,$data->id,$data->name,Config::getData('users','id',$_SESSION['user']),Config::getData('users','name',$_SESSION['user']),$_POST['reasonhelper']));

			$q = Config::$g_con->prepare('INSERT INTO `panellogs` (`text`) VALUES (?)');
    		$q->execute(array("".Config::getData('users','Name',$_SESSION['user'])."[user: ".Config::getData('users','id',$_SESSION['user'])."]  i-a setat lui ".$data->name."[user: ".$data->id."] helper level-ul la ".$_POST['helperlevel'].". Reason: ".$_POST['reasonhelper'].""));

            $q = Config::$g_con->prepare('INSERT INTO `staff_logs` (`text`) VALUES (?)');
            $q->execute(array("*Panel Admin ".Config::getData('users','name',$_SESSION['user'])." set ".Config::getID('users','name',$data->name)."'s helper level to ".$_POST['helperlevel'].""));
            

    		$q = Config::$g_con->prepare('UPDATE `users` SET `Helper` = ?  WHERE `name` = ?');
    		$q->execute(array($_POST['helperlevel'],$data->name));

            echo '<meta http-equiv="refresh" content="2">'; 

    		}
    }

    if(isset($_POST['kickid']) && Config::getData('users','Admin',$_SESSION['user']) >= 5) {
        if(!$_POST['reasonkick']) echo '<div class="alert alert-danger">Ai lasat campuri necompletate.</div>';
        else {
            echo '<div class="alert alert-success">Daca playerul a fost online a primit kick.
            <button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
            </button></div>';

            $q = Config::$g_con->prepare('INSERT INTO `panelactions` (`actiontime`, `actionid`, `playerid`, `playername`, `giverid`, `givername`, `reason`) VALUES (?, ?, ?, ?, ?, ?, ?)');
            $q->execute(array(0,10,$data->id,$data->name,Config::getData('users','id',$_SESSION['user']),Config::getData('users','name',$_SESSION['user']),$_POST['reasonkick']));

            $q = Config::$g_con->prepare('INSERT INTO `panellogs` (`text`) VALUES (?)');
            $q->execute(array("".Config::getData('users','Name',$_SESSION['user'])."[user: ".Config::getData('users','id',$_SESSION['user'])."]  i-a dat kick lui ".$data->name."[user: ".$data->id."]. Reason: ".$_POST['reasonkick'].""));

            echo '<meta http-equiv="refresh" content="2">'; 

            }
    }
    
    if(isset($_POST['mute']) && Config::getData('users','Admin',$_SESSION['user']) >= 5) {
    	if(!$_POST['reason'] || !$_POST['duration']) echo '<div class="alert alert-danger">Ai lasat campuri necompletate.</div>';
    	else {
    		echo '<div class="alert alert-success">Jucatorul a primit mute cu succes.
			<button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
            </button></div>';
    
    		if($_POST['duration']) {
    			$duration = $_POST['duration'];
    		}		
    		
    		$q = Config::$g_con->prepare('INSERT INTO `panelactions` (`actiontime`, `actionid`, `playerid`, `playername`, `giverid`, `givername`, `reason`) VALUES (?, ?, ?, ?, ?, ?, ?)');
    		$q->execute(array($duration,5,Config::getData('users','id',$data->id),Config::getID('users','name',$data->name),Config::getData('users','id',$_SESSION['user']),Config::getData('users','name',$_SESSION['user']),$_POST['reason']));
    		
    		$q = Config::$g_con->prepare('UPDATE `users` SET `Muted` = ? AND `JailTime` = ? WHERE `id` = ?');
    		$q->execute(array(1,Config::getID('users','MuteTime',$data->name)+$duration,Config::getID('users','id',$data->name)));
    
    		}
    }
    	
            $q = Config::$g_con->prepare('SELECT * FROM `bans` WHERE `PlayerName` = ? AND `Active` = 1 LIMIT 1');
            $q->execute(array($data->name));
            	if($q->rowCount()) 
    			while($row = $q->fetch(PDO::FETCH_OBJ)) {
    				$date = $row->BanTimeDate;
    					if($row->Permanent == 1)	{
    						$expira = "Contul este banat permanent (banul nu va expira automat)";
    						} else {
                            $expira = "Banul expira dupa <b>$row->Days</b> zile da la data pe care a fost banat daca player-ul incearca sa se conecteze pe joc";
    					}				
    				$numeadmin = $row->AdminName; $motiv = $row->Reason;			
                    echo "
    					<div class='alert alert-danger'>
    					<b>This account is banned.</b><br/><br/>
    					Banat de: <b>$numeadmin</b> pe data de <b>$date</b>, motivul banului: <b>$motiv</b>.<br/>
    					$expira.</div> ";
    			}
    	?>
<div id="user-profile-2" class="user-profile row-fluid">
<div class="tabbable">
<div id="user-profile-2" class="user-profile row-fluid">
<div class="tabbable">
    <ul class="nav nav-tabs padding-18">
        <li class="active">
            <a data-toggle="tab" href="#home">
            <i class="green icon-user bigger-120"></i>
            Profile
            </a>
        </li>
        <li>
            <a data-toggle="tab" href="#feed">
            <i class="orange icon-rss bigger-120"></i>
            Faction History
            </a>
        </li>
        <?php if(isset($_SESSION['user']) && Config::getData('users','Admin',$_SESSION['user']) >= 6) {	?>
        <li>
            <a data-toggle="tab" href="#admintools">
            <i class="blue icon-user bigger-120"></i>
            Admin Tools
            </a>
        </li>
        <?php } if(isset($_SESSION['user']) && Config::getData('users','Admin',$_SESSION['user']) >= 1) {	?>
        <li>
            <a data-toggle="tab" href="#complaints">
            <i class="blue icon-legal bigger-120"></i>
            Complaints
            </a>
        </li>
        <?php } if(isset($_SESSION['user']) && Config::getData('users','Admin',$_SESSION['user']) >= 1) {	?>
        <li>
            <a data-toggle="tab" href="#plogs">
            <i class="purple icon-user bigger-120"></i>
            Player Logs
            </a>
        </li>
        <?php } if(isset($_SESSION['user']) && Config::getData('users','Admin',$_SESSION['user']) >= 1) {	?>
        <?php } ?>
    </ul>
    <div class="tab-content no-border padding-24">
        <div id="feed" class="tab-pane">
            <div class="profile-feed row-fluid">
                <div class="span6">
                    <?php
                        $s = Config::$g_con->prepare('SELECT * FROM `faction_logs` WHERE `player` = ? ORDER BY `id` DESC');
                        $s->execute(array(Config::getID('users','id',$data->name)));
                        while($flog = $s->fetch(PDO::FETCH_OBJ)) 
                        {	?>
                    <div class="profile-activity clearfix ">
                        <div>
                            <img class="pull-left" alt="<?php echo $data->name; ?>'s avatar" src="<?php echo Config::$_PAGE_URL; ?>assets/images/avatars/<?php echo Config::getID('users','Model',$data->name); ?>.png"/>
                            <?php echo $flog->Text ?>
                            <div class="time">
                                <i class="icon-time bigger-110"></i>
                                <?php echo $flog->time ?>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                </div>
            </div>
        </div>
        <?php if(isset($_SESSION['user']) && Config::getData('users','Admin',$_SESSION['user']) >= 6) {	?>
        <div id="admintools" class="tab-pane">
            <div class="col-sm-5">
                <form method="POST" action="" disabled>
                    <div class="col-sm-10"> Reason: <br/>
                        <input name="reason" type="text" class="col-xs-10 col-sm-10" />
                    </div>
                    <br>
                    <div class="col-sm-10"> <br />Time: <br/>
                        <input name="duration" type="text" class="col-xs-10 col-sm-10" /><br />
                    </div>
                    <div class="col-sm-10">
                        Time 0 pentru permanent (ban)<br /><br />
                        Tip:<br>
                        <select name="banip" class="col-xs-10 col-sm-10">
                            <option value="0">Cont</option>
                            <option value="1">IP</option>
                        </select>
                    </div>
            </div>
            <br>
            <div class="col-sm-10"><br />
            <input type="submit" name="warn" class="btn btn-small btn-purple" value="warn"/>
            <?php
                $s = Config::$g_con->prepare('SELECT * FROM `bans` WHERE `PlayerName` = ? AND `Active` = 1');
                $s->execute(array($data->name));
                	if($suspend = $s->fetch(PDO::FETCH_OBJ)) { ?>
            <input type="submit" name="unban" class="btn btn-small btn-success" value="unban"/>
            <?php } else { ?>			
            <input type="submit" name="ban" class="btn btn-small btn-danger" value="ban"/>
            <?php } ?>
            <input type="submit" name="mute" class="btn btn-small btn-grey" value="mute"/>
            <input type="submit" name="jail" class="btn btn-small btn-pink" value="jail"/>
            <?php
                $s = Config::$g_con->prepare('SELECT * FROM `panel_restrict` WHERE `PlayerName` = ?');
                $s->execute(array($data->name));
                	if($suspend = $s->fetch(PDO::FETCH_OBJ)) { ?>
            <input type="submit" name="stergerestrictiapepanel" class="btn btn-small btn-success" value="delete panel suspend"/>
            <?php } else { ?>			
            <input type="submit" name="restrictiepepanel" class="btn btn-small btn-danger" value="panel suspend"/>
            <?php } ?>
            </form>
            <br>
            <form method="POST" action="" disabled>
            <div class="col-sm-5"><br />
            <div class="col-sm-10"> Email: <br/>
            <input name="email" type="text" class="col-xs-10 col-sm-10" />
            </div></div>
            <br>
            <div class="col-sm-10"><br />
            <input type="submit" name="changeemail" class="btn btn-small btn-success" value="Schimba email"/>	</div>
            </form>
            <form method="POST" action="" disabled>
            <div class="col-sm-5"><br />
            <div class="col-sm-10"> Money Value: <br/>
            <input name="moneyy" type="text" class="col-xs-10 col-sm-10" />
            <br>
            <div class="col-sm-15"> Reason for add money: <br/>
            <input name="reasonmon" type="text" class="col-xs-10 col-sm-10" /></div>
            </div></div>
            <br>
            <div class="col-sm-10"><br />
            <input type="submit" name="addmoney" class="btn btn-small btn-info" value="Adauga banii"/> </div>
            </form>
            <form method="POST" action="" disabled>
            <div class="col-sm-5"><br />
            <div class="col-sm-10"> Premium Points Value: <br/>
            <input name="premiumpp" type="text" class="col-xs-10 col-sm-10" />
            <br>
            <div class="col-sm-15"> Reason for add premium points: <br/>
            <input name="reasonpp" type="text" class="col-xs-10 col-sm-10" /></div>
            </div></div>
            <br>
            <div class="col-sm-10"><br />
            <input type="submit" name="addpp" class="btn btn-small btn-info" value="Adauga punctele premium"/>	</div>
            </form>
            <form method="POST" action="" disabled>
            <div class="col-sm-5"><br />
            <div class="col-sm-10"> Admin level: <br/>
            <input name="adminlevel" type="text" class="col-xs-10 col-sm-10" />
            <br>
            <div class="col-sm-15"> Reason for set admin level: <br/>
            <input name="reasonadmin" type="text" class="col-xs-10 col-sm-10" /></div>
            </div></div>
            <br>
            <div class="col-sm-10"><br />
            <input type="submit" name="setadmin" class="btn btn-small btn-danger" value="Seteaza admin level-ul"/>	</div>
            </form>
            <form method="POST" action="" disabled>
            <div class="col-sm-5"><br />
            <div class="col-sm-10"> Helper level: <br/>
            <input name="helperlevel" type="text" class="col-xs-10 col-sm-10" />
            <br>
            <div class="col-sm-15"> Reason for set helper level: <br/>
            <input name="reasonhelper" type="text" class="col-xs-10 col-sm-10" /></div>
            </div></div>
            <br>
            <div class="col-sm-10"><br />
            <input type="submit" name="sethelper" class="btn btn-small btn-danger" value="Seteaza helper level-ul"/>	</div>
            </form>
            <form method="POST" action="" disabled>
            <div class="col-sm-5"><br />
            <div class="col-sm-10"> Status: <br/>
            <input name="statuslevel" type="text" class="col-xs-10 col-sm-10" />
            <br>
            <div class="col-sm-15"> Reason for set status: <br/>
            <input name="reasonstatus" type="text" class="col-xs-10 col-sm-10" /></div>
            </div></div>
            <br>
            <div class="col-sm-10"><br />
            <input type="submit" name="setstatus" class="btn btn-small btn-danger" value="Seteaza status-ul"/>  </div>
            </form>
            <form method="POST" action="" disabled>
            <div class="col-sm-5"><br />
            <div class="col-sm-15"> Kick reason: <br/>
            <input name="reasonkick" type="text" class="col-xs-10 col-sm-10" /></div>
            </div>
            <br>
            <div class="col-sm-10"><br />
            <input type="submit" name="kickid" class="btn btn-small btn-danger" value="Kick"/>    </div>
            </form>
            </div>
        </div>
        <?php } if(isset($_SESSION['user']) && Config::getData('users','Admin',$_SESSION['user']) >= 1) {	?>
        <div id="plogs" class="tab-pane">
        		<h4>Options</h4>
				<a href="#punish" data-toggle="collapse">punish logs</a>
				<div id="punish" class="collapse">
					<?php
                        $q = Config::$g_con->prepare('SELECT * FROM `bans` WHERE `PlayerName` = ? ORDER BY `id` DESC LIMIT 10');
                        $q->execute(array($data->name));
                        while($row = $q->fetch(PDO::FETCH_OBJ)) {
                        ?>
                    <li>Banned for <?php echo $row->Reason ?> by <i><?php echo $row->AdminName ?></i>, time <?php echo $row->Days ?> days - IP Ban: <?php echo $row->IPBan ?> [<?php echo $row->BanTimeDate ?>]</li>
                    <?php } ?>
                    <?php
                        $q = Config::$g_con->prepare('SELECT * FROM `punishlogs` WHERE `playerid` = ? AND `actionid` = 6 ORDER BY `id` DESC LIMIT 10');
                        $q->execute(array($data->id));
                        while($row = $q->fetch(PDO::FETCH_OBJ)) {
                        ?>
                    <li>Jailed for <?php echo $row->reason ?> by <i><?php echo $row->givername ?></i> [<?php echo $row->time ?>]</li>
                    <?php } ?>
                    <?php
                        $q = Config::$g_con->prepare('SELECT * FROM `punishlogs` WHERE `playerid` = ? AND `actionid` = 5 ORDER BY `id` DESC LIMIT 10');
                        $q->execute(array($data->id));
                        while($row = $q->fetch(PDO::FETCH_OBJ)) {
                        ?>
                    <li>Warned for <?php echo $row->reason ?> by <i><?php echo $row->givername ?></i> [<?php echo $row->time ?>]</li>
                    <?php } ?>
                    <?php
                        $q = Config::$g_con->prepare('SELECT * FROM `kicklogs` WHERE `playerid` = ? ORDER BY `id` DESC LIMIT 10');
                        $q->execute(array($data->id));
                        while($row = $q->fetch(PDO::FETCH_OBJ)) {
                        ?>
                    <li>Kicked for <?php echo $row->reason ?> by <i><?php echo $row->givername ?></i> [<?php echo $row->time ?>]</li>
                    <?php } ?>
				</div>
    			<div class="hr hr8"></div>
                <a href="#actions" data-toggle="collapse">actions logs</a>
				<div id="actions" class="collapse">
     				<?php
                        $q = Config::$g_con->prepare('SELECT * FROM `playerlogs` WHERE `playerid` = ? OR `giverid` = ? ORDER BY `id` DESC LIMIT 25');
                        $q->execute(array($data->id,$data->id));
                        while($row = $q->fetch(PDO::FETCH_OBJ)) {
                        ?>
                    <li><?php echo $row->action ?></li>
                    <?php } ?>
				</div>
            	<div class="hr hr8"></div>
           	 	<a href="#chat" data-toggle="collapse">chat logs</a>
				<div id="chat" class="collapse">
     				<?php
                        $q = Config::$g_con->prepare('SELECT * FROM `chat_logs` WHERE `playerid` = ? ORDER BY `id` DESC LIMIT 25');
                        $q->execute(array($data->id));
                        while($row = $q->fetch(PDO::FETCH_OBJ)) {
                        ?>
                    <li><i><?php echo $row->player ?></i> say: <?php echo $row->text ?> [<?php echo $row->time ?>]</li>
                    <?php } ?>
				</div>
                <div class="hr hr8"></div>
                <a href="#kill" data-toggle="collapse">kill logs</a>
				<div id="kill" class="collapse">
     				<?php
                        $q = Config::$g_con->prepare('SELECT * FROM `kill_logs` WHERE `killerid` = ? ORDER BY `id` DESC LIMIT 15');
                        $q->execute(array($data->id));
                        while($row = $q->fetch(PDO::FETCH_OBJ)) {
                        ?>
                    <li><i><?php echo $row->killername ?></i> killed <i><?php echo $row->playername ?></i>[user <?php echo $row->playerid ?>] with weapon <?php echo $row->reason ?> [<?php echo $row->time ?>]</li>
                    <li><i><?php echo $row->playername ?></i> was killed  by <i><?php echo $row->killername ?></i>[user <?php echo $row->killerid ?>] with weapon <?php echo $row->reason ?> [<?php echo $row->time ?>]</li>
					<?php } ?>
				</div>
				<div class="hr hr8"></div>
                <a href="#ip" data-toggle="collapse">ip logs</a>
				<div id="ip" class="collapse">
     				<?php
                        $q = Config::$g_con->prepare('SELECT * FROM `users` WHERE `id` = ?');
                        $q->execute(array($data->id));
                        while($row = $q->fetch(PDO::FETCH_OBJ)) {
                        ?>
                    <li>Registred IP: <?php echo $row->IP ?></li>
                	<?php } ?>
                	<br>
                    <?php
                        $q = Config::$g_con->prepare('SELECT * FROM `iplogs` WHERE `playerid` = ? ORDER BY `id` DESC LIMIT 15');
                        $q->execute(array($data->id));
                        while($row = $q->fetch(PDO::FETCH_OBJ)) {
                        ?>
                    <li><i><?php echo $row->name ?></i> logged on ip <u><?php echo $row->ip ?></u> [<?php echo $row->time ?>]</li>
                	<?php } ?>
				</div>
                <div class="hr hr8"></div>
                <a href="#sips" data-toggle="collapse">another accounts logged on this ip</a>
                <div id="sips" class="collapse">
                    <?php
                        $q = Config::$g_con->prepare('SELECT * FROM `users` WHERE `IP` = ? OR `LastIP` = ? ORDER BY `id` DESC LIMIT 15');
                        $q->execute(array($data->IP,$data->LastIP));
                        while($row = $q->fetch(PDO::FETCH_OBJ)) {
                        ?>
                    <li><a href="http://wster-rpg.cf/panel/profile/<?php echo $row->id ?>">User: <?php echo $row->name ?> | LastIP: <?php echo $row->LastIP ?> | RegistredIP: <?php echo $row->IP ?> - level <?php echo $row->Level ?></a></li>
                    <?php } ?>
                </div>
			</ul>
        </div>
        <?php } if(isset($_SESSION['user']) && Config::getData('users','Admin',$_SESSION['user']) >= 1) {	?>
        <div id="complaints" class="tab-pane">
            <h4 class="blue">
                <i class="icon-legal"></i>
                Complaints
            </h4>
            <table class="table table-striped table-condensed table-hover">
                <thead>
                    <tr>
                        <th>Title</th>
                        <th><i class="fa fa-clock-o"></i> Date</th>
                        <th>Status</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                        $q = Config::$g_con->prepare('SELECT * FROM `complaints` WHERE `playername` = ? ORDER BY `id` DESC');
                        $q->execute(array($data->name));
                        while($row = $q->fetch(PDO::FETCH_OBJ)) {
                        	if($row->reasoncomplaint == 1) {
                        		$reason = "Factiune";
                        	} else if($row->reasoncomplaint == 2) {
                        		$reason = "DM";
                        	} else if($row->reasoncomplaint == 3) {
                        		$reason = "Jigniri, injurii, limbaj vulgar";
                        	} else if($row->reasoncomplaint == 4) {
                        		$reason = "Inselatorie";
                        	} else if($row->reasoncomplaint == 5) {
                        		$reason = "Altceva (abuz, comportament non RP)";
                        	} else if($row->reasoncomplaint == 6) {
                        		$reason = "Abuz admin/helper";
                        	} else if($row->reasoncomplaint == 7) {
                        		$reason = "Greseli ca lider";
                        	}
                        	echo 
                        	"<tr>			
                        		<td><a href='". Config::$_PAGE_URL ."complaint/". $row->id ."'>{$row->playername} - ". $reason ."</a></td>
                        		<td>{$row->time}</td>
                        		<td>" . ($row->status ? "Closed" : "Open") . "</td>
                        	</tr>";
                        }
                        ?>
                </tbody>
            </table>
        </div>
        <?php } ?>
        <div id="home" class="tab-pane in active">
            <div class="row-fluid">
                <div class="span2 center">
                    <span class="profile-picture">
                    <img id="avatar2" src="<?php echo Config::$_PAGE_URL . 'assets/css/skins/' . $data->Model . '.png'; ?>" style="height:300px;">
                    </span>
                    <div class="space space-4"></div>
                    <div class="width-80 label label-inverse arrowed-in arrowed-in-right">
                        <div class="inline position-relative">
                            <?php echo (!$data->Status ? "<i class='icon-circle light-red middle'></i>" : "<i class='icon-circle light-green middle'></i>"); ?>
                            &nbsp;
                            <span class="white"><?php echo (!$data->Status ? "offline" : "online"); ?></span>
                        </div>
                    </div>
                    <div class="space-4"></div>
                    <?php
                        if(isset($_SESSION['user']) && ($_SESSION['user'] != $user)) 
                        echo '<a class="btn btn-minier btn-danger" href="'. Config::$_PAGE_URL .'createcomplaint/'. $data->id. '">Reclamă player</a>';
                        ?>
                    <div class="space space-4"></div>
                </div>
                <!--/span--><br />
                <div class="span10">
                    <h4 class="blue"><span class="middle"><?php echo $data->name; ?></span></h4>
                    <?php if(strpos($data->name, 'crocomococciococ') !== false) { ?>
                    <span class="label label-pink arrowed-in-right"><i class="icon-gear white"></i> fraier </span><br/>
                    <?php } else if($data->Admin >= 6) { ?>
                    <span class="label label-pink arrowed-in-right"><i class="icon-shield white"></i> owner </span><br/>
                    <?php } else if($data->Admin < 6 && $data->Admin > 0 ) { ?>
                    <span class="label label-success arrowed-in-right"><i class="icon-shield white"></i> admin </span><br/>
                    <?php } else if($data->Helper > 0 ) { ?>	
                    <span class="label label-purple arrowed-in-right"><i class="icon-question-sign white"></i> helper</span><br/>
                    <?php } if($data->Leader > 0) { ?>
                    <span class="label label-purple arrowed-in-right"><i class="icon-group white"></i> faction leader</span><br/>
                    <?php } if($data->Premium > 0) { ?>	
                    <span class="label label-yellow arrowed-in-right white"><i class="icon-star grey"></i> <font color="black">premium user</font></span><br/>
                    <?php } if($data->VIP > 0) { ?>
                    <span class="label label-danger arrowed-in-right white"><i class="icon-star grey"></i> <font color="black">VIP</font></span><br/>
                    <?php } if($data->CRank == 7) { ?>
                    <span class="label label-danger arrowed-in-right"><i class="icon-group white"></i> <a href="<?php echo Config::$_PAGE_URL; ?>clan/<?php echo $data->Clan ?>" style="color: #FFF">clan owner</a></span><br/>
                    <?php } ?>
                    <?php
                        $s = Config::$g_con->prepare('SELECT * FROM `panel_restrict` WHERE `PlayerName` = ? AND `Permanent` = 1');
                        $s->execute(array($data->name));
                        	if($suspend1 = $s->fetch(PDO::FETCH_OBJ)) { ?>
                    <span class="label label-golden arrowed-in-right"><i class="icon-frown white"></i> permanent suspended from panel</span><br/>
                    <?php }	$s = Config::$g_con->prepare('SELECT * FROM `panel_restrict` WHERE `PlayerName` = ? AND `Permanent` = 0');
                        $s->execute(array($data->name));
                        if($suspend = $s->fetch(PDO::FETCH_OBJ)) { ?>
                    <span class="label label-golden arrowed-in-right"><i class="icon-frown white"></i> suspended from panel for <b><?php echo $suspend->Days ?></b> days from the date of suspension (<u><?php echo $suspend->BanTimeDate ?></u>)</span><br/>
					<?php } ?>
                    <div class="profile-user-info">
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Faction </div>
                            <div class="profile-info-value"> <?php echo Config::$factions[$data->Member] ?><?php if($data->Member >=1) { ?>, rank <?php echo $data->Rank; ?> <?php } ?> </div>
                        </div>
                        <?php if($data->Clan > 0) {
                            $s = Config::$g_con->prepare('SELECT * FROM `clans` WHERE `clanID` = ?');
                            $s->execute(array($data->Clan));
                            	while($clan = $s->fetch(PDO::FETCH_OBJ)) { ?>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Clan </div>
                            <div class="profile-info-value">
                                <span><?php echo $clan->clanName; ?> <a href="<?php echo Config::$_PAGE_URL; ?>clan/<?php echo $clan->clanID; ?>"><i class="icon-external-link"></i></a>, rank <?php echo $data->CRank; ?></span>
                            </div>
                        </div>
                        <?php } } ?>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Level </div>
                            <div class="profile-info-value"> <?php echo $data->Level; ?> </div>
                        </div>
                        <?php if(isset($_SESSION['user']) && ($data->name) == Config::getData('users','name',$_SESSION['user'])) { ?>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Money </div>
                            <div class="profile-info-value"> $<?php echo number_format($data->Money,0,'.','.') ?> / $<?php echo number_format($data->Bank,0,'.','.') ?> </div>
                        </div>
                        <?php } if(isset($_SESSION['user'])&& ($data->name) != Config::getData('users','name',$_SESSION['user']) && Config::getData('users','Admin',$_SESSION['user']) >= 1) { ?>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Money </div>
                            <div class="profile-info-value"> $<?php echo number_format($data->Money,0,'.','.') ?> / $<?php echo number_format($data->Bank,0,'.','.') ?> </div>
                        </div>
                        <?php } ?>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Playing hours </div>
                            <div class="profile-info-value"> <?php echo $data->ConnectedTime; ?> </div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Phone </div>
                            <div class="profile-info-value"> <?php echo $data->PhoneNr; ?> </div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Joined </div>
                            <div class="profile-info-value"> <?php echo $data->RegisterDate ?> </div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Last online </div>
                            <div class="profile-info-value"> <?php echo $data->lastOn; ?></div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Materials </div>
                            <div class="profile-info-value"> <?php echo $data->Materials; ?> </div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Race Points </div>
                            <div class="profile-info-value"> <?php echo $data->RacePoints; ?> </div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Cases </div>
                            <div class="profile-info-value"> <?php echo $data->Ocase; ?> </div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Keys </div>
                            <div class="profile-info-value"> <?php echo $data->Okey; ?> </div>
                        </div>
                        <?php if(isset($_SESSION['user']) && ($data->name) == Config::getData('users','name',$_SESSION['user'])) { ?>			
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Premium </div>
                            <div class="profile-info-value">
                                <?php echo (!$data->Premium ? "No ($data->PremiumPoints premium points)" : "Yes ($data->PremiumPoints premium points)"); ?> <a href='<?php echo Config::$_PAGE_URL; ?>premium'><i class='btn btn-xs no-hover btn-info icon-plus'></i></a>
                            </div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Vip Account </div>
                            <div class="profile-info-value">
                                <?php echo (!$data->VIP ? "No" : "Yes"); ?>
                            </div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> MP3 </div>
                            <div class="profile-info-value">
                                <?php echo (!$data->MP3 ? "No " : "Yes "); ?>
                            </div>
                        </div>
                        <?php } if(isset($_SESSION['user'])&& ($data->name) != Config::getData('users','name',$_SESSION['user']) && Config::getData('users','Admin',$_SESSION['user']) >= 1) { ?>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Premium </div>
                            <div class="profile-info-value">
                                <?php echo (!$data->Premium ? "No ($data->PremiumPoints premium points)" : "Yes ($data->PremiumPoints premium points)"); ?>
                            </div>
                        </div>
                        <?php } if(isset($_SESSION['user']) && ($data->name) == Config::getData('users','name',$_SESSION['user'])) { ?>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Email </div>
                            <div class="profile-info-value"> <?php if($data->Email == "email@yahoo.com") { echo "(UNCONFIRMED)"; } else echo $data->Email; ?> <a href="<?php echo Config::$_PAGE_URL; ?>changemail"><i class="ace-icon fa fa-edit"></i></a> </div>
                        </div>
                        <?php } if(isset($_SESSION['user'])&& ($data->name) != Config::getData('users','name',$_SESSION['user']) && Config::getData('users','Admin',$_SESSION['user']) >= 1) { ?>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Email </div>
                            <div class="profile-info-value"> <?php if($data->Email == "email@yahoo.com") { echo "(UNCONFIRMED)"; } else echo $data->Email; ?> </div>
                        </div>
                        <?php } ?>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Warnings </div>
                            <div class="profile-info-value"> <?php echo $data->Warnings; ?>/3</div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Faction warns </div>
                            <div class="profile-info-value"> <?php echo $data->FWarn; ?>/3</div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Faction punish </div>
                            <div class="profile-info-value"> <?php echo $data->FPunish; ?>/20</div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> Job </div>
                            <div class="profile-info-value"> <?php echo Config::$jobs[$data->Job]; ?> </div>
                        </div>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="space-20"></div>
                <div class="row-fluid">
                    <div class="span8">
                        <div class="widget-box transparent">
                            <div class="widget-header widget-header-small">
                                <h4 class="smaller">
                                    <i class="icon-truck bigger-110"></i>
                                    Personal vehicles
                                </h4>
                            </div>
                            <div class="widget-body">
                                <div class="widget-main">
                                    <?php
                                        $q = Config::$g_con->prepare('SELECT * FROM `cars` WHERE `Owner` = ?');
                                        $q->execute(array($data->name));
                                        if(!$q->rowCount()) {
                                           if(!isset($_SESSION['user']))
                                             echo '<p>This user has no vehicles.</p>';
                                           else if(isset($_SESSION['user']) && ($_SESSION['user'] === $user))
                                             echo '<p>You have no vehicles.</p>';
                                           else 
                                             echo '<p>This user has no vehicles.</p>';
                                        } else {
                                        echo '
                                        <table class="table table-striped">
                                        <thead>
                                        <tr>
                                        <th>Image</th>
                                        <th class="hidden-480">Vehicle Name</th>
                                        <th class="hidden-100">Info</th>
                                        <th class="center">GPS</th>
                                        </tr>
                                        </thead>
                                        <tbody>';
                                        $s = Config::$g_con->prepare('SELECT * FROM `cars` WHERE `Owner` = ?');
                                        $s->execute(array($data->name));
                                        while($car = $s->fetch(PDO::FETCH_OBJ)) 
                                        { ?>
                                    <tr>
                                        <td class="center">
                                            <img src="<?php echo Config::$_PAGE_URL ?>assets/images/vehicles/Vehicle_<?php echo $car->Model ?>.jpg" alt="490" style="height: 65px"/>
                                        </td>
                                        <td>
                                            <?php echo Config::$namevehicles[$car->Model]; ?> (ID: <?php echo $car->ID; ?>)
                                        </td>
                                        <td>
                                            Odometter: <b><?php echo number_format($car->KM,0,'.','.') ?> km</b><br>
                                            Colors: <span style="color: <?php echo Config::$vehColors[$car->ColorOne] ?>; font-weight: bold;"><?php echo $car->ColorOne ?></span>, <span style="color: <?php echo Config::$vehColors[$car->ColorTwo] ?>; font-weight: bold;"><?php echo $car->ColorTwo ?></span><br>
                                            Age: <b><?php echo $car->days; ?> days</b><br>
                                            Vip: <b><?php echo (!$car->Vip ? "No" : "Yes"); ?></b><br>
                                            <?php if($car->Vip == 1) {	?>
                                            Vip Text: <spawn style="color: #<?php echo $car->Vipnamecolor; ?>"><?php echo $car->Vipname; ?><br><?php } ?>
                                        </td>
                                        <td>
                                            <a href="<?php echo Config::$_PAGE_URL ?>map?x=<?php echo $car->Locationx ?>&y=<?php echo $car->Locationy ?>" target="_blank"><i class="icon-map-marker"></i> display on map</a>
                                        </td>
                                    </tr>
                                    <?php }
                                        echo '
                                        	</tbody>
                                        	</table>';
                                                    		} ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="span2">
                        <div class="widget-box transparent">
                            <div class="widget-header widget-header-small">
                                <h4 class="smaller">
                                    <i class="icon-home bigger-110"></i>
                                    House
                                </h4>
                            </div>
                            <div class="widget-body">
                                <div class="widget-main">
                                    <?php
                                        if($data->House == 999) {
                                        if(!isset($_SESSION['user']))
                                        	echo '<p>This user doesn\'t have a house.</p>';
                                        else if(isset($_SESSION['user']) && ($_SESSION['user'] === $user))
                                        	echo '<p>You don\'t have a house.</p>';
                                        else 
                                        	echo '<p>This user doesn\'t have a house.</p>';
                                        } else {
                                        		$s = Config::$g_con->prepare('SELECT * FROM `houses` WHERE `Owner` = ?');
                                        		$s->execute(array($data->name));
                                        		while($house = $s->fetch(PDO::FETCH_OBJ)) 
                                        		{ ?>
                                    House ID:  <b><?php echo $house->ID ?></b><br />
                                    Rent: <b>$<?php echo  number_format($house->Rent,0,'.','.') ?></b>
                                    <p>
                                        Price: 	<b><?php if($house->Owned==0) { ?>$<?php echo number_format($row->Value,0,'.','.') ?><?php }?>
                                        <?php if($house->Owned==1) { ?>Not for sale<?php }?></b><br />
                                        <!--Interior size: -->			
                                        <a href='<?php echo Config::$_PAGE_URL; ?>map?x=<?php echo $house->Entrancex ?>&y=<?php echo $house->Entrancey ?>' target='_blank'><i class='icon-map-marker'></i> display on map</a>
                                        <?php	}
                                            }
                                            ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="span2">
                        <div class="widget-box transparent">
                            <div class="widget-header widget-header-small">
                                <h4 class="smaller">
                                    <i class="icon-bitcoin bigger-110"></i>
                                    Business
                                </h4>
                            </div>
                            <div class="widget-body">
                                <div class="widget-main">
                                    <?php
                                        if($data->Bizz == 999 || $data->Bizz == 255) {
                                        if(!isset($_SESSION['user']))
                                        	echo '<p>This user doesn\'t have a business.</p>';
                                        else if(isset($_SESSION['user']) && ($_SESSION['user'] === $user))
                                        	echo '<p>You don\'t have a business.</p>';
                                        else 
                                        	echo '<p>This user doesn\'t have a business.</p>';
                                        } else {
                                        		$s = Config::$g_con->prepare('SELECT * FROM `bizz` WHERE `Owner` = ?');
                                        		$s->execute(array($data->name));
                                        		while($bizz = $s->fetch(PDO::FETCH_OBJ)) 
                                        		{	?>					
                                    Business ID: <b><?php echo $bizz->ID ?></b><br />
                                    Biz fee: <b>$<?php echo number_format($bizz->EntranceCost,0,'.','.') ?></b><br />
                                    Price: <b>$<?php echo number_format($bizz->BuyPrice,0,'.','.') ?></b><br />
                                    <a href='<?php echo Config::$_PAGE_URL; ?>map?x=<?php echo $bizz->EntranceX ?>&y=<?php echo $bizz->EntranceY ?>' target='_blank'><i class='icon-map-marker'></i> display on map</a>
                                    <?php }								
                                        }
                                        ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
