<html>
<head>
    <meta charset="utf-8"/>
    <title>PRAYATNA - Admin - List Coord</title>
	<link rel="stylesheet" href="admin_table.css">
	<link href="https://fonts.googleapis.com/css2?family=Asap+Condensed&display=swap" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@500&display=swap" rel="stylesheet"><link href="https://fonts.googleapis.com/css2?family=Arizonia&display=swap" rel="stylesheet">
</head>
<body>
<h1 class="login-title">List of Coords</h1>
<?php
    require('db.php');
    session_start();
    // When form submitted, check and create user session.
        // Check user is exist in the database
        $query    = "SELECT * FROM `coord`";
        $result = mysqli_query($con, $query) or die(mysql_error());
        $rows = mysqli_num_rows($result);
        if ($rows > 0) {
            echo "<table border='1'><tr><th>COORDINATOR NAME</th><th>MOBILE NUMBER</th></tr>";
			while($record = mysqli_fetch_array($result))
			{
			echo "<tr><td><center>" . $record['cname'] . "</center></td><td><center>" . $record['mobile'] . "</center></td></tr>";
			}
			echo "</table>";
        } else {
            echo "<div class='form'>
                  <h3>No coordinators are added</h3><br/>
                  </div>";
        }
         
?><p></p>
<a href="admin_add_coord.php"> <input type = "button" value = "ADD COORD" class="add_button"></a><p></p>
<a href="admin_dashboard.php"> <input type = "button" value = "ADMIN DASHBOARD" class="add_button"></a>
		
</body>
</html>