boleknowak

Untitled

Jan 2nd, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.02 KB | None | 0 0
  1. <?php
  2. session_start();
  3. include_once '../include/class.user.php';
  4. $user = new User();
  5.  
  6. $uid = $_SESSION['uid'];
  7.  
  8. if (!$user->get_session()){
  9. header("location: ../login.php");
  10. }
  11.  
  12. if (isset($_GET['q'])){
  13. $user->user_logout();
  14. header("location: ../login.php");
  15. }
  16. ?>
  17.  
  18.  
  19. <!DOCTYPE html>
  20. <html lang="en">
  21. <head>
  22. <title>WebTools</title>
  23. <meta charset="utf-8">
  24. <meta name="viewport" content="width=device-width, initial-scale=1">
  25. <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
  26. <!--<link rel="stylesheet" type="text/css" href="style.css">-->
  27. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  28. <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  29. </head>
  30. <body>
  31. <style>
  32. body{
  33. background: #F5F5F5;
  34. }
  35. </style>
  36. <nav class="navbar navbar-inverse">
  37. <div class="container-fluid">
  38. <div class="navbar-header">
  39. <a class="navbar-brand" href="#">WebTools</a>
  40. </div>
  41. <div>
  42. <ul class="nav navbar-nav">
  43. <li class="active"><a href="index.php">Strona Główna</a></li>
  44. <li><a href="info.php">Informacje</a></li>
  45. <li><a href="konsola.php">Konsola</a></li>
  46. <li><a href="report.php">Zgłoszenia</a></li>
  47. <li><a href="itemshop.php">ItemShop</a></li>
  48. </ul>
  49.  
  50.  
  51.  
  52. <ul class="nav navbar-nav navbar-right">
  53. <li class="dropdown">
  54. <li><a href="#"><?php echo ''.$user->get_money($uid).'$' ?>
  55. <li><a class="dropdown-toggle" data-toggle="dropdown" href="#"><?php echo "".$user->get_name($uid); ?>
  56. <span class="caret"></span></a>
  57. <ul class="dropdown-menu">
  58. <li><a href="#" data-toggle='modal' data-target='#addMoney'>Dodaj kase</a></li>
  59. <li><a href="index.php?q=logout">Wyloguj się</a></li>
  60. </ul>
  61. </div>
  62. </div>
  63. </nav>
  64. <div class="container">
  65. <!-- Modal -->
  66. <div class="modal fade" id="addMoney" role="dialog">
  67. <div class="modal-dialog modal-sm">
  68. <div class="modal-content">
  69. <div class="modal-header">
  70. <button type="button" class="close" data-dismiss="modal">&times;</button>
  71. <h4 class="modal-title">Dodawanie kasy</h4>
  72. </div>
  73. <form action="" method="POST">
  74. <div class="modal-body">
  75. <p>Wpisz ilość kasy poniżej, aby dodać</p>
  76. <input name="money_input" type="text" class="form-control input-sm" id="inputsm"></input>
  77. </div>
  78. <div class="modal-footer">
  79. <input type="submit" value="Dodaj" name="money_button" class="btn btn-success">
  80. <button type="button" class="btn btn-danger" data-dismiss="modal"> Wyjdź</button>
  81. </div>
  82. </form>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </body>
  88.  
  89. <?php
  90. if(isset($_POST['money_button']))
  91. {
  92. $value = $_POST['money_input'];
  93. $newmoney = $money2 + $value;
  94. $sql = "UPDATE users SET " . $newmoney . " WHERE uid= " . $uid . "";
  95.  
  96. echo '<div class="alert alert-success"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
  97. <strong>Sukces!</strong> Dodałeś <strong>' . $value . ' $</strong> do konta <strong>' . $_SESSION["user"] . '</strong> !
  98. </div>';
  99. }
  100. ?>
  101.  
  102.  
  103. <body>
  104. <center>
  105. <div id="wrapper">
  106. <div class="jumbotron">
  107. <?php
  108. if ($_SERVER['HTTP_X_FORWARDED_FOR']) {
  109. $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
  110. }
  111. else {
  112. $ip = $_SERVER['REMOTE_ADDR'];
  113. }
  114. $host = gethostbyaddr($ip);
  115. ?>
  116. <h5><strong>Twoje IP:</strong> <?php echo "$ip"; ?></h5>
  117. <h5><strong>IP serwera:</strong> localhost</h5>
  118. </div>
  119. </div>
  120. <div id="wrapper">
  121. <div class="jumbotron">
  122. <h4></h4>
  123. </div>
  124. </div>
  125. <div id="wrapper">
  126. <div class="jumbotron">
  127. <h4></h4>
  128. </div>
  129. </div>
  130. </center>
  131. </body>
  132. <audio autoplay>
  133. <source src="sound2.mp3" type="audio/mpeg">
  134. .
  135. </audio>
  136. </html>
Advertisement
Add Comment
Please, Sign In to add comment