<html>
<head>
    <meta charset="utf-8"/>
    <title>PRAYATNA - Admin - Delete Coord DB</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>
<?php
    require('db.php');
    session_start();
    // When form submitted, check and create user session.
        // Check user is exist in the database
		//$selectedRow=$_POST['selectdelete'];
		//$query    = "DELETE FROM coord WHERE cid='$selectedRow'";
if(isset($_POST['submitdelete'])){
//echo implode(", ",$selectdelete);
//echo $selectdelete[0];
  if(isset($_POST['selectdelete'])){
	  //echo $selectdelete[0];
    foreach($_POST['selectdelete'] as $deleteid){
      //echo "id ".$deleteid." ";
      $deleteUser = "DELETE from coord WHERE cid='$deleteid'";
      $result=mysqli_query($con,$deleteUser) or die(mysql_error());
    }
				header("Location: admin_dashboard.php");
  }
 }
 echo "<div class='admin_login_form'>
                  <h3>No Coordinator is selected</h3><br/>
                  </div>";
        //$result = mysqli_query($con, $query) or die(mysql_error());
?>
<p></p>
<a href="admin_dashboard.php"> <input type = "button" value = "ADMIN DASHBOARD" class="add_button"></a>
</body>
</html>