Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php include_once('base.php'); ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Attendance Sheet</title>
- <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css">
- <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap-theme.min.css">
- </head>
- <body>
- <div class="jumbotron invert">
- <div class="container">
- <h1> Attendance Sheet </h1>
- </div>
- </div>
- <div class="container">
- <table class="table table-bordered">
- <tr>
- <th>ID Number</th>
- <th>First Name</th>
- <th>Middle Name</th>
- <th>Last Name</th>
- <th>Contact Number</th>
- <th>Course</th>
- <th>Year</th>
- </tr>
- <?php
- $stmt = $db->query("SELECT * FROM attendance_sheet");
- $stmt->execute();
- for ($x=1;$x<=100;$x++){
- echo $x.$student['ID Number'];
- foreach ($stmt as $student) {
- ?>
- <tr>
- <td><?=$student['ID Number']?></td>
- <td><?=$student['First Name']?></td>
- <td><?=$student['Middle Name']?></td>
- <td><?=$student['Last Name']?></td>
- <td><?=$student['Contact Number']?></td>
- <td><?=$student['Course']?></td>
- <td><?=$student['Year']?></td>
- </tr>
- <?php
- }
- }
- ?>
- </table>
- </div>
- <script src="bootstrap/js/jquery-3.1.1.js"></script>
- <script src="bootstrap/js/bootstrap.min.js"></script>
- </body>
- </html>
- <?php
- $host = "localhost";
- $user = "root";
- $pass = "";
- $db_name = "assign_attndncesht";
- try{
- $db = new PDO("mysql:host={$host};dbname={$db_name}",$user,$pass);
- $db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
- echo "You are connected to database".$db_name;
- }
- catch(PDOException $e)
- {
- echo $e->getMessage();
- }
- ?>
- <?php
- echo '<td>' . $x.$student['ID Number'];
- ?>
Add Comment
Please, Sign In to add comment