<?php
include("../../../config/config.php");


  $institution = $_POST["institution"];
  $userID = $_POST["userID"];
 
  $parentID = mysqli_real_escape_string($link, $userID);

  $ekene_selectchild = mysqli_query($link, "SELECT * FROM student JOIN parent ON student.ParentID = parent.ParentID WHERE parent.ParentID ='$parentID' ORDER BY student.StudentFirstName ASC");

  $ekene_selectchild_cnt = mysqli_num_rows($ekene_selectchild);
  echo '<option value="NULL">Switch Chlid</option>';
  if ($ekene_selectchild_cnt > 0) {
      while ($row = mysqli_fetch_assoc($ekene_selectchild)) {
          $StudentFirstName = $row['StudentFirstName'];
          $StudentLastName = $row['StudentLastName'];
          $StudentID = $row['StudentID'];
          $CampusID = $row['CampusID'];
          

          echo '<option value="'.$StudentID.'"  data-id="'.$CampusID.'" >'.$StudentFirstName.' '.$StudentLastName.'</option>';
      }
  } else {
    echo '<option value="NULL">No child found</option>';
  }
  ?>