<?php

include('core.php');
include('includes/session.php');

$pagename = "Badge Shop";
$pageid = "badgeshop";

require_once('./templates/community/subheader.php');
require_once('./templates/community/header.php');

?>

<script src="<?php echo $path; ?>/web-gallery/static/js/shop_badge.js" type="text/javascript"></script>

<div id="container">
<div id="content" style="position: relative; left: 0px; top: 0px;" class="clearfix">

<div id="column7" class="column">

<style>
	.error {
		padding: 7px;
		background-color: #fff4f2;
		border: 1px solid #a63c29;
		color: #E2001A;
		margin-top: 5px;
	}

	.error > h3 {
		font-weight: bold;
		margin: 0px;
		padding: 0px;
		font-size: 13px;
	}
	div.goodmsg {
		padding: 7px;
		background-color: #d8f3d8;
		border: 1px solid #4da04d;
		color: #205220;
		margin-top: 5px;
	}

	div.goodmsg > h3 {
		font-weight: bold;
		margin: 0px;
		padding: 0px;
		font-size: 13px;
	}
	div.display_none {
		display: none;
	}
	</style>


		<style type="text/css">
		<!--
		.Estilo1 {
			font-family: Verdana, Arial, Helvetica, sans-serif;
			font-size: 12px;
		}
		-->
		</style>

		<div class="habblet-container ">
		<?php if($myrow['online'] == '1')
{  ?>		
		<div class="cbb clearfix red "> 
		<?php } ?>
		<?php if($myrow['online'] == '0')
{  ?>		
		<div class="cbb clearfix green "> 
		<?php } ?>

		<h2 class="title">Controllo della connessione</h2>

		<div class="box-content">

			<div align="center">
			<?php
			if(isset($my_id)){
			$sql = mysql_query("SELECT online FROM users WHERE id = '".$my_id."' LIMIT 1;");
		$online = mysql_fetch_array($sql);
		if($online['online'] == '1')
		{
		echo '<div class="error" style="-moz-border-radius: 7px; -webkit-border-radius: 7px; padding: 10px;">';
		echo '<h2>ATTENZIONE</h2>';
		echo 'Abbiamo rinscontrato un problema. Per comprare il distintivo dovrai uscire dal client.';
		echo '</div>';
		}
		else
		{
		echo '<div class="goodmsg" style="-moz-border-radius: 7px; -webkit-border-radius: 7px; padding: 10px;">';
		echo '<h2>Perfetto.</h2>';
		echo 'Sei fuori dal client, ora puoi comprare i distintivi.</font>';
		echo '</div>';
		} 
		}
		?>
		</div>
		</div>
		</div>
		</div>
		<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
		
		
		<style type="text/css">
		<!--
		.Estilo1 {
			font-family: Verdana, Arial, Helvetica, sans-serif;
			font-size: 12px;
		}
		-->
		</style>

<div class="habblet-container ">
<div class="cbb clearfix orange "> 
<h2 class="title"><?php echo $shortname; ?> - Compra distintivi</h2> 

<center><br><img src="./web-gallery/images/catalogue/headers/Placas.png"></center>

<div id="credits-safety" class="box-content credits-info">
<div class="credit-info-text clearfix">
<center>

<?php

$i = 0;
$sql = mysql_query("SELECT * FROM cms_marktplatz ORDER BY id ASC LIMIT 100 OFFSET ".$page*20);
while($row = mysql_fetch_assoc($sql)) { 

$i++;
        if(IsEven($i)){
            $even = "even";
        } else {
            $even = "odd";
        }

?>

<li class="<?php echo $even; ?>">
 <table cellpadding='4' cellspacing='0' width='100%'>

 <tr>
  <td class='tablesubheader' width='10%' align='left'><b></b></td>
  <td class='tablesubheader' width='15%' align='left'><b>Nome</b></td>
  <td class='tablesubheader' width='40%' align='left'><b>Descrizione</b></td> 
  <td class='tablesubheader' width='10%' align='left'><b>Bolts</b></td>
 </tr>
<tr>
  <td class='tablerow1' align='left'><img src="<?php echo $cimagesurl.$badgesurl.$row['image']; ?>.gif"></td>
  <td class='tablerow1' align='left'><?php echo $row['name']; ?></td>
  <td class='tablerow1' align='left'><?php echo $row['description']; ?></td>
  <td class='tablerow1' align='left'><?php echo $row['vip_points']; ?></td>
  <td class='tablerow1'><a class="new-button" onclick="habboclub.buttonClick(<?php echo $row['id']; ?>,'Compra il distintivo'); return false; "href="#" id="webstore-purchase-disabled"><b>Compra</b><i></i></a></td>

</td>
</tr>
</table>
</li>


<?php } ?>
							
</div>
</div>
</div>
</div>
</div>

<script type="text/javascript">
HabboView.run();
</script>
<div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
</div>

<?php require_once('./templates/community/footer.php'); ?>