Advertisement
Guest User

Untitled

a guest
Jan 25th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.44 KB | None | 0 0
  1. <html>
  2. <head>
  3.  
  4. <!-- Basic Page Needs
  5. –––––––––––––––––––––––––––––––––––––––––––––––––– -->
  6. <meta charset="utf-8">
  7. <title>PID-Market</title>
  8. <meta name="description" content="Personal Identity Market">
  9. <meta name="author" content="Lennert Smets">
  10.  
  11. <!-- Mobile Specific Metas
  12. –––––––––––––––––––––––––––––––––––––––––––––––––– -->
  13. <meta name="viewport" content="width=device-width, initial-scale=1">
  14.  
  15. <!-- FONT
  16. –––––––––––––––––––––––––––––––––––––––––––––––––– -->
  17. <link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">
  18.  
  19. <!-- CSS
  20. –––––––––––––––––––––––––––––––––––––––––––––––––– -->
  21. <link rel="stylesheet" href="css/normalize.css">
  22. <link rel="stylesheet" href="css/skeleton.css">
  23.  
  24. <!-- Favicon
  25. –––––––––––––––––––––––––––––––––––––––––––––––––– -->
  26. <link rel="icon" type="image/png" href="images/favicon.png">
  27.  
  28. <!-- Add jQuery library -->
  29. <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
  30. <script src="http://cdn.jquerytools.org/1.2.6/full/jquery.tools.min.js"></script>
  31.  
  32. </head>
  33. <body>
  34.  
  35. <?php
  36.  
  37. $servername = "";
  38. $username = "";
  39. $password = "";
  40. $dbname = "";
  41.  
  42. $link1 = 0;
  43. $link2 = 0;
  44. $link3 = 0;
  45.  
  46. $conn = new mysqli($servername, $username, $password, $dbname);
  47. // Check connection
  48. if ($conn->connect_error) {
  49. die("Connection failed: " . $conn->connect_error);
  50. }
  51.  
  52. $logged_user = $_GET['id'];
  53.  
  54. echo'<a style="display:block" href="redirect.php?id='.$logged_user.'" style="text-decoration:none; color:black;">';
  55. echo'<div id="header">';
  56. echo'<center><h2> PID-market </h2></center>';
  57. echo'</div>';
  58. echo'</a>';
  59.  
  60. $sql1 = "SELECT credit, link1, link2, link3 FROM critical_design_2015 WHERE id = '$logged_user'";
  61. $result = $conn->query($sql1);
  62.  
  63. while($row = $result->fetch_assoc()) {
  64. $link1 = $row['link1'];
  65. $link2 = $row['link2'];
  66. $link3 = $row['link3'];
  67. $credit = $row['credit'];
  68. }
  69.  
  70. echo'<div id="bought">';
  71. echo'<div id="bought-header">';
  72. echo'<center><h5>Purchase-List - Credits :'.$credit.'</h5></center>';
  73. echo'</div>';
  74.  
  75. echo'<div id="bought-content">';
  76. echo'<div id="profile1">';
  77. if ($link1 !=''){
  78. echo '<image class="bought-image" src="http://graph.facebook.com/'.$link1.'/picture?type=large"><br>';
  79.  
  80.  
  81. echo'<div id="bought-profile-info">';
  82. echo"<form action='profile.php?id=".$link1."' method='post'>
  83. <input type ='hidden' name ='boughtid' id='boughtid' value='".$link1."'>
  84. ".$link1."
  85. <input type ='submit' class='overlay' name ='submit' rel='overlay' value ='View details'>
  86. </form>";
  87. echo'</div>';
  88. }
  89. echo'</div>';
  90.  
  91. echo'<div id="profile2">';
  92. if ($link2 !=''){
  93. echo '<image class="bought-image" src="http://graph.facebook.com/'.$link2.'/picture?type=large"><br>';
  94.  
  95. echo'<div id="bought-profile-info">';
  96. echo"<form action='profile.php?id=".$link2."' method='post'>
  97. <input type ='hidden' name ='boughtid' id='boughtid' value='".$link2."'>
  98. ".$link2."
  99. <input type ='submit' class='overlay' name ='submit' rel='overlay' value ='View details'>
  100. </form>";
  101. echo'</div>';
  102. }
  103. echo'</div>';
  104.  
  105. echo'<div id="profile3">';
  106. if ($link3 !=''){
  107.  
  108. echo '<image class="bought-image" src="http://graph.facebook.com/'.$link3.'/picture?type=large"><br>';
  109.  
  110. echo'<div id="bought-profile-info">';
  111. echo"<form action='profile.php?id=".$link3."' method='post'>
  112. <input type ='hidden' name ='boughtid' id='boughtid' value='".$link3."'>
  113. ".$link3."
  114. <input type ='submit' class='overlay' name ='submit' rel='overlay' value ='View details'>
  115. </form>";
  116. echo'</div>';
  117. }
  118. echo'</div>';
  119. echo'</div>';
  120. echo'</div>';
  121.  
  122. echo'<div class="container">';
  123. echo' <div class="row">';
  124.  
  125. $sql = "SELECT id, name, email, gender, picture FROM critical_design_2015";
  126. $result = $conn->query($sql);
  127.  
  128. if ($result->num_rows > 0) {
  129. // output data of each row
  130. while($row = $result->fetch_assoc()) {
  131.  
  132. echo '<div class="four columns"> ';
  133. echo '<image src="'.$row["picture"].'"><br>';
  134. echo '<div class="content">'.
  135. " - ID: " . $row["id"]. "<br>".
  136. " - Name: " . $row["name"]. "<br>".
  137. " - Email: " . $row["email"]. "<br>".
  138. " - Gender: " . $row["gender"]. "<br>"."<br>".
  139. " <center><b> Price : 1 Credit </b></center> ".
  140. "<form action'redirect.ph' method='post'>
  141. <input type ='hidden' name ='dataid' id='dataid' value='".$row["id"]."'>
  142. <input type ='submit' name ='submit2' value ='Buy'>
  143. </form>";
  144.  
  145. echo '</div>';
  146.  
  147. echo '</div>';
  148.  
  149. }
  150. } else {
  151. echo "0 results";
  152. }
  153.  
  154. if(isset($_POST['submit2'])) {
  155. $dataid = $_POST['dataid'];
  156.  
  157. if ($link1 =='' && $link1 != $dataid && $link2 != $dataid && $link2 != $dataid ){
  158. $sql4 = "UPDATE critical_design_2015 SET link1 = $dataid WHERE id = $logged_user";
  159. $conn->query($sql4) === TRUE;
  160.  
  161. switch ($credit){
  162.  
  163. case '0':
  164. echo'You have run out of credits, please add more information to your account to continue shopping.';
  165. break;
  166.  
  167. case '1':
  168. $sql6 = "UPDATE critical_design_2015 SET credit = 0 WHERE id = $logged_user";
  169. $conn->query($sql6) === TRUE;
  170. echo'<script>location.reload(); </script>';
  171. break;
  172.  
  173. case '2':
  174. $sql555 = "UPDATE critical_design_2015 SET credit = 1 WHERE id = $logged_user";
  175. $conn->query($sql555) === TRUE;
  176. echo'<script>location.reload(); </script>';
  177. break;
  178.  
  179.  
  180. case '3':
  181. $sql5 = "UPDATE critical_design_2015 SET credit = 2 WHERE id = $logged_user";
  182. $conn->query($sql5) === TRUE;
  183. echo'<script>location.reload(); </script>';
  184. break;
  185.  
  186. }
  187. }
  188. else if ($link2 =='' && $link1 != $dataid && $link2 != $dataid && $link2 != $dataid ){
  189. $sql7 = "UPDATE critical_design_2015 SET link2 = $dataid WHERE id = $logged_user";
  190. $conn->query($sql7) === TRUE;
  191.  
  192. switch ($credit){
  193.  
  194. case '0':
  195. echo'you have run out of credits, Contact our staff for business packages!';
  196. break;
  197.  
  198. case '1':
  199. $sql10 = "UPDATE critical_design_2015 SET credit = 0 WHERE id = $logged_user";
  200. $conn->query($sql10) === TRUE;
  201. echo'<script>location.reload(); </script>';
  202. break;
  203.  
  204. case '2':
  205. $sql9 = "UPDATE critical_design_2015 SET credit = 1 WHERE id = $logged_user";
  206. $conn->query($sql9) === TRUE;
  207. echo'<script>location.reload(); </script>';
  208. break;
  209.  
  210. case '3':
  211. $sql8 = "UPDATE critical_design_2015 SET credit = 2 WHERE id = $logged_user";
  212. $conn->query($sql8) === TRUE;
  213. echo'<script>location.reload(); </script>';
  214. break;
  215. }
  216. }
  217. else if ($link3 =='' && $link1 != $dataid && $link2 != $dataid && $link2 != $dataid ){
  218. $sql11 = "UPDATE critical_design_2015 SET link3 = $dataid WHERE id = $logged_user";
  219. $conn->query($sql11) === TRUE;
  220.  
  221. switch ($credit){
  222. case '0':
  223. echo'you have run out of credits, please add more information to your account to continue shopping.';
  224. break;
  225.  
  226. case '1':
  227. $sql14 = "UPDATE critical_design_2015 SET credit = 0 WHERE id = $logged_user";
  228. $conn->query($sql14) === TRUE;
  229. echo'<script>location.reload(); </script>';
  230. break;
  231.  
  232. case '2':
  233. $sql13 = "UPDATE critical_design_2015 SET credit = 1 WHERE id = $logged_user";
  234. $conn->query($sql13) === TRUE;
  235. echo'<script>location.reload(); </script>';
  236. break;
  237.  
  238. case '3':
  239. $sql12 = "UPDATE critical_design_2015 SET credit = 2 WHERE id = $logged_user";
  240. $conn->query($sql12) === TRUE;
  241. echo'<script>location.reload(); </script>';
  242. break;
  243.  
  244. }
  245. }
  246. else{
  247. echo'you have reached the maximum bought accounts or you are trying to purchase data that is already in your account, contact our customer service for business packages';
  248. }
  249. }
  250.  
  251.  
  252. $conn->close();
  253. ?>
  254.  
  255.  
  256. </div>
  257. </div>
  258.  
  259. </body>
  260. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement