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.137.174.253
<?php
function getstudfee($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$hdegree = stripslashes($aobj_context->mobj_data["hdegree"]);
$seattype = stripslashes($aobj_context->mobj_data["seattype"]);
$studfrom = stripslashes($aobj_context->mobj_data["studfrom"]);
$catcode = stripslashes($aobj_context->mobj_data["catcode"]);
$funiv = stripslashes($aobj_context->mobj_data["funiv"]);
$college = stripslashes($aobj_context->mobj_data["college"]);
$qury = "select ftype from entcoll where fcollcode = '{$college}'";
$res = $aobj_context->mobj_db->GetRow($qury);
$ftype = $res['ftype'];
$query1 = "select if('{$seattype}' = 'Merit Quota', ffee,fmaxfee) as fee,'T' as feeedit
from admfeestr where fdegree = '{$hdegree}'
and fcombcode = 'PGET'
and FSEATTYPE = '{$ftype}'
and fcatcode = '{$catcode}' and fconstype = '{$studfrom}'";
$result1 = $aobj_context->mobj_db->GetRow($query1);
//var_dump($query1);
if($result1)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result1,0,"success");
}
else
{
$arr = "Fee Not Defined. Contact Admin";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error");
}
}
function loadDudStuddet($aobj_context){
$json = new Services_JSON();
$regno = stripslashes($aobj_context->mobj_data["regno"]);
$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, s.fcategory,
// funiv
// from entstudadm s
// where ifnull(FPAYSTATUS,'') = 'success'
// and s.fregno = '{$regno}'";
$query1 = "select distinct s.fappno, s.fname, s.fcategory, s.funiv, s.fregno
from entstudadm s
where ifnull(FPAYSTATUS,'') = 'success'
and (s.fregno = '{$regno}' or s.fappno = '{$regno}')";
$result1 = $aobj_context->mobj_db->GetRow($query1);
// var_dump($result1);
if($result1)
{
$degcode = $result1['fdegree'];
$fappno = $result1['fappno'];
$query = "select * from entseatallot where fappno = '{$fappno}' and ifnull(fpaymentstatus,'') = 'success'";
$result3 = $aobj_context->mobj_db->GetRow($query);
if($result3)
{
$arr = "For This Candidated Alredy Seat Alloted. Degree: ".$result3['fdegree'];
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error");
return;
}
$query2 = "select cd.fcollcode, c.fcollname from entcolldeg cd
inner join entcoll c on cd.fcollcode = c.fcollcode
inner join entoptions o on c.fcollcode = o.fcollcode and
o.fdegree = cd.fdegree
where o.fappno = '{$fappno}'
order by c.fcollname";
$result2 = $aobj_context->mobj_db->GetAll($query2);
//var_dump($query2);
$query3 = "select d.fdegree,concat(d.fdegree,' - ',fdescpn) as degname
from entdeg d
inner join entoptions o on o.fdegree = d.fdegree
where o.fappno = '{$fappno}'
group by o.fdegree
order by d.fdegree ";
$result3 = $aobj_context->mobj_db->GetAll($query3);
//var_dump($query3);
$arr['studdet'] = $result1;
$arr['colldet'] = $result2;
$arr['degcode'] = $result3;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
else
{
$arr = "Invalid Register No.";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error");
}
}
function SaveDudSeatAllot($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$hdegree = stripslashes($aobj_context->mobj_data["hdegree"]);
$seattype = stripslashes($aobj_context->mobj_data["seattype"]);
$studfrom = stripslashes($aobj_context->mobj_data["studfrom"]);
$catcode = stripslashes($aobj_context->mobj_data["catcode"]);
$regno = stripslashes($aobj_context->mobj_data["regno"]);
$appno = stripslashes($aobj_context->mobj_data["appno"]);
$amount = stripslashes($aobj_context->mobj_data["amount"]);
$pamount = stripslashes($aobj_context->mobj_data["pamount"]);
$college = stripslashes($aobj_context->mobj_data["college"]);
$paytype = stripslashes($aobj_context->mobj_data["paytype"]);
// if($pamount == 0 || $pamount == '')
// {
// $error_msg = "Amount 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;
}
$user = $_SESSION['USERNAME'];
$query = "select * from entseatallot where fappno = '{$appno}'";
$result3 = $aobj_context->mobj_db->GetRow($query);
$query = "select fintake as fruintake from entcolldeg where fcollcode = '{$college}' and fdegree = '{$hdegree}' ";
$res = $aobj_context->mobj_db->GetRow($query);
$fruintake = $res['fruintake'];
$query = "select count(*) as cnt from entseatallot where fcollcode = '{$college}'
and fdegree = '{$hdegree}' and fquota = 'Merit Quota'";
$res1 = $aobj_context->mobj_db->GetRow($query);
$cnt = $res1['cnt'];
if($fruintake > $cnt )
{
}else
{
$arr = "Intake exceed";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error");
return;
}
if($result3)
{
$query = "update entseatallot set fpaytype = '{$paytype}', fusr = '{$user}', fentupddate = now(),
fstudfrom = '{$studfrom}', fcatcode = '{$catcode}', fquota = '{$seattype}',fpamount = '{$pamount}',
fcollcode = '{$college}', fdegree = '{$hdegree}'
where fappno = '{$appno}' and fregno = '{$regno}'";
$rst2 = $aobj_context->mobj_db->Execute($query);
}else
{
$query2 = "INSERT INTO entseatallot (fappno, fdegree, fcollcode, famount,fpamount, fquota, fcatcode,fstudfrom,fregno,fpaytype, fusr, fentdate)
VALUES
('{$appno}', '{$hdegree}', '{$college}', '{$amount}','{$pamount}','{$seattype}','{$catcode}','{$studfrom}','{$regno}','{$paytype}','{$user}', now())";
$rst2 = $aobj_context->mobj_db->Execute($query2);
}
if($rst2)
{
$data['msg']= "Updated Successfully";
$data['appno']= $appno;
$data['regno']= $regno;
$data['paytype']= $paytype;
echo $aobj_context->mobj_output->ToJSONEnvelope($data,0,"success");
}
else
{
$error_msg = "Some Failure as occured";
echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"error");
}
}
|