index.php

back


<!DOCTYPE html>

<html>

<head>

<title>List of members</title>

<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">

<!-- The above line links to the external stylesheet of w3.css -->

</head>

<body>

<div class="w3-container w3-teal w3-wide w3-xlarge">

<h1>List of members</h1>

</div>

<div class="w3-row">

<?php

require_once('classes/selectAllClass.php');

// includes class file to read all the rows of the database

$selectall=new selectAllClass();

// creates an object of the given class

$selectall=$selectall->selectallFunction();

// calls the class function to read all the rows

foreach ($selectall as $row) {

// loops for n times for n number of rows in the database

echo "<div class='w3-col w3-container l10 s8 w3-border-bottom w3-xlarge w3-hover-green w3-padding-8'>";

echo "<a href='edit.php?id=".$row['id']."'>".$row['name']."</a>";

echo'</div>';

echo "<div class='w3-col w3-container w3-center l2 s4 w3-border-left w3-border-bottom w3-xlarge w3-hover-red w3-padding-8'>";

echo "<a href='delete.php?id=".$row['id']."'>delete</a>";

echo'</div>';

}

?>

</div>

<a class="w3-btn-block w3-white w3-wide w3-xlarge w3-hover-amber w3-border-bottom" href="add.html">Add more</a>

</body>

</html>