<?php
	include('db_Temperature.php');
// Check connection
if ($con->connect_error) {
    die("Connection failed: " . $con->connect_error);
}

$StudentId=$_GET["StudentId"];
$StudentName=$_GET["StudentName"];
$Department=$_GET["Department"];
$Course=$_GET["Course"];
$Year=$_GET["Year"];
$AmbientTemperature=$_GET["AmbientTemperature"];
$ObjectTemperature=$_GET["ObjectTemperature"];
							
	
$sql = "INSERT INTO `studentinfo` (`StudentID`, `StudentName`, `Department`, `Course`, `Year`, `AmbientTemperature`, `ObjectTemperature`, `Date`, `IsDelete`)
VALUES ('$StudentId', '$StudentName', '$Department', '$Course', '$Year', '$AmbientTemperature', '$ObjectTemperature', CURRENT_TIMESTAMP, b'1')";
if ($con->query($sql) === TRUE) {
	$response=array('status' => "true", 'Message' => "Inserted Successfully");  
            echo json_encode($response);
	} 
	else 
	{
     $response=array('status' => "false", 'Message' => "Insert Failed");
            echo json_encode($response);
	}
$con->close();
?> 
