


<?php

            error_reporting(E_ALL);
            ini_set('display_errors', 1);
            include('../../../config/config.php');


            $UserID = $_POST['UserID'];
            $UserType = $_POST['UserType'];

           

            $select_institution = mysqli_query($link, "SELECT * FROM `setcountdown` INNER JOIN parent  ON  `setcountdown`.InstitutionID = `parent`.InstitutionID  WHERE `parent`.ParentID='$UserID'");
            $select_institution_cnt = mysqli_num_rows($select_institution);
            $select_institution_cnt_row = mysqli_fetch_assoc($select_institution);

            if ($select_institution_cnt > 0) {

                $start = $select_institution_cnt_row['StartDate'];
                $EndDate = $select_institution_cnt_row['EndDate'];
                $Description = $select_institution_cnt_row['Description'];
                $name = $select_institution_cnt_row['ParentFirstName'].' '.$select_institution_cnt_row['ParentLastName'];

                $proscoundown = array(
                    'startdate' => $start,
                    'enddate' => $EndDate,
                    'description' => $Description,
                    'name' =>$name 


                );

                $json_data = json_encode($proscoundown, JSON_PRETTY_PRINT);

                echo $json_data;
            } else {
                // Return an empty JSON object to ensure consistent format
                echo json_encode(new stdClass());
            }
?>