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.191.118.36
<?php
function loadRange($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$db = stripslashes($aobj_context->mobj_data["db"]);
$cond = "";
$all = "";
if($_SESSION['fusertype'] == 'usr') {
$deg_arr = explode( '*', $_SESSION['FDEGREE']);
$degrees = implode("','", $deg_arr);
$cond = "where fdegree in ('{$degrees}')";
} else {
$all = "select 'All' as fdegree, 'All' as fdescpn, '00' as forder
union";
}
if($db == 'bcupg')
$query1 = "{$all} select fdegree, fdescpn, forder from entdeg_pg {$cond} order by forder";
else
$query1 = "{$all} select fdegree, fdescpn, forder from entdeg {$cond} order by forder";
$result1 = $aobj_context->mobj_db->GetAll($query1);
// var_dump($query1);
if(count($result1) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result1,0,"success");
}
else
{
$arr = "Degress Not Identified. Contact Admin";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error");
}
// $query1 = "select * from entdeg";
// $result1 = $aobj_context->mobj_db->GetAll($query1);
// // var_dump($result1);
// if($result1)
// {
// echo $aobj_context->mobj_output->ToJSONEnvelope($result1,0,"success");
// }
// else
// {
// $arr = "Some Failure as occured";
// echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error");
// }
}
function loadAppDetails($aobj_context){
$json = new Services_JSON();
$dfrom = stripslashes($aobj_context->mobj_data["dfrom"]);
$dto = stripslashes($aobj_context->mobj_data["dto"]);
$afrom = stripslashes($aobj_context->mobj_data["afrom"]);
$ato = stripslashes($aobj_context->mobj_data["ato"]);
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$query1 = "SELECT DISTINCT b.fdescpn, a.fappno, a.fname, DATE_FORMAT(a.fcreatedate, '%d/%m/%Y') AS fappdate, a.fgender, a.ftotfee,
fcategory, fhk,fappstatus,fqdegree,fqclass FROM entstudadm a,degree b WHERE a.fqdegree=b.fdegree AND fappno IN ( SELECT DISTINCT fappno FROM entstuddoc) AND fname <> ' ' AND fpaystatus = 'success'
ORDER BY fname";
$result1 = $aobj_context->mobj_db->GetAll($query1);
// var_dump($result1);
if($result1)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result1,0,"success");
}
else
{
$arr = "Some Failure as occured";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error");
}
}
function loadstuddocDetails($aobj_context)
{
$json = new Services_JSON();
$fappno = stripslashes($aobj_context->mobj_data["fappno"]);
// var_dump($fappno);
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$query1 = "select fappno,fdoctype,fpath,fdeleted,ifnull(fstatus, '') as fstatus,ifnull(fremarks, '') as fremarks from entstuddoc where fappno='{$fappno}'";
// var_dump($query1);
$result1 = $aobj_context->mobj_db->GetAll($query1);
// var_dump($result1);
$query2 = "select FAPPNO, ifnull(FAPPRSTATUS, '') as FAPPRSTATUS, ifnull(FAPPRDATE, '') as FAPPRDATE , ifnull(FAPPRUSERID, '') as FAPPRUSERID , ifnull(FAPPREMARKS, '') as FAPPREMARKS from entstudadm where fappno='{$fappno}'";
$result2 = $aobj_context->mobj_db->GetAll($query2);
// var_dump($result1);
if($result1)
{
$res['app'] = $result1;
$res['stuadm'] = $result2;
echo $aobj_context->mobj_output->ToJSONEnvelope($res,0,"success");
}
else
{
$arr = "Some Failure as occured";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error");
}
}
function DocStatusAndRemarks($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$fappno = stripslashes($aobj_context->mobj_data["fappno"]);
$studstatus = stripslashes($aobj_context->mobj_data["studstatus"]);
$textarea = stripslashes($aobj_context->mobj_data["textarea"]);
$statusandremarks = stripslashes($aobj_context->mobj_data["statusandremarks"]);
$obj = json_decode($statusandremarks,true);
$val_str = array();
$i= 0;
foreach($obj as $key=>$value)
{
$val_str[$i] = "('".$value['fappno']."','".$value['fdoctype']."','".$value['fstatus']."','".$value['fremarks']."')";
$i++;
}
$str = implode(",",$val_str);
trim($str, '"');
$query1 = "INSERT INTO `entstuddoc` (`fappno`,`fdoctype`, `fstatus`, `fremarks`)
VALUES
$str
on duplicate key update
fappno = fappno,fdoctype = fdoctype, fstatus = VALUES(fstatus), fremarks = VALUES(fremarks)";
$rst1 = $aobj_context->mobj_db->Execute($query1);
$query2 = "update entstudadm set fapprstatus = '{$studstatus}',fappremarks = '{$textarea}',
FAPPRDATE = now(),
FAPPRUSERID ='{$_SESSION['USERNAME']}'
where fappno = '{$fappno}'";
// var_dump($query2);
$rst2 = $aobj_context->mobj_db->Execute($query2);
// var_dump($_SESSION['USERNAME']);
if($rst1 && $rst2)
{
$success_msg= "Updated Successfully";
echo $aobj_context->mobj_output->ToJSONEnvelope($success_msg,0,"success");
}
else
{
$error_msg = "Some Failure as occured";
echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"error");
}
}
|