Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <!-- Basic Page Needs
- –––––––––––––––––––––––––––––––––––––––––––––––––– -->
- <meta charset="utf-8">
- <title>PID-Market</title>
- <meta name="description" content="Personal Identity Market">
- <meta name="author" content="Lennert Smets">
- <!-- Mobile Specific Metas
- –––––––––––––––––––––––––––––––––––––––––––––––––– -->
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!-- FONT
- –––––––––––––––––––––––––––––––––––––––––––––––––– -->
- <link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">
- <!-- CSS
- –––––––––––––––––––––––––––––––––––––––––––––––––– -->
- <link rel="stylesheet" href="css/normalize.css">
- <link rel="stylesheet" href="css/skeleton.css">
- <!-- Favicon
- –––––––––––––––––––––––––––––––––––––––––––––––––– -->
- <link rel="icon" type="image/png" href="images/favicon.png">
- <!-- Add jQuery library -->
- <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
- <script src="http://cdn.jquerytools.org/1.2.6/full/jquery.tools.min.js"></script>
- </head>
- <body>
- <?php
- $servername = "";
- $username = "";
- $password = "";
- $dbname = "";
- $link1 = 0;
- $link2 = 0;
- $link3 = 0;
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $logged_user = $_GET['id'];
- echo'<a style="display:block" href="redirect.php?id='.$logged_user.'" style="text-decoration:none; color:black;">';
- echo'<div id="header">';
- echo'<center><h2> PID-market </h2></center>';
- echo'</div>';
- echo'</a>';
- $sql1 = "SELECT credit, link1, link2, link3 FROM critical_design_2015 WHERE id = '$logged_user'";
- $result = $conn->query($sql1);
- while($row = $result->fetch_assoc()) {
- $link1 = $row['link1'];
- $link2 = $row['link2'];
- $link3 = $row['link3'];
- $credit = $row['credit'];
- }
- echo'<div id="bought">';
- echo'<div id="bought-header">';
- echo'<center><h5>Purchase-List - Credits :'.$credit.'</h5></center>';
- echo'</div>';
- echo'<div id="bought-content">';
- echo'<div id="profile1">';
- if ($link1 !=''){
- echo '<image class="bought-image" src="http://graph.facebook.com/'.$link1.'/picture?type=large"><br>';
- echo'<div id="bought-profile-info">';
- echo"<form action='profile.php?id=".$link1."' method='post'>
- <input type ='hidden' name ='boughtid' id='boughtid' value='".$link1."'>
- ".$link1."
- <input type ='submit' class='overlay' name ='submit' rel='overlay' value ='View details'>
- </form>";
- echo'</div>';
- }
- echo'</div>';
- echo'<div id="profile2">';
- if ($link2 !=''){
- echo '<image class="bought-image" src="http://graph.facebook.com/'.$link2.'/picture?type=large"><br>';
- echo'<div id="bought-profile-info">';
- echo"<form action='profile.php?id=".$link2."' method='post'>
- <input type ='hidden' name ='boughtid' id='boughtid' value='".$link2."'>
- ".$link2."
- <input type ='submit' class='overlay' name ='submit' rel='overlay' value ='View details'>
- </form>";
- echo'</div>';
- }
- echo'</div>';
- echo'<div id="profile3">';
- if ($link3 !=''){
- echo '<image class="bought-image" src="http://graph.facebook.com/'.$link3.'/picture?type=large"><br>';
- echo'<div id="bought-profile-info">';
- echo"<form action='profile.php?id=".$link3."' method='post'>
- <input type ='hidden' name ='boughtid' id='boughtid' value='".$link3."'>
- ".$link3."
- <input type ='submit' class='overlay' name ='submit' rel='overlay' value ='View details'>
- </form>";
- echo'</div>';
- }
- echo'</div>';
- echo'</div>';
- echo'</div>';
- echo'<div class="container">';
- echo' <div class="row">';
- $sql = "SELECT id, name, email, gender, picture FROM critical_design_2015";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- echo '<div class="four columns"> ';
- echo '<image src="'.$row["picture"].'"><br>';
- echo '<div class="content">'.
- " - ID: " . $row["id"]. "<br>".
- " - Name: " . $row["name"]. "<br>".
- " - Email: " . $row["email"]. "<br>".
- " - Gender: " . $row["gender"]. "<br>"."<br>".
- " <center><b> Price : 1 Credit </b></center> ".
- "<form action'redirect.ph' method='post'>
- <input type ='hidden' name ='dataid' id='dataid' value='".$row["id"]."'>
- <input type ='submit' name ='submit2' value ='Buy'>
- </form>";
- echo '</div>';
- echo '</div>';
- }
- } else {
- echo "0 results";
- }
- if(isset($_POST['submit2'])) {
- $dataid = $_POST['dataid'];
- if ($link1 =='' && $link1 != $dataid && $link2 != $dataid && $link2 != $dataid ){
- $sql4 = "UPDATE critical_design_2015 SET link1 = $dataid WHERE id = $logged_user";
- $conn->query($sql4) === TRUE;
- switch ($credit){
- case '0':
- echo'You have run out of credits, please add more information to your account to continue shopping.';
- break;
- case '1':
- $sql6 = "UPDATE critical_design_2015 SET credit = 0 WHERE id = $logged_user";
- $conn->query($sql6) === TRUE;
- echo'<script>location.reload(); </script>';
- break;
- case '2':
- $sql555 = "UPDATE critical_design_2015 SET credit = 1 WHERE id = $logged_user";
- $conn->query($sql555) === TRUE;
- echo'<script>location.reload(); </script>';
- break;
- case '3':
- $sql5 = "UPDATE critical_design_2015 SET credit = 2 WHERE id = $logged_user";
- $conn->query($sql5) === TRUE;
- echo'<script>location.reload(); </script>';
- break;
- }
- }
- else if ($link2 =='' && $link1 != $dataid && $link2 != $dataid && $link2 != $dataid ){
- $sql7 = "UPDATE critical_design_2015 SET link2 = $dataid WHERE id = $logged_user";
- $conn->query($sql7) === TRUE;
- switch ($credit){
- case '0':
- echo'you have run out of credits, Contact our staff for business packages!';
- break;
- case '1':
- $sql10 = "UPDATE critical_design_2015 SET credit = 0 WHERE id = $logged_user";
- $conn->query($sql10) === TRUE;
- echo'<script>location.reload(); </script>';
- break;
- case '2':
- $sql9 = "UPDATE critical_design_2015 SET credit = 1 WHERE id = $logged_user";
- $conn->query($sql9) === TRUE;
- echo'<script>location.reload(); </script>';
- break;
- case '3':
- $sql8 = "UPDATE critical_design_2015 SET credit = 2 WHERE id = $logged_user";
- $conn->query($sql8) === TRUE;
- echo'<script>location.reload(); </script>';
- break;
- }
- }
- else if ($link3 =='' && $link1 != $dataid && $link2 != $dataid && $link2 != $dataid ){
- $sql11 = "UPDATE critical_design_2015 SET link3 = $dataid WHERE id = $logged_user";
- $conn->query($sql11) === TRUE;
- switch ($credit){
- case '0':
- echo'you have run out of credits, please add more information to your account to continue shopping.';
- break;
- case '1':
- $sql14 = "UPDATE critical_design_2015 SET credit = 0 WHERE id = $logged_user";
- $conn->query($sql14) === TRUE;
- echo'<script>location.reload(); </script>';
- break;
- case '2':
- $sql13 = "UPDATE critical_design_2015 SET credit = 1 WHERE id = $logged_user";
- $conn->query($sql13) === TRUE;
- echo'<script>location.reload(); </script>';
- break;
- case '3':
- $sql12 = "UPDATE critical_design_2015 SET credit = 2 WHERE id = $logged_user";
- $conn->query($sql12) === TRUE;
- echo'<script>location.reload(); </script>';
- break;
- }
- }
- else{
- 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';
- }
- }
- $conn->close();
- ?>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement