<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST');
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization");
include '../../../config/index.php';
$data = array();

$sql_two = "INSERT INTO teachers VALUES (NULL,
        '" . $_GET["TeacherFirstName"] . "',
        '" . $_GET["TeacherLastName"] . "',
        '" . $_GET["TeacherEmail"] . "',
        'assets/img/fav.png',
        '" . $_GET["PhoneNumber"] . "',
        '" . $_GET["DateOfBirth"] . "',
        '" . $_GET["Gender"] . "',
        'None',
        'No',
        '" . md5($_GET["TeacherPassword"]) . "',
        '" . $_GET["center"] . "',
        '0',
        'false',
        '',
        '',
        '',
        '',
        'false',
        'false',
        NOW())";
if (mysqli_query($conn, $sql_two)) {
    $teacher_id = mysqli_insert_id($conn);
    $new_array = array(
        'Success' => "true",
        'Exists' => "true",
        'teacher_id' => $teacher_id,
    );
    // array_push($data, $new_array);
    echo json_encode($new_array);
} else {
    $new_array = array(
        'Success' => "false",
        'Exists' => "false",
        'teacher_id' => "",
    );
    // array_push($data, $new_array);
    echo json_encode($new_array);
}
// echo json_encode($data);
