Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- //echo getcwd();
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "musicclub";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>Music Club - Admin</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- </head>
- <body>
- <div class="jumbotron text-center">
- <h1>♫ Music Club ♫</h1>
- <p>Administration Panel</p>
- </div>
- <div class="container">
- <div class="row">
- <div class="col-sm-4">
- <h3>Upload Songs</h3>
- <form action="upload.php" method="post" enctype="multipart/form-data">
- Select image to upload:
- <br/>
- <input name="songname" type="text" placeholder="Enter Song Name"></input>
- <input name="songimg" placeholder="Enter Image URL" type="text"></input>
- <input type="file" name="fileToUpload" id="fileToUpload">
- <input type="submit" value="Upload Song" name="submit">
- </form>
- </div>
- <div class="col-sm-4">
- <h3>Manage Songs</h3>
- <table border=1 style="border:2px solid black;padding:2px">
- <?php
- $sql = "SELECT * from music";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- // output data of each row
- echo "<tr><td>Name</td><td>Action</td></tr>";
- while($row = $result->fetch_assoc()) {
- echo "<tr><td>" . $row['name'] . "</td><td><a href='delete.php?id=" . $row['id'] . ">Delete</a></td></tr>";
- }
- } else {
- echo "0 results";
- }
- ?>
- </table>
- </div>
- <div class="col-sm-4">
- <h3>Manage Users</h3>
- <table border=1 style="border:2px solid black;padding:2px">
- <?php
- $sql = "SELECT * from users";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- // output data of each row
- echo "<tr><td>Name</td><td>Action</td></tr>";
- while($row = $result->fetch_assoc()) {
- echo "<tr><td>" . $row['name'] . "</td><td><a href='delete.php?id=" . $row['id'] . ">Delete</a></td></tr>";
- }
- } else {
- echo "0 results";
- }
- $conn->close();
- ?>
- </table>
- </div>
- </div>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment