Advertisement
Warzcube

code site

Jul 27th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.54 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if(!empty($_SESSION)){
  4. $bdd = new PDO('mysql:host=127.0.0.1;dbname=//name', '//user', '//mdp');
  5.  
  6. $requser = $bdd->prepare("SELECT * FROM users WHERE id = ?");
  7. $requser->execute(array($_SESSION['id']));
  8. $userexist = $requser->rowCount();
  9. $userinfo = $requser->fetch();
  10. $_SESSION['id'] = $userinfo['id'];
  11. $_SESSION['points'] = $userinfo['points'];
  12. $_SESSION['kitlegende'] = $userinfo['kitlegende'];
  13.  
  14. $reqsite = $bdd->prepare("SELECT * FROM configurationsite WHERE nom = 'kitlegende'");
  15. $reqsite->execute(array($_SESSION['nom']));
  16. $siteexist = $reqsite->rowCount();
  17. $siteinfo = $reqsite->fetch();
  18. $_SESSION['nom'] = $siteinfo['nom'];
  19. $_SESSION['statut'] = $siteinfo['statut'];
  20. $_SESSION['commentaires'] = $siteinfo['commentaires'];
  21.  
  22.  
  23. }
  24.  
  25.  
  26.  
  27. ?>
  28. <!DOCTYPE html>
  29. <html lang="fr-FR">
  30. <head>
  31. <title>Boutique | Darksky - Serveur Unturned</title>
  32. <link rel="stylesheet" href="http://darksky.ga/assets/css/style.css"/>
  33. <link href="http://darksky.ga/assets/css/bootstrap.min.css" rel="stylesheet"/>
  34. <link rel="stylesheet" type="text/css" href="http://darksky.ga/assets/css/font-awesome.min.css" />
  35. <script src="//api.dedipass.com/v1/pay.js"></script>
  36.  
  37. <meta charset="utf-8"/>
  38. </head>
  39. <body>
  40. <header>
  41. <div class="container">
  42. <div class="left">
  43. <div class="logo">Darksky</div>
  44.  
  45. </div>
  46. <div class="left">
  47. <ul class="menu">
  48. <a href="http://darksky.ga"><li>Accueil</li></a>
  49. <a href="/pages/staff.php"><li>Staff</li></a>
  50. <a href="/pages/shop/index.php"><li>Boutique</li></a>
  51. <a href="/pages/don.php"><li>Don</li></a>
  52. <a href="/pages/partenaires.php"><li>Partenaires</li></a>
  53. <?php if(empty($_SESSION)){
  54.  
  55.  
  56. ?>
  57. <a href="http://darksky.ga/pages/membres/register.php"><li>S'inscrire</li></a>
  58. <a href="http://darksky.ga/pages/membres/connect.php"><li>Se connecter</li></a>
  59. <?php }else{
  60. echo' <a href="http://darksky.ga/pages/membres/profil.php?id='.$_SESSION['id'].'"><li>mon profil</li></a>';
  61. }
  62.  
  63.  
  64. ?>
  65.  
  66. </ul>
  67.  
  68.  
  69.  
  70. </div>
  71.  
  72. <div class="right">
  73. <ul class="scroll">
  74. <li class="title">
  75. <a href="#Languages"><i class="fa fa-language"></i> Languages <i class="fa fa-angle-down"></i></a>
  76. <ul class="sous_menu">
  77. <li><a href="http://darksky.ga/en/pages/shop/kit-legende.php"><img src="http://planete.cliparts.free.fr/cliparts/albums/monde/drapeaux/drapeau_eb-069.gif" width="20" height="15">English</a></li>
  78. <li><a href="http://darksky.ga/pages/shop/kit-legende.php"><img src="http://planete.cliparts.free.fr/cliparts/albums/monde/drapeaux/thumb_drapeau_eb-031.gif" width="20" height="15">Français</a></li>
  79. </ul>
  80.  
  81. </li>
  82.  
  83. </ul>
  84. </div>
  85. </div>
  86.  
  87. </header>
  88. <br />
  89. <div class="block">
  90. <div class="titre">Grade Legende | Boutique - Darksky:</div>
  91.  
  92. <div class="callout callout-success" id="callout-buttons-color-accessibility">
  93. <h4>Grade Legende:</h4>
  94. <p class="text-justify">Bientôt</p>
  95.  
  96. <div class="callout callout-info" id="callout-buttons-color-accessibility">
  97. <h4>Prix du grade : 10.00€</h4>
  98. <p class="text-justify">Moyens de paiements: allopass, paypal, paysafecard, et bien d'autres...</p>
  99. </div>
  100. <div class="callout callout-warning" id="callout-buttons-color-accessibility">
  101. <h4>Quels seront mes avantages:</h4>
  102. <p class="text-justify">Le grade légende dispose d'un kit custom, c'est à dire que vous choisissez les items de votre kit. Le legende a aussi la particularité de parler en noir dans le tchat.</p>
  103. </div>
  104.  
  105.  
  106. <?php if(empty($_SESSION)){
  107.  
  108.  
  109. ?>
  110. <span class="label label-danger"> Connectez-vous pour acheter ce kit! </span><br />
  111. <?php }else{
  112. $statut = $siteinfo['statut'];
  113. $commentaires = $siteinfo['commentaires'];
  114. if($statut == 1){
  115. $points = $userinfo['points'];
  116. $kitlegende = $userinfo['kitlegende'];
  117. if($kitlegende == 1 ){
  118. echo'<span class="label label-success"> Vous achat a été validé, il est en attente de confirmation d\'un admin. </span><br />';
  119. }else if($kitlegende >= 2 ){
  120. echo'<span class="label label-warning"> Vous possédez ce kit, vous ne pouvez pas recommencer votre achat. </span><br />';
  121. }else{
  122. if($points < 1000 )
  123. {
  124. echo'<p class="label label-danger"> Vous n\'avez pas assez de points pour acheter ce kit! </p><br />';
  125. }else{
  126.  
  127. ?>
  128. <form method="POST" action="">
  129. <input type="submit" name="success" value=" Acheter ce kit. "/>
  130. </form>
  131.  
  132. <?php
  133. if(isset($_POST['success']))
  134. {
  135.  
  136. $points = $userinfo['points'];
  137. $newpoints = $points - 1000;
  138. $kitlegende = $userinfo['kitlegende'];
  139. $newvaluekit = $kitlegende + 1;
  140. $insertpoints = $bdd->prepare("UPDATE users SET points = ?, kitlegende = ? WHERE id = ?");
  141. $insertpoints->execute(array($newpoints, $newvaluekit, $_SESSION['id']));
  142. header("Location: http://darksky.ga/pages/shop/kit-legende.php");
  143.  
  144. }
  145. }
  146. }
  147. }else{
  148. echo'<span class="label label-danger">' .$commentaires. '</span><br />';
  149. }
  150. }
  151.  
  152. ?>
  153.  
  154. </div>
  155.  
  156. <br /><br />
  157.  
  158.  
  159. </div>
  160. <p style="text-align: center;">
  161. <img src="http://images.akamai.steamusercontent.com/ugc/49865910643647558/CEE3A08B64E1B2271D9754982B1FE401EC6CDC36/" width="560" height="301" >
  162.  
  163. </p>
  164. <br />
  165. <footer>
  166. <div class="footertext">
  167. <div class="left">
  168. Tous droits réservés Darksky &copy; 2016 | Nous contacter: contact@darksky.ga
  169. </div>
  170. <div class="right">
  171. by Warzcube
  172. </div>
  173. </div>
  174. </footer>
  175. </body>
  176. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement