Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 18.219.23.150
Current Path : /var/www/html/kus/ |
| Current File : /var/www/html/kus/getAppDetAPI.php |
<?php
$servername = "14.139.133.3"; // Host Adress
$username = "kuvempsevauccf";
$password = "3Ea8nZPT6qDDANEV";
$dbname = 'kuvempuShim_ss_student';
$conn= new mysqli($servername,$username,$password,$dbname);
$data_json = file_get_contents("php://input");
$data = json_decode($data_json,true);
if(!isset($data['regno']))
{
$statusCode = 0;
$statusMessage = "Register Number can not be empty. Please try again";
$jsonLoginArray = array("statusCode" => $statusCode, "statusMessage" => $statusMessage);
$returnString = json_encode($jsonLoginArray);
print $returnString;
exit;
}
$regno = stripslashes($data['regno']);
$studQuery = "SELECT fcollcode, fcollname ,fdegree, fdegname,fregno,fname
FROM student
where fregno = '{$regno}'";
$studResult = $conn->query($studQuery);
if(mysqli_num_rows($studResult) != 1)
{
$statusCode = -1;
$statusMessage = "Invalid Register No.";
$jsonLoginArray = array("statusCode" => $statusCode, "statusMessage" => $statusMessage);
$returnString = json_encode($jsonLoginArray);
print $returnString;
exit;
}
else
{
$row1 = mysqli_fetch_array($studResult,MYSQLI_ASSOC);
$statusCode = 1;
$returnArray = array(
"regno" => $row1['fregno'],
"collcode" => $row1['fcollcode'],
"college_name" => $row1['fcollname'],
"degcode" => $row1['fdegree'],
"degree_name" => $row1['fdegname'],
"name" => $row1['fname']
);
$jsonLoginArray = array("statusCode" => $statusCode, "statusMessage" => "Success", "appDet" => $returnArray);
$returnString = json_encode($jsonLoginArray);
print $returnString;
}
?>
|