<?php

require_once './connection.php';

if (!isset($_POST['full_name']) == "" && !isset($_POST['school_id']) == "") {
    $school_id = $_POST['school_id'];
    $full_name = $_POST['full_name'];
    $mobile_no = $_POST['mobile_no'];
    $username = $_POST['username'];
    $password = $_POST['password'];
//    echo '$district_id '.$district_id;
    $result = array();
    date_default_timezone_set('Asia/Kolkata');
//    echo 'date' . date('d-m-Y h:i:s');
    $dt = date('Y-m-d h:i:s');
    
    $query1 = " insert into tbl_school_user (school_id, full_name, mobile_no, username, password,created_date) "
            . " values ('$school_id','$full_name','$mobile_no','$username','$password','$dt') ";
//    echo 'query ' . $query1;
    try {
        if ($con) {
            if (mysqli_query($con, $query1)) {
                echo 'Data insert successfully';
            } else {
                echo 'In User Registration Error Occure.';
            }
        } else {
            echo 'Connection Problem';
        }
    } catch (Exception $ex) {
        echo $e->getMessage();
    }
} else {
    echo 'full name Not Set';
}
?>
