<?PHP
#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|
#|                                                                        #|
#|         JabboCMS - Website and Content Management System               #|
#|         Copyright © 2011 Jor.dan. All rights reserved.                 #|
#|																		  #|
#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|

	include("./global.php");
	$pagename = "Cr&eacute;dits";
	$pageid = "credits";
	
if(!session_is_registered(username))
	{
		Redirect("".$url."/index.php");
	}
	
 $do = Securise($_GET['do']);
	if($do == "code") {
		$code = Securise($_POST['code']);
			$sql = mysql_query("SELECT * FROM cms_vouchers WHERE code = '".$code."' AND username = '".$user['username']."'");
			$row = mysql_num_rows($sql);
				if($row > 0) {
				 $c = mysql_fetch_assoc($sql);
					mysql_query("UPDATE users SET credits = credits + '".$c['value']."' WHERE username = '".$user['username']."'");
					mysql_query("DELETE FROM cms_vouchers WHERE code = '".$code."'");
					$message = "<div id=\"purse-redeem-result\"> 
        <div class=\"redeem-error\"> 
            <div class=\"rounded rounded-green\"> 
                Ton code cr&eacute;dits &agrave; &eacute;t&eacute; valid&eacute;! Tu as recu <b>".Securise($c['value'])."</b> cr&eacute;dits.
            </div> 
        </div> 
</div>"; } else {
			$message = "<div id=\"purse-redeem-result\"> 
        <div class=\"redeem-error\"> 
            <div class=\"rounded rounded-red\"> 
                Ton code cr&eacute;dits est incorrect.
            </div> 
        </div> 
</div>";
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head> 
<meta http-equiv="content-type" content="text/html; charset=ISO 5589-1" /> 
<title><?PHP echo $sitename; ?>: <?PHP echo $pagename; ?></title> 
 
<script type="text/javascript"> 
var andSoItBegins = (new Date()).getTime();
var ad_keywords = "";
document.habboLoggedIn = true;
var habboName = "<?PHP echo $user['username']; ?>";
var habboReqPath = "<?PHP echo $url; ?>";
var habboStaticFilePath = "<?PHP echo $imagepath; ?>";
var habboImagerUrl = "http://www.habbo.com/habbo-imaging/";
var habboPartner = "";
var habboDefaultClientPopupUrl = "<?PHP echo $url; ?>/client";
window.name = "habboMain";
if (typeof HabboClient != "undefined") { HabboClient.windowName = "uberClientWnd"; }
</script> 



<link rel="shortcut icon" href="<?PHP echo $imagepath; ?>favicon.ico" type="image/vnd.microsoft.icon" /> 
<script src="<?PHP echo $imagepath; ?>static/js/libs2.js" type="text/javascript"></script>
<script src="<?PHP echo $imagepath; ?>static/js/visual.js" type="text/javascript"></script>
<script src="<?PHP echo $imagepath; ?>static/js/libs.js" type="text/javascript"></script>
<script src="<?PHP echo $imagepath; ?>static/js/common.js" type="text/javascript"></script>

<script src="<?PHP echo $imagepath; ?>static/js/fullcontent.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/style.css" type="text/css" />
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/buttons.css" type="text/css" />
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/boxes.css" type="text/css" />
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/tooltips.css" type="text/css" />
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/personal.css" type="text/css" />
<script src="<?PHP echo $imagepath; ?>static/js/habboclub.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/minimail.css" type="text/css" />
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/myhabbo/control.textarea.css" type="text/css" />
<script src="<?PHP echo $imagepath; ?>static/js/minimail.js" type="text/javascript"></script>

 

<meta name="description" content="<?PHP echo $description; ?>" /> 
<meta name="keywords" content="<?PHP echo $keyword; ?>" />  
<!--[if IE 8]>
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/ie8.css" type="text/css" />
<![endif]--> 
<!--[if lt IE 8]>
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/ie.css" type="text/css" />
<![endif]--> 
<!--[if lt IE 7]>
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/ie6.css" type="text/css" />
<script src="<?PHP echo $imagepath; ?>static/js/pngfix.js" type="text/javascript"></script>
<script type="text/javascript">
try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
</script>
 
<style type="text/css">
body { behavior: url(http://www.habbo.com/js/csshover.htc); }
</style>
<![endif]--> 
<meta name="build" content="<?PHP echo $build; ?> >> <?PHP echo $version; ?>" /> 
</head>


	 
<body id="home" class=" "> 
<div id="overlay"></div> 
<!-- MENU -->
<?PHP include("./template/header.php"); ?>
<!-- FIN MENU -->

<div id='container'>
<div id='content'>
<div id='column1' class='column'><div class='habblet-container '>        
<div class='cbb clearfix green '>
    
<h2 class='title'>Les cr&eacute;dits gratuit</h2>
<p class='credits-countries-select'><br /><img class='credits-image' src='./web-gallery/album1/palmchair.gif' align='left' />Pour acheter des mobis il vous faut des <b>cr&eacute;dits</b>. Lors de votre inscription <b><?PHP echo $sitename; ?></b> vous offre des cr&eacute;dits gratuit, si par hasard vous &ecirc;tes &agrave; court de cr&eacute;dits vous pouvez en gagner comme-ceci:<li>* Faite inscrire vos amis avec le lien de parrainage.</li><li>* Demander &agrave; un staff.</li><li>* Gagner &agrave; un concour et remporter un code cr&eacute;dits.</li><li>* Echang&eacute; vos mobiliers contre des cr&eacute;dits.</li><br /><br /></p>

</div>
</div>

<div class='habblet-container '>        
<div class='cbb clearfix blue '>
    
<h2 class='title'>Lien de parrainage</h2>
<p class='credits-countries-select'><br /><b>1...</b><br /><br />
        <input type="text" size="60%" README value="<?PHP echo $url; ?>/register.php?username=<?PHP echo $user['username']; ?>"><br /><br />
        <b>2...</b></p>

</div>
 </div>

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

                <div class="habblet-container ">        

                        <div class="cbb clearfix brown ">

    

                            <h2 class="title">Votre porte monnaie

                            </h2>

                        <div id="purse-habblet">

                                                        <form method="post" action="?do=code" id="vxoucher-form">

<ul>

    <li class="even icon-purse">

        <div>Vous avez actuellement:</div>

        <span class="purse-balance-amount"><?PHP echo $user['credits']; ?> cr&eacute;dits</span>

        <!--<div class="purse-tx"><a href="transactions.php">Account transactions</a></div>-->

    </li>



    <li class="odd">

        <div class="box-content">

            <div>Entr&eacute; votre code cr&eacute;dits:</div>

            <input type="text" name="code" value="" id="purse-habblet-redeemcode-string" class="redeemcode" />
&nbsp;
            <input type="image" src="<?PHP echo $imagepath; ?>v2/images/valider.png">
<?PHP if(isset($message)) { echo "<br>".$message.""; } ?>
        </div>

    </li>

</ul>

<div id="purse-redeem-result">

</div>    </form>

        </div>



<script type="text/javascript">

    new PurseHabblet();

</script>

    

                        

                    </div>

                </div>

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

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

                <div class='habblet-container '>        
                        <div class='cbb clearfix red '>
    
                            <h2 class='title'>Les 10 plus riche de l'h&ocirc;tel</h2>
                        <div id='credits-promo' class='box-content credits-info'>
    <div class='credit-info-text clearfix'>
    
<div class='tableborder'> 
 <table cellpadding='4' cellspacing='0' width='100%'> 
 <tr> 
  <td class='tablesubheader' width='50%' align='center'><b>Pseudo</b></td> 
  <td class='tablesubheader' width='50%' align='center'><b>Cr&eacute;dits</b></td>   
 </tr> 

 <?PHP
 $sql = mysql_query("SELECT username, credits FROM users ORDER BY credits DESC LIMIT 0,10");
 
 while($a = mysql_fetch_array($sql)) {
	echo "<tr> 
  <td class='tablerow1' align='center'><a href=\"".$url."\">".Securise($a['username'])."</a></td> 
  <td class='tablerow2' align='center'>".Securise($a['credits'])."</td>

</tr>";
	} ?>

 </table>
</div>

</div>
    
                        
                    </div>
                </div></div>


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

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

<script type="text/javascript">
HabboView.run();

</script>
				<div class="habblet-container ">
						<div class="ad-container">
						</div>
				</div>

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


    

	<!--[if lt IE 7]>
<script type="text/javascript">
Pngfix.doPngImageFix();
</script>
<![endif]--> 
<!-- FOOTER -->
<?PHP include("./template/footer.php"); ?>
<!-- FIN FOOTER -->


<div style="clear: both;"></div>


</div></div></div></div>

 
<script type="text/javascript"> 
HabboView.run();

</script>


</body> 
</html> 



