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 : 13.59.92.139
<?php
include ("database.php");
$query = "select distinct s.fname, s.ffatname, s.fmotname, s.fdegree, s.fcollcode,
d.fdescpn as degree, d.fexamname, concat(d.fexamdate,' Examination') as fexamdate,
concat(c.fcollname,', ',c.ftown, ' [', c.fcollcode, ']') as college,
s.fphotopath,
if(ifnull(fcaste,'') = '', 'GM',fcaste) as category,
if(ifnull(fconstype,'') = '', 'Normal Fee', fconstype) as feetype,
ifnull(fexamappblk,0) as examblk
from student s
inner join degree d
on s.fdegree = d.fdegree
inner join college c
on s.fcollcode = c.fcollcode
where s.fregno = '{$_SESSION['REGNO']}' limit 1";
$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);
if($count <= 0)
{
$query = "select distinct s.fname, s.ffatname, s.fmotname, s.fdegree, s.fcollcode,
d.fdescpn as degree, d.fexamname, concat(d.fexamdate,' Examination') as fexamdate,
concat(c.fcollname,', ',c.ftown, ' [', c.fcollcode, ']') as college,
s.fphotopath,
if(ifnull(fcaste,'') = '', 'GM',fcaste) as category,
if(ifnull(fconstype,'') = '', 'Normal Fee', fconstype) as feetype,
ifnull(fexamappblk,0) as examblk
from studhist s
inner join degree d
on s.fdegree = d.fdegree
inner join college c
on s.fcollcode = c.fcollcode
where s.fregno = '{$_SESSION['REGNO']}' limit 1";
$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);
}
if($count > 0)
{
$row = mysqli_fetch_assoc($result);
//
$path = "/home/logisys32/public_html/oasis/".$_SESSION['FOLDER'].'/'.$row['fphotopath'];
$photo_url = 'https://university-student-photos.s3.ap-south-1.amazonaws.com/'.$_SESSION['UNIVCODE'].'/'.urlencode($row['fphotopath']);
$curl3 = curl_init();
curl_setopt($curl3, CURLOPT_URL, $photo_url);
curl_setopt($curl3, CURLOPT_NOBODY, true);
$response_photo = curl_exec($curl3);
$httpCode_photo = curl_getinfo($curl3 , CURLINFO_HTTP_CODE);
// var_dump($httpCode_photo);
$row['photo'] = $photo_url;
$row['httpcode'] = $httpCode_photo;
if($httpCode_photo == 200) //!file_exists($actualpath)
{
$row['photopath'] = $photo_url;
}
// $row['photopath'] = 'http://oasis.logisys.org/'.$_SESSION['FOLDER'].'/'.$row['fphotopath'];
$_SESSION['CATEGORY'] = $row['category'];
$_SESSION['FEETYPE'] = $row['feetype'];
$_SESSION['EXAMBLK'] = $row['examblk'];
$_SESSION['DEGREE'] = $row['fdegree'];
$_SESSION['COLLCODE'] = $row['fcollcode'];
$_SESSION['SNAME'] = $row['fname'];
$row['strRegno'] = $_SESSION['REGNO'];
$row['strMobile'] = $_SESSION['MOBILE'];
$row['strEmail'] = $_SESSION['EMAIL'];
$row['strParentMob'] = $_SESSION['PARENTMOB'];
$row['strSemester'] = $row['fexamname'];
$row['strExamdate'] = $row['fexamdate'];
//$row['timetable'] = $timetable;
$get_subs_query = "select distinct cd.fsubcode, su.fsubname,
de.fexamname, cd.fexamno
from canddet cd
inner join subject su
on cd.fdegree = su.fdegree
and cd.fexamno = su.fexamno
and cd.fsubcode = su.fsubcode
inner join degree de
on cd.fdegree = de.fdegree
and cd.fexamno = de.fexamno
where cd.fregno = '{$_SESSION['REGNO']}'
and ifnull(cd.fpassmth,'') = ''
and ifnull(cd.fpresent,'') = 'P'
order by fsubcode";
$sub_result = mysqli_query($conn,$get_subs_query);
$i = 0;
$subject = array();
while($row1 = mysqli_fetch_assoc($sub_result))
{
$subject[$i] = $row1;
$i++;
}
// var_dump($subject);
$row['subject'] = $subject;
$row['status'] = 'success';
//var_dump($row);
mysqli_close($conn);
echo json_encode( $row, JSON_UNESCAPED_UNICODE );;
}
else
{
$data = array("status"=>"failure");
mysqli_close($conn);
echo json_encode($data);
}
|