<?php

/**
 * Created by PhpStorm.
 * User: Buddhi
 * Date: 1/18/2016
 * Time: 5:18 PM
 */
include_once '../php/controller/SchoolController.php';
$schoolController = new \Controllers\SchoolController();
if (isset($_GET['data'])) {
    $data = $_GET['data'];
    $school_id = $_GET['id'];
    $resultset = $schoolController->getSchoolById($school_id);
    $school = mysqli_fetch_assoc($resultset);
    $new_row = '<tr>
<td name="school_id">' . $school['school_id'] . '</td>
<td name="schoolname">' . $school['name'] . '</td>
<td name="schoolcategory">' . $school['category'] . '</td>
<td><input type="text" name="distance" onkeyup="validate_for_numbers(this, this.value)"> km</td>
</tr>';
    $td = explode('</table>', $data);
    echo $td[0] . $new_row . "</table>";
}
/**
 * Created by PhpStorm.
 * User: Buddhi
 * Date: 1/21/2016
 * Time: 12:36 AM
 */
include_once "../php/Connection.php";
include_once '../php/controller/schoolController.php';
include '../php/controller/ChildController.php';
include '../php/controller/ResidentController.php';
include '../php/controller/MarkController.php';
$schoolController = new \Controllers\SchoolController();
if (isset($_GET['school_id'])) {
    if ($_GET['school_id'] != "") {
        $sd = $schoolController->getSchoolById($_GET['school_id']);
        $schooldetails = mysqli_fetch_assoc($sd);
        echo '<div class="form-group">
                                        <label class="col-sm-3" style="text-align: right">Address</label>

                                        <div class="col-sm-9">
                                            <label>' . $schooldetails['address'] . '</label>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3" style="text-align: right">Divisional Secretary
                                            Area</label>

                                        <div class=" col-sm-9">
                                            <label>' . $schooldetails['divisional_sec_area'] . '</label>
                                        </div>