Skip to content

Commit

Permalink
Update index.php
Browse files Browse the repository at this point in the history
  • Loading branch information
milq authored May 17, 2017
1 parent bca669a commit 7f3ff5f
Showing 1 changed file with 31 additions and 34 deletions.
65 changes: 31 additions & 34 deletions learn/crud/xml/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,37 @@

<a href='form.php'>Insert a new student</a><br /><br />

<?php
<table title='student_table'>
<thead>
<tr>
<th>ID</th>
<th>First name</th>
<th>Last name</th>
<th>Nickname</th>
<th>Date of birth</th>
<th>Mark</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<?php
require_once('load_xml.php');

require_once('load_xml.php');

echo "<table title='student_table'>";
echo '<thead>';
echo '<tr>';
echo '<th>ID</th>';
echo '<th>First name</th>';
echo '<th>Last name</th>';
echo '<th>Nickname</th>';
echo '<th>Date of birth</th>';
echo '<th>Mark</th>';
echo '<th>Edit</th>';
echo '<th>Delete</th>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';

foreach($xml->children() as $student) {
echo '<tr>';
echo '<td>' . $student['id'] . '</td>';
echo '<td>' . $student->first_name . '</td>';
echo '<td>' . $student->last_name . '</td>';
echo '<td>' . $student->nickname . '</td>';
echo '<td>' . $student->date_of_birth . '</td>';
echo '<td>' . $student->mark . '</td>';
echo "<td><a title='edit_" . $student['id'] . "' href='form.php?id=" . $student['id'] . "'>Edit</a></td>";
echo "<td><a title='delete_" . $student['id'] . "' href='process.php?delete=yes&id=" . $student['id'] . "'>Delete</a></td>";
echo '</tr>';
}

echo '</tbody>';
echo '</table>';
?>
foreach($xml->children() as $student) {
echo '<tr>';
echo '<td>' . $student['id'] . '</td>';
echo '<td>' . $student->first_name . '</td>';
echo '<td>' . $student->last_name . '</td>';
echo '<td>' . $student->nickname . '</td>';
echo '<td>' . $student->date_of_birth . '</td>';
echo '<td>' . $student->mark . '</td>';
echo "<td><a title='edit_" . $student['id'] . "' href='form.php?id=" . $student['id'] . "'>Edit</a></td>";
echo "<td><a title='delete_" . $student['id'] . "' href='process.php?delete=yes&id=" . $student['id'] . "'>Delete</a></td>";
echo '</tr>';
}
?>
</tbody>
</table>
</body>
</html>

0 comments on commit 7f3ff5f

Please sign in to comment.