Dynamic007

Untitled

Apr 9th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.48 KB | None | 0 0
  1. <?php
  2. session_start();
  3. //echo getcwd();
  4. $servername = "localhost";
  5. $username = "root";
  6. $password = "";
  7. $dbname = "musicclub";
  8.  
  9. // Create connection
  10. $conn = new mysqli($servername, $username, $password, $dbname);
  11. ?>
  12. <!DOCTYPE html>
  13. <html lang="en">
  14. <head>
  15.   <title>Music Club - Admin</title>
  16.   <meta charset="utf-8">
  17.   <meta name="viewport" content="width=device-width, initial-scale=1">
  18.   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  19.   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
  20.   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  21. </head>
  22. <body>
  23.  
  24. <div class="jumbotron text-center">
  25.   <h1>♫ Music Club ♫</h1>
  26.   <p>Administration Panel</p>
  27. </div>
  28.  
  29. <div class="container">
  30.   <div class="row">
  31.     <div class="col-sm-4">
  32.       <h3>Upload Songs</h3>
  33.         <form action="upload.php" method="post" enctype="multipart/form-data">
  34.             Select image to upload:
  35.             <br/>
  36.             <input name="songname" type="text" placeholder="Enter Song Name"></input>
  37.             <input name="songimg" placeholder="Enter Image URL" type="text"></input>
  38.             <input type="file" name="fileToUpload" id="fileToUpload">
  39.             <input type="submit" value="Upload Song" name="submit">
  40.         </form>
  41.     </div>
  42.     <div class="col-sm-4">
  43.       <h3>Manage Songs</h3>
  44.      
  45.       <table border=1 style="border:2px solid black;padding:2px">
  46.       <?php
  47.      
  48.         $sql = "SELECT * from music";
  49.         $result = $conn->query($sql);
  50.  
  51.         if ($result->num_rows > 0) {
  52.             // output data of each row
  53.             echo "<tr><td>Name</td><td>Action</td></tr>";
  54.             while($row = $result->fetch_assoc()) {
  55.                 echo "<tr><td>" . $row['name'] . "</td><td><a href='delete.php?id=" . $row['id'] . ">Delete</a></td></tr>";
  56.             }
  57.         } else {
  58.             echo "0 results";
  59.         }
  60.      
  61.       ?>
  62.       </table>
  63.      
  64.     </div>
  65.     <div class="col-sm-4">
  66.       <h3>Manage Users</h3>        
  67.      
  68.       <table border=1 style="border:2px solid black;padding:2px">
  69.       <?php
  70.      
  71.         $sql = "SELECT * from users";
  72.         $result = $conn->query($sql);
  73.  
  74.         if ($result->num_rows > 0) {
  75.             // output data of each row
  76.             echo "<tr><td>Name</td><td>Action</td></tr>";
  77.             while($row = $result->fetch_assoc()) {
  78.                 echo "<tr><td>" . $row['name'] . "</td><td><a href='delete.php?id=" . $row['id'] . ">Delete</a></td></tr>";
  79.             }
  80.         } else {
  81.             echo "0 results";
  82.         }
  83.         $conn->close();
  84.      
  85.       ?>
  86.       </table>
  87.      
  88.     </div>
  89.   </div>
  90. </div>
  91.  
  92. </body>
  93. </html>
Add Comment
Please, Sign In to add comment