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.226.214.1
<?php
function getyearandmode($aobj_context){
session_start();
$collcode = $_SESSION['collcode'];
$examdate = $aobj_context->mobj_data["examdate"];
$year = $aobj_context->mobj_data["year"];
$examtype = $aobj_context->mobj_data["examtype"];
$examshort = $aobj_context->mobj_data["examshort"];
$query="select *from examdate where fyear='{$year}' and fexamtype='{$examtype}'";
$res = $aobj_context->mobj_db->GetRow($query);
if($res['fyear'] && $res['fexamtype']){
$query=" UPDATE examdate
SET fexamdate='{$examdate}', fexamshort='{$examshort}'
WHERE fyear='{$year}' AND fexamtype='{$examtype}'";
}else{
$query = "INSERT INTO examdate(fexamdate,fyear,fexamtype,fexamshort)VALUE('{$examdate}','{$year}','{$examtype}','{$examshort}')
on duplicate key update fexamdate='{$examdate}',fexamshort ='{$examshort}'";
}
$result = $aobj_context->mobj_db->Execute($query);
if($result){
$arr['msg']="Data Saved";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success");
}
else{
$arr['msg']="Failed to Load";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
}
}
function getToviewDate($aobj_context){
$query="SELECT ifnull(fexamdate,'') as fexamdate, ifnull(fyear,'') as fyear, ifnull(fexamtype,'') as fexamtype,
ifnull(fexamshort,'')as fexamshort FROM examdate";
$result = $aobj_context->mobj_db->GetAll($query);
if($result){
echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success");
}
else{
$arr['msg']="Failed to Load";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
}
}
?>
|