Mudanças entre as edições de "Diversas"
De WEB SISMEDICOS
(Criou página com 'criando pagina consultas iversas') |
|||
Linha 1: | Linha 1: | ||
− | + | <!DOCTYPE html> | |
+ | <html lang="en"> | ||
+ | <head> | ||
+ | <meta charset="utf-8"> | ||
+ | <link href="bootstrap.min.css" rel="stylesheet"> | ||
+ | <script src="bootstrap.min.js"></script> | ||
+ | </head> | ||
+ | |||
+ | <body> | ||
+ | <div class="container"> | ||
+ | <div class="row"> | ||
+ | <h3>PHP CRUD Grid</h3> | ||
+ | </div> | ||
+ | <div class="row"> | ||
+ | <p> | ||
+ | <a href="create.php" class="btn btn-success">Create</a> | ||
+ | </p> | ||
+ | <table class="table table-striped table-bordered"> | ||
+ | <thead> | ||
+ | <tr> | ||
+ | <th>Name</th> | ||
+ | <th>Email Address</th> | ||
+ | <th>Mobile Number</th> | ||
+ | <th>Action</th> | ||
+ | </tr> | ||
+ | </thead> | ||
+ | <tbody> | ||
+ | <?php | ||
+ | include 'database.php'; | ||
+ | $pdo = Database::connect(); | ||
+ | $sql = 'SELECT * FROM customers ORDER BY id DESC'; | ||
+ | foreach ($pdo->query($sql) as $row) { | ||
+ | echo '<tr>'; | ||
+ | echo '<td>'. $row['name'] . '</td>'; | ||
+ | echo '<td>'. $row['email'] . '</td>'; | ||
+ | echo '<td>'. $row['mobile'] . '</td>';echo '<td width=250>'; | ||
+ | echo '<a class="btn btn-info" href="read.php?id='.$row['id'].'">Read</a>'; | ||
+ | echo ' '; | ||
+ | echo '<a class="btn btn-success" href="update.php?id='.$row['id'].'">Update</a>'; | ||
+ | echo ' '; | ||
+ | echo '<a class="btn btn-danger" href="delete.php?id='.$row['id'].'">Delete</a>'; | ||
+ | echo '</td>';echo '</tr>'; | ||
+ | } | ||
+ | Database::disconnect(); | ||
+ | ?> | ||
+ | </tbody> | ||
+ | </table> | ||
+ | </div> | ||
+ | </div> <!-- /container --> | ||
+ | </body> | ||
+ | </html> |
Edição das 19h30min de 3 de janeiro de 2018
<!DOCTYPE html> <html lang="en"> <head>
<meta charset="utf-8"> <link href="bootstrap.min.css" rel="stylesheet"> <script src="bootstrap.min.js"></script>
</head>
<body>
PHP CRUD Grid
<a href="create.php" class="btn btn-success">Create</a>
Name | Email Address | Mobile Number | Action |
---|---|---|---|
'. $row['name'] . ' | '; echo ''. $row['email'] . ' | '; echo ''. $row['mobile'] . ' | ';echo '';
echo '<a class="btn btn-info" href="read.php?id='.$row['id'].'">Read</a>'; echo ' '; echo '<a class="btn btn-success" href="update.php?id='.$row['id'].'">Update</a>'; echo ' '; echo '<a class="btn btn-danger" href="delete.php?id='.$row['id'].'">Delete</a>';echo ' | ';echo '
</body>
</html>