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.138.134.77
Current Path : /var/www/oasis/src/ |
| Current File : /var/www/oasis/src/view_ledger.php |
<?php
function DisplayViewLedger($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$college = $_SESSION['collcode'];
$collcode = $_SESSION['collcode'];
$degree = $aobj_context->mobj_data["degree"];
$examno = $aobj_context->mobj_data["examno"];
$examination = $aobj_context->mobj_data["examination"];
$db = $aobj_context->mobj_data["db"];
if($degree == 'all'){
$cnd = "";
}else{
$cnd = "AND m.fdegree = '{$degree}' ";
}
if($examno == "all"){
$exmcnd = '';
}else{
$exmcnd = '';
}
if($examination == 'all'){
$examinationcnd = '';
}else{
$examinationcnd = "AND m.fexamdate = '{$examination}'";
}
$query = "SELECT '{$db}' as db, m.fdegree,d.fdescpn, m.fexamno, m.fyear, m.fexamtype,
if(ifnull(dg.fexamdate,'') = '',m.fexamdate,dg.fexamdate) as fexamdate, m.ffilename
FROM masledg m
INNER JOIN degree d ON m.fdegree = d.fdegree
left JOIN degexam dg on m.fdegree = dg.fdegree
AND m.fexamno = dg.fexamno
AND m.fyear = dg.fyear
AND m.fexamtype = dg.fexamtype
WHERE m.fcollcode = '{$collcode}'
{$cnd}
{$exmcnd}
{$examinationcnd}
GROUP BY m.fcreatedate desc,ffilename";
$result = $aobj_context->mobj_db->GetAll($query);
// var_dump($query);
// die();
if($result){
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}else{
$arr['msg'] = 'No data found...!';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
}
}
function loaddegreeviewledg($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$get_category_names="SELECT c.fdegree AS internal_code, d.FDESCPN AS value FROM
degree d INNER JOIN colldeg c ON d.fdegree = c.fdegree
WHERE c.fcollcode = '{$_SESSION['collcode']}' AND c.fdeleted = 'F'
GROUP BY d.fdegree
ORDER BY d.fdegree";
//echo $get_category_names; die();
$lobj_get_category_names = $aobj_context->mobj_db->GetAll($get_category_names);
if($lobj_get_category_names!= 0)
echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_get_category_names,0,"success");
else
echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_get_category_names,-1,"Failure");
return;
}
function getCollegeDet($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$college = $_SESSION['collcode'];
$query = "select distinct m.fdegree, concat(m.fdegree,' - ',d.fdescpn) as fdescpn from masledg m
inner join degree d on m.fdegree = d.fdegree where fcollcode = '{$college}'
group by fdegree";
$result = $aobj_context->mobj_db->GetAll($query);
if($result){
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}else{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,-1,"Failure");
}
}
// function getDegreeDet($aobj_context){
// $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
// $collcode = $aobj_context->mobj_data['collcode'];
// $query = "select c.fdegree,d.fdescpn from candsum c
// inner join degree d on d.fdegree= c.fdegree
// where fcollcode = '{$collcode}'
// group by fdegree";
// $result = $aobj_context->mobj_db->GetAll($query);
// if($result){
// echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
// }else{
// echo $aobj_context->mobj_output->ToJSONEnvelope($result,-1,"Failure");
// }
// }
?>
|