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

	include("./global.php");
	$pagename = "Jetons";
	$pageid = "jetons";
	
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_jetons 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 jetons = jetons + '".$c['value']."' WHERE username = '".$user['username']."'");
					mysql_query("DELETE FROM cms_jetons WHERE code = '".$code."'");
					$message = "<div id=\"purse-redeem-result\"> 
        <div class=\"redeem-error\"> 
            <div class=\"rounded rounded-green\"> 
                Ton code jetons &agrave; &eacute;t&eacute; valid&eacute;! Tu as recu <b>".Securise($c['value'])."</b> jetons.
            </div> 
        </div> 
</div>"; } else {
			$message = "<div id=\"purse-redeem-result\"> 
        <div class=\"redeem-error\"> 
            <div class=\"rounded rounded-red\"> 
                Ton code jetons est incorrect.
            </div> 
        </div> 
</div>";
	}
} elseif($do == "update") {
// Script de Verification par Cosmik.

$compte_webopass = "4075041044";
$document_webopass = "6201349581";

// Déclaré une variable
$code = trim($_POST['code']);
// Déclaration de la Variable de vérification
$verification_code = @file("http://payer.webopass.fr/valider_code.php?cc=".$compte_webopass."&document=".$document_webopass."&requete=1&code=".$code."&no_saisie_code=1");
$verification_code[0] = trim($verification_code[0]);
// Verification
if(trim($verification_code[0]) == "OUI") {
$pts = "UPDATE users SET jetons = jetons + 5 WHERE id = '".$user['id']."'";
$action = mysql_query($pts);
?>
<script> alert("Achat réussi! Tu as 5 jetons de + dans ton porte monnaie!"); </script>
<?PHP
Redirect("".$url."/jetons.php");
} else {
?>
<script> alert("Code invalide!"); </script>
<?PHP
}
}
?>
<!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 brown">
	
							<h2 class="title">Acheter des Jetons
							</h2>
							
						<script src="<?PHP echo $imagepath; ?>static/js/credits.js" type="text/javascript"></script>
<p class='credits-countries-select'><br /><img class='credits-image' src='./web-gallery/v2/images/newcredits/onlinemoney_crop.png' align='left' />Pour acheter des <b>Badges</b>, un abonnement <b>VIP</b> et des <b>Rares</b> il vous faut des <b>Jetons</b>, vous l'aurez compris les <b>Jetons</b> sont la monnaie payante de <?PHP echo $sitename; ?> sans eux tu n'aura droit à aucun de ces avantages.<br /><br /><u>Comment faire pour en avoir?</u><br /><br />Ceci est simple un module de script de paiement par SMS, Téléphone, Internet est disponible sur <?PHP echo $sitename; ?> c'est donc avec cela que tu pourras acheter des <b>Jetons</b>. Trève de blabla, je pense que tu as envie d'avoir des Jetons? Jette un coup d'oeil ci-dessous:<br><br>
<b>Nombre de Jetons que tu obtiendras: 5 Jetons</b></p>
<ul id="credits-methods">
	<li id="credits-type-promo">
		<h4 class="credits-category-promo">Module de Paiement</h4>
		<ul>
				<li class="clearfix even"><div id="method-44" class="credits-method-container">

					<div class="credits-summary" >
						<h3>Module de Paiement</h3>
						<p>Cliqué sur le lien "Voir le Module &raquo;" pour acheter des Jetons.</p>

						
						<p class="credits-read-more" id="method-show-44" style="display: none">Voir le Module &raquo;</p>
					</div>
					<div id="method-full-44" class="credits-method-full">
							<b>1.</b> Cliqué sur le Drapeau de votre Pays<br>
							<b>2.</b> Choisisez votre mode de paiement<br>
							<b>3.</b> Copier le code donné lors de la fin du paiement<br>
							<b>4.</b> Copier le dans la case en bas "Votre Code"<br>
							<iframe src="http://payer.webopass.fr/affiche_drapeaux.php?cc=4075041044&document=6201349581&skin=3&no_saisie_code=1" height="415" width="430" frameborder="0"></iframe><br><br>
							<form action="?do=update" method="post">
							<center><b><font color="red">Code recu lors du Paiement:</font></b><br>
							<input type="text" name="code"><br><input type="submit" value="Valider"></form></center>

					</div>
					<script type="text/javascript">
					$("method-show-44").show();
					$("method-full-44").hide();
					</script>

				</div></li>
		</ul>
	</li>
	
</ul>

<script type="text/javascript">
L10N.put("credits.navi.read_more", "Voir le Module &raquo;");
L10N.put("credits.navi.close_fulltext", "Fermer le Module &raquo;");
PaymentMethodHabblet.init();
</script>
	
						
					</div>

				</div>
				
</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-jetons">

        <div>Vous avez actuellement:</div>

        <span class="purse-balance-amount"><?PHP echo $user['jetons']; ?> Jetons</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 jetons:</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>             

               


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

<script type="text/javascript">
HabboView.run();
</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> 



