Guest User

api

a guest
Feb 9th, 2017
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1.  
  2. <?php
  3.  
  4. require_once("dtoverride.php");
  5. dbc();
  6. require_once("connection.php");
  7. $coodata = secure_uid_cookie($_COOKIE["uid"]);
  8. $user_data = mysql_fetch_assoc(mysql_query("SELECT * FROM user_data WHERE user_id = " . $coodata . " LIMIT 1"));
  9. $usr = $user_data["mushroom"];
  10. $wys = "=number_format($usr/100, 2, ',' , ',')";
  11. if(proof_uid_cookie($_COOKIE["uid"]) == "0")
  12. {
  13. echo <<< END
  14. <br><br><br><br><br>
  15. <div class="alert alert-danger" role="alert">
  16. <a href="index.php" class="alert-link"><center><h1><font color ="yellow"><h1>Aby móc w pełni korzystać z sklepu musisz się zalogować ! </font></center></a>
  17. </div>
  18. END;
  19. }
  20.  
  21. if (isset($_POST['check_code']) && isset($_POST['code'])) {
  22.  
  23. $id = 0;
  24. $code = addslashes($_POST['code']);
  25. $number = 74068;
  26. $desc = "Kupno grzybków";
  27.  
  28. $api = @file_get_contents("https://lvlup.pro/api/checksms?id=".$id."&code=".$code."&number=".$number."&desc=".$desc);
  29.  
  30. $json = json_decode($api);
  31.  
  32. if(empty($code))
  33. {
  34. echo 'Brak kodu SMS.';
  35. $error = 1;
  36. }
  37. else if (!isset($api))
  38. {
  39. echo 'Brak połączania z API';
  40. $error = 1;
  41. }
  42. else if (isset($api->error) && $api->error)
  43. {
  44. echo $api->error;
  45. $error = 1;
  46. }
  47.  
  48. if(!isset($error))
  49. {
  50. $api = json_decode($api);
  51.  
  52. if (is_object($api) AND $api->status == 'OK') {
  53. echo 'Transakcja przebiegła prawidłowo Doładowano 500 grzybów !';
  54. mysql_query("UPDATE user_data SET mushroom=mushroom+500, mushroom_bought=mushroom_bought+500 WHERE user_id = $coodata ");
  55. } else {
  56. echo 'Błędny kod';
  57. }
  58. }
  59. }
  60.  
  61. ?>
  62.  
  63. <br><br><br><br>
  64. <meta charset="utf-8" />
  65. <style type="text/css">
  66. body {
  67. background-image:url(http://sfplay.hostmc.pl/game/res/shop/bgg.png);
  68. background-repeat:no-repeat;
  69. background-position:top center;
  70. background-size:100% 100%;
  71. background-color:#000000;
  72. font-family: Tahoma, Arial, Helvetica, sans-serif;
  73. color: #FFFFFF;
  74. margin: 50px auto auto 0;
  75. background-attachment:fixed;
  76. }
  77.  
  78. a:link { text-decoration:none; color:#ffd9aa; }
  79. a:visited { text-decoration:none; color:#ffd9aa; }
  80. a:hover { text-decoration:underline; color:#ffd9aa; }
  81. a:active { text-decoration:none; color:#ffd9aa; }
  82. a:focus { text-decoration:none; color:#ffd9aa; }
  83. h1{
  84. font-size: 1.2em;
  85. font-weight: bold;
  86. padding:0;
  87. margin:0;
  88. margin-bottom: 0.5em;
  89. }
  90.  
  91. #box {
  92. background:rgba(0,0,0,0.7);
  93. padding: 10px;
  94. width: 800px;
  95. -moz-border-radius:30px 30px 30px 30px;
  96. -webkit-border-radius:30px 30px 30px 30px;
  97. -khtml-border-radius:30px 30px 30px 30px;
  98. border-radius:30px 30px 30px 30px;
  99. behavior:url(border-radius.htc);
  100. }
  101.  
  102. </style>
  103.  
  104. <center>
  105. <div id="box" style="font-family: Tahoma, Arial, Helvetica, sans-serif; color: #FFFFFF; margin: auto;">
  106. <ol type="I">
  107. <title>SMS Shop</title>
  108. <form action="index.php" method="post">
  109. <h1><font color="red" />Kup Grzyby dla postaci:</font></h1><font color="lime" /><h1></u><?=$user_data["user_name"]?>(ID: <?=$user_data["user_id"]?>)</font></u><br><br>
  110. <select id="blue" name="wybor">
  111. <optgroup label="Wybierz płatność która Cie interesuje">
  112. <option value="1">500 Grzybów - SMS o treści AP.HOSTMC na numer 74068 koszt 4,92 zł </option>
  113. </optgroup>
  114. </select>
  115. <br><br>
  116. <form method="post">
  117. <h4>Kod SMS</h4>
  118. <input class="form-control" type="text" name="code" class="text" size="15" value="" /><br><br>
  119. <input name="check_code" type="submit" value="Sprawdz" />
  120. </form>
  121. </ol>
  122.  
  123. </center>
Advertisement
Add Comment
Please, Sign In to add comment