<?php

require_once './connection.php';

if (!isset($_POST['user_id']) == "" && !isset($_POST['freez_tempreture']) == "") {
    $user_id = $_POST['user_id'];
    $freez_tempreture = $_POST['freez_tempreture'];
    $freez_humidity = $_POST['freez_humidity'];
    $comment = $_POST['comment'];
//    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_freez_status (user_id, freez_temperature, freez_humidity, comment,created_date) "
            . " values ('$user_id','$freez_tempreture','$freez_humidity','$comment','$dt') ";
//    echo 'query ' . $query1;
    try {
        if ($con) {
            if (mysqli_query($con, $query1)) {
                echo 'Freezer 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';
}
?>
