Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <?php
- session_start();
- if ($_SESSION['user_logged_in'] == ''){
- header('location: login.html');
- }
- ?>
- <html>
- <head>
- <title>.::PkKit::.</title>
- <!-- BootStrap -->
- <!-- Latest compiled and minified CSS -->
- <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
- <!-- jQuery library -->
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
- <!-- Latest compiled JavaScript -->
- <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="style.css" type="text/css" />
- <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'>
- <link rel="stylesheet" href="css/animate.css">
- <link rel="stylesheet" href="css/style.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
- <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
- <script src="//code.jquery.com/jquery-1.10.2.js"></script>
- <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
- <link rel="stylesheet" href="/resources/demos/style.css">
- <script>
- $(function() {
- $( "#dialog" ).dialog();
- });
- </script>
- </head>
- <body>
- <nav class="navbar navbar-inverse">
- <div class="container-fluid">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <a class="navbar-brand" href="#">PKKIT</a>
- </div>
- <div class="collapse navbar-collapse" id="myNavbar">
- <ul class="nav navbar-nav">
- <li class="active"><a href="myphotos.php">My Photos</a></li>
- <li><a href="aboutus.php">About Us</a></li>
- <li><a href="faqs.php">FAQs</a></li>
- <li><a href="support.php">Support</a></li>
- </ul>
- <ul class="nav navbar-nav navbar-right">
- <li><a href="create.php"><span class="glyphicon glyphicon-picture"></span> Create Album</a></li>
- <li><a href="logout.php"><span class="glyphicon glyphicon-log-out"></span> Logout</a></li>
- </ul>
- </div>
- </div>
- </nav>
- <ul>
- <div id="body" class="container-fluid">
- <?php
- // Grab all albums accosiated with the logged in user and display in a table
- $servername = "localhost";
- $username = "PKKIT"; // Set up the SQL server details.
- $password = "jeznicklogan";
- $dbname = "PKKIT";
- $AccountID = $_SESSION['AccountID'];
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $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'");
- //$result = $conn->query($sql);
- echo "<table class='table-condensed'>";
- $count = 0;
- //if ($result->num_rows > 0) {
- // output data of each row
- $crows=mysql_num_rows($sql);
- if ($crows < 1)
- {
- //echo "<B>You have no albums! <p />Create an album to get started!</B>";
- }
- while($row = mysqli_fetch_array($sql,MYSQL_ASSOC)) {
- $AlbumID = $row['album_id'];
- //echo $row['album_id'];
- //echo $AlbumID;
- $Title = $row['album_title'];
- $Description = $row['album_desc'];
- $count ++;
- echo "<td>";
- echo "<a href=viewalbum.php?album_id=";
- echo $AlbumID;
- echo "><img src='no-photo.png' class='img-responsive' alt='$Description' align='center' style='float:top'></a>";
- echo "<div><a href=viewalbum.php?album_id=";
- echo $AlbumID;
- echo "<h3 style='color:white; font-size:100%;'>" . $Title . "</h3>";
- echo "</td>";
- if ($count == 6)
- {
- $count = 0;
- echo "</tr><tr>";
- }
- }
- //
- $sql = mysqli_query($conn, "SELECT * FROM message WHERE to_acc='$AccountID' ORDER BY message_id");
- //$result = $conn->query($sql);
- $count = 0;
- //if ($result->num_rows > 0) {
- // output data of each row
- $crows=mysqli_num_rows($sql);
- if ($crows < 1)
- {
- //echo "<B>You have no albums! <p />Create an album to get started!</B>";
- }else{
- while($row = mysqli_fetch_array($sql,MYSQL_ASSOC)) {
- $FROM = $row['from_acc'];
- $MSG = $row['message'];
- $MSG_ID = $row['message_id'];
- echo "<div id='dialog' title='New Message'>";
- echo "<p>$FROM</p> <p>$MSG</p>";
- echo "</div>";
- }
- $sql = mysqli_query($conn, "DELETE FROM message WHERE message_id=$MSG_ID"); // Remove the message
- }
- mysql_free_result($sql);
- //} else {
- // echo "0 results";
- //}
- echo "</table>";
- $conn->close();
- ?>
- </div>
- </div>
- </html>
Add Comment
Please, Sign In to add comment