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 : 3.129.211.190
<?php
function loadRange($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$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 loadAppDetailsView($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);
$cnd = "";
if($_SESSION['fusertype'] != 'adm')
$cnd = "and d.fdegree = '{$_SESSION['USERNAME']}'";
// $query1 = "select s.fappno, s.fname, date_format(s.fcreatedate, '%d/%m/%Y') as fappdate, s.fgender, s.ftotfee,
// s.fcategory, s.fhk,ifnull(s.fappstatus,'Pending') as fappstatus,'{$_SESSION['fusertype']}' as usertype,
// ifnull(fenttype,'S') as fenttype
// from entstudadm s
// inner join entoptdeg d on s.fappno = d.fappno
// where s.fappno between '{$afrom}' and '{$ato}'
// and d.fdegree between '{$dfrom}' and '{$dto}'
// and ifnull(FPAYSTATUS,'') = 'success'
// group by s.fappno";
$query1 = "select s.fappno, s.fname, date_format(s.fcreatedate, '%d/%m/%Y') as fappdate, s.fgender, s.ftotfee,s.fcategory, s.fhk,
ifnull(s.fappstatus,'Pending') as fappstatus,'adm' as usertype,
ifnull(c.fenttype,'S') as fenttype,
group_concat(distinct d.fdegree ) as degree
from entstudadm s
inner join entoptdeg d on s.fappno = d.fappno
inner join collstud c on s.fmobileno = c.fmobileno
where s.fappno between '{$afrom}' and '{$ato}'
and d.fdegree between '{$dfrom}' and '{$dto}'
and (ifnull(FPAYSTATUS,'') = 'success' or ifnull(c.fenttype,'S') = 'M')
group by s.fappno,c.fenttype";
$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");
}
}
function loadRcubAppView($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"]);
$db = stripslashes($aobj_context->mobj_data["db"]);
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
if($_SESSION['USERNAME'] == NULL || $_SESSION['USERNAME'] == '')
{
$arr = "Please login";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error");
return;
}
if(strtolower($db) == 'rcub')
{
$status = stripslashes($aobj_context->mobj_data["status"]);
$cnd2 = "";
if($status == 'Pending')
$cnd2 = "and ifnull(fstatus,'') = ''";
else if($status != '')
$cnd2 = "and ifnull(fstatus,'') = '{$status}'";
$query = "select * from entmasuser where fusername = '{$_SESSION['USERNAME']}'";
$res = $aobj_context->mobj_db->GetRow($query);
$fdegree = $res['fdegree'];
if($_SESSION['fusertype'] == 'user')
{
$cnd = "and INSTR ('{$fdegree}', concat(d.fdegree,'*'))";
}else
{
$cnd = "";
}
$query1 = "select s.fappno, s.fname, date_format(s.fcreatedate, '%d/%m/%Y') as fappdate, s.fgender, s.ftotfee,
s.fcategory, s.fhk,ifnull(s.fappstatus,'Pending') as fappstatus,'{$_SESSION['fusertype']}' as usertype,
s.fmobileno,
ifnull(fenttype,'S') as fenttype,d.fdegree,
ifnull(fenttype,'S') as fenttype,
ifnull(fstatus,'') as fstatus,
ifnull(ftotmax,'') as ftotmax,
ifnull(ftotsec,'') as ftotsec,
ifnull(ftotper,'') as ftotper,
ifnull(foptmax,'') as foptmax,
ifnull(foptsec,'') as foptsec,
ifnull(foptper,'') as foptper,
ifnull(fremarks,'') as fremarks,
ifnull(fmerittype,'') as fmerittype
from entstudadm s
inner join entoptdeg d on s.fappno = d.fappno
where s.fappno between '{$afrom}' and '{$ato}'
and d.fdegree between '{$dfrom}' and '{$dto}'
and ifnull(FPAYSTATUS,'') = 'success'
and ifnull(s.ffreez,'') <> 'T'
{$cnd2}
{$cnd}
group by s.fappno
order by d.fdegree";
}else
{
$query1 = "select s.fappno, s.fname, date_format(s.fcreatedate, '%d/%m/%Y') as fappdate, s.fgender, s.ftotfee,
s.fcategory, s.fhk,ifnull(s.fappstatus,'Pending') as fappstatus,'{$_SESSION['fusertype']}' as usertype,
ifnull(fenttype,'S') as fenttype
from entstudadm s
inner join entoptdeg d on s.fappno = d.fappno
where s.fappno between '{$afrom}' and '{$ato}'
and d.fdegree between '{$dfrom}' and '{$dto}'
and ifnull(FPAYSTATUS,'') = 'success'
and d.fdegree = '{$_SESSION['USERNAME']}'
group by s.fappno";
}
$result1 = $aobj_context->mobj_db->GetAll($query1);
if($result1)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result1,0,"success");
}
else
{
$arr = "No Details Found";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error");
}
}
function saveappprevdet($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$fappno = stripslashes($aobj_context->mobj_data["fappno"]);
$degree = stripslashes($aobj_context->mobj_data["degree"]);
$totmax = stripslashes($aobj_context->mobj_data["totmax"]);
$totsec = stripslashes($aobj_context->mobj_data["totsec"]);
$totper = stripslashes($aobj_context->mobj_data["totper"]);
$optmax = stripslashes($aobj_context->mobj_data["optmax"]);
$optsec = stripslashes($aobj_context->mobj_data["optsec"]);
$optper = stripslashes($aobj_context->mobj_data["optper"]);
$status = stripslashes($aobj_context->mobj_data["status"]);
$remarks = stripslashes($aobj_context->mobj_data["remarks"]);
$fmerit = stripslashes($aobj_context->mobj_data["fmerit"]);
if($status == 'Approved')
{
if($totmax == 0 || $totsec == 0 || $optmax == 0 || $optsec == 0)
{
$error_msg = "Marks Cant be zero";
echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"error");
return;
}
}
if($_SESSION['USERNAME'] == NULL || $_SESSION['USERNAME'] == '')
{
$arr = "Please login";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error");
return;
}
$query2 = "update entoptdeg set
fstatus = '{$status}',
ftotmax = '{$totmax}',
ftotsec = '{$totsec}',
ftotper = '{$totper}',
foptmax = '{$optmax}',
foptsec = '{$optsec}',
foptper = '{$optper}',
flogdate = now(),
flogname ='{$_SESSION['USERNAME']}',
fremarks = '{$remarks}',
fmerittype = '{$fmerit}'
where fappno = '{$fappno}'
and fdegree = '{$degree}'";
$rst2 = $aobj_context->mobj_db->Execute($query2);
if($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");
}
}
|