| Newsgroups |
php.notes |
| Message-ID |
<[email protected]> |
<div class="container col-md-12 mt-4">
<h1>Students</h1>
<table class="table table-striped">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Email</th>
<th scope="col">Phone</th>
<th scope="col">Class</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
<?php foreach($students as $student):?>
<tr>
<td><?= $student['id']; ?></td>
<td><?= $student['first_name']; ?></td>
<td><?= $student['last_name']; ?></td>
<td><?= $student['email']; ?></td>
<td><?= $student['phone']; ?></td>
<td><?= $student['class']; ?></td>
<td>
<form action="" method="post" style="display:inline">
<button class="btn btn-danger" name="delete_student" value="<?= $student['id']; ?>">Delete</button>
</form>
</td>
<td>
<button type="button" class="btn btn-warning" data-bs-toggle="modal" data-bs-target="#updateModal<?= $student['id']; ?>">
Update
</button>
<div class="modal fade" id="updateModal<?= $student['id']; ?>" tabindex="-1" aria-labelledby="updateModalLabel<?= $student['id']; ?>" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form action="" method="post">
<div class="modal-header">
<h5 class="modal-title" id="updateModalLabel<?= $student['id']; ?>">Update Student</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<input type="hidden" name="student_id" value="<?= $student['id']; ?>">
<div class="mb-3">
<label>Firstname</label>
<input type="text" name="first_name" class="form-control" value="<?= htmlspecialchars($student['first_name']); ?>">
</div>
<div class="mb-3">
<label>Lastname</label>
<input type="text" name="last_name" class="form-control" value="<?= htmlspecialchars($student['last_name']); ?>">
</div>
<div class="mb-3">
<label>Email</label>
<input type="email" name="email" class="form-control" value="<?= htmlspecialchars($student['email']); ?>">
</div>
<div class="mb-3">
<label>Phone</label>
<input type="number" name="phone" class="form-control" value="<?= htmlspecialchars($student['phone']); ?>">
</div>
<div class="mb-3">
<label>Class</label>
<input type="text" name="class" class="form-control" value="<?= htmlspecialchars($student['class']); ?>">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 193.170.70.27)
----
Manual Page -- https://php.net/manual/en/mysql-xdevapi-crudoperationlimitable.limit.php
Edit -- https://main.php.net/note/edit/130345
Del: integrated -- https://main.php.net/note/delete/130345/integrated
Del: useless -- https://main.php.net/note/delete/130345/useless
Del: bad code -- https://main.php.net/note/delete/130345/bad+code
Del: spam -- https://main.php.net/note/delete/130345/spam
Del: non-english -- https://main.php.net/note/delete/130345/non-english
Del: in docs -- https://main.php.net/note/delete/130345/in+docs
Del: other reasons-- https://main.php.net/note/delete/130345
Reject -- https://main.php.net/note/reject/130345
Search -- https://main.php.net/manage/user-notes.php