wrcspkkit

myphotos.php

May 5th, 2016
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 4.89 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3.  
  4. <?php
  5. session_start();
  6. if ($_SESSION['user_logged_in'] == ''){
  7. header('location: login.html');
  8. }
  9.  
  10. ?>
  11. <html>
  12. <head>
  13. <title>.::PkKit::.</title>
  14.  
  15. <!-- BootStrap -->
  16.  
  17. <!-- Latest compiled and minified CSS -->
  18. <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  19.  
  20. <!-- jQuery library -->
  21. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
  22.  
  23. <!-- Latest compiled JavaScript -->
  24. <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  25.  
  26. <meta name="viewport" content="width=device-width, initial-scale=1">
  27.  
  28.  
  29. <link rel="stylesheet" href="style.css" type="text/css" />
  30. <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700|Lato:400,100,300,700,900' rel='stylesheet' type='text/css'>
  31.  
  32.     <link rel="stylesheet" href="css/animate.css">
  33.    
  34.     <link rel="stylesheet" href="css/style.css">
  35.  
  36.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
  37.    
  38.     <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  39.  
  40.   <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  41.  
  42.   <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  43.  
  44.   <link rel="stylesheet" href="/resources/demos/style.css">
  45.  
  46. <script>
  47.  
  48.   $(function() {
  49.  
  50.     $( "#dialog" ).dialog();
  51.  
  52.   });
  53.  
  54.   </script>
  55.  
  56.  
  57. </head>
  58.  
  59.  
  60.  
  61. <body>
  62.  
  63. <nav class="navbar navbar-inverse">
  64.   <div class="container-fluid">
  65.     <div class="navbar-header">
  66.       <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
  67.         <span class="icon-bar"></span>
  68.         <span class="icon-bar"></span>
  69.         <span class="icon-bar"></span>
  70.       </button>
  71.       <a class="navbar-brand" href="#">PKKIT</a>
  72.     </div>
  73.     <div class="collapse navbar-collapse" id="myNavbar">
  74.       <ul class="nav navbar-nav">
  75.         <li class="active"><a href="myphotos.php">My Photos</a></li>
  76.         <li><a href="aboutus.php">About Us</a></li>
  77.         <li><a href="faqs.php">FAQs</a></li>
  78.         <li><a href="support.php">Support</a></li>
  79.       </ul>
  80.       <ul class="nav navbar-nav navbar-right">
  81.        <li><a href="create.php"><span class="glyphicon glyphicon-picture"></span> Create Album</a></li>
  82.         <li><a href="logout.php"><span class="glyphicon glyphicon-log-out"></span> Logout</a></li>
  83.       </ul>
  84.     </div>
  85.   </div>
  86. </nav>
  87. <ul>
  88.  
  89. <div id="body" class="container-fluid">
  90. <?php
  91. // Grab all albums accosiated with the logged in user and display in a table
  92.  
  93. $servername = "localhost";
  94. $username = "PKKIT";     // Set up the SQL server details.
  95. $password = "jeznicklogan";
  96. $dbname = "PKKIT";
  97. $AccountID = $_SESSION['AccountID'];
  98. // Create connection
  99. $conn = new mysqli($servername, $username, $password, $dbname);
  100. // Check connection
  101. if ($conn->connect_error) {
  102.     die("Connection failed: " . $conn->connect_error);
  103.  }
  104.  
  105. $sql = mysqli_query($conn, "SELECT t1.*, t2.album_desc, t2.album_title FROM album_perm AS t1 INNER JOIN album AS t2 ON t1.album_id=t2.album_id WHERE account_id='$AccountID'");
  106.  
  107. //$result = $conn->query($sql);
  108.  
  109. echo "<table class='table-condensed'>";
  110. $count = 0;
  111. //if ($result->num_rows > 0) {
  112.     // output data of each row
  113.     $crows=mysql_num_rows($sql);
  114.     if ($crows < 1)
  115.     {
  116.         //echo "<B>You have no albums! <p />Create an album to get started!</B>";
  117.     }
  118.     while($row = mysqli_fetch_array($sql,MYSQL_ASSOC)) {
  119.        
  120.         $AlbumID = $row['album_id'];
  121.         //echo $row['album_id'];
  122.         //echo $AlbumID;
  123.         $Title = $row['album_title'];
  124.         $Description = $row['album_desc'];
  125.         $count ++;
  126.        
  127.         echo "<td>";
  128.         echo "<a href=viewalbum.php?album_id=";
  129.         echo $AlbumID;
  130.         echo "><img src='no-photo.png'  class='img-responsive' alt='$Description' align='center' style='float:top'></a>";
  131.         echo "<div><a href=viewalbum.php?album_id=";
  132.         echo $AlbumID;
  133.         echo  "<h3 style='color:white; font-size:100%;'>" . $Title . "</h3>";
  134.         echo "</td>";
  135.         if ($count == 6)
  136.         {
  137.             $count = 0;
  138.             echo "</tr><tr>";
  139.         }
  140.     }
  141.    
  142.     //
  143.     $sql = mysqli_query($conn, "SELECT * FROM message WHERE to_acc='$AccountID' ORDER BY message_id");
  144.  
  145. //$result = $conn->query($sql);
  146. $count = 0;
  147. //if ($result->num_rows > 0) {
  148.     // output data of each row
  149.     $crows=mysqli_num_rows($sql);
  150.     if ($crows < 1)
  151.     {
  152.         //echo "<B>You have no albums! <p />Create an album to get started!</B>";
  153.     }else{
  154.     while($row = mysqli_fetch_array($sql,MYSQL_ASSOC)) {
  155.    
  156.     $FROM = $row['from_acc'];
  157.     $MSG = $row['message'];
  158.     $MSG_ID = $row['message_id'];
  159.    
  160.     echo "<div id='dialog' title='New Message'>";
  161.     echo "<p>$FROM</p> <p>$MSG</p>";
  162.     echo "</div>";
  163.     }
  164.     $sql = mysqli_query($conn, "DELETE FROM message WHERE message_id=$MSG_ID"); // Remove the message
  165.     }
  166.  
  167.  
  168.     mysql_free_result($sql);
  169. //} else {
  170.  //   echo "0 results";
  171. //}
  172. echo "</table>";
  173.  $conn->close();
  174.  ?>
  175.  
  176.     </div>
  177.  
  178. </div>
  179.  
  180.  
  181.  
  182.  
  183. </html>
Add Comment
Please, Sign In to add comment