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.217.204.60
<?php
function getADMCollege($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
$deggrp = $aobj_context->mobj_data['deggrp'];
$query = "select ifnull(c.FCOLLCODE,'') as fcollcode,CONCAT(c.FCOLLNAME,',',c.FTOWN) as fcollname
from college c
inner join studadm cs on c.fcollcode = cs.fcollcode
where ifnull(cs.fdeleted,'') <> 'T'
group by c.fcollcode";
$result = $aobj_context->pobj_db->GetAll($query);
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 getADMDegree($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
$deggrp = $aobj_context->mobj_data['deggrp'];
$college = $aobj_context->mobj_data['college'];
if($college == 'All'){
$cnd1 = "";
}else{
$cnd1 = "and s.fcollcode='{$college}'";
}
$query="SELECT distinct s.FDEGREE as fdegree, concat(s.fdegree,' - ',d.FDESCPN) as fname
from studadm s
inner join degree d on s.fdegree = d.fdegree and d.fexamno = s.fexamno
where IFNULL(s.FDELETED,'F') <> 'T'
and d.fdeggrp = '{$deggrp}'
$cnd1
order by d.FDEGREE";
// var_dump($query);die();
$result = $aobj_context->pobj_db->GetAll($query);
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 getADMCombination($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
$deggrp = $aobj_context->mobj_data['deggrp'];
$degree = $aobj_context->mobj_data['degree'];
$college = $aobj_context->mobj_data['college'];
$query="SELECT m.FCOMBCODE as internal_code, m.FCOMBDESC as value
from mascomb m
inner join studadm s on m.fcombcode = s.fcombcode
where m.fdegree = '{$degree}'
and s.fcollcode = '{$college}'
group by m.FCOMBCODE";
$result = $aobj_context->pobj_db->GetAll($query);
if($result){
echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success");
}
else{
$query="SELECT 'GEN' as internal_code, 'General' as value";
$result = $aobj_context->pobj_db->GetAll($query);
$arr['msg']="No data Found";
echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success");
}
}
function viewadmapprove($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
$deggrp = $aobj_context->mobj_data['deggrp'];
$degree = $aobj_context->mobj_data['degree'];
$college = $aobj_context->mobj_data['college'];
$comb = $aobj_context->mobj_data['comb'];
$status = $aobj_context->mobj_data['status'];
$list = $aobj_context->mobj_data['list'];
$sem = $aobj_context->mobj_data['sem'];
$remarks = $aobj_context->mobj_data['remarks'];
$searchComb = '';
if($comb != 'All')
{
$searchComb = "and s.fcombcode='{$comb}'";
}else
{
$searchComb = ' and 1=1';
}
$searchAppr = '';
if($status == 'Approval Pending')
{
$searchAppr = "and ifnull(fapprstatus,'') <> 'APPROVED'";
}else if($status == 'Approved')
{
$searchAppr = "and ifnull(fapprstatus,'') = 'APPROVED'";
}else
{
$searchAppr = ' and 1=1';
}
$cnd = "and ifnull(s.fappstatus,'') = 'verified'
and ifnull(s.ffinsub,'') = 'T'";
if($univcode == '050')
$cnd = " ";
$admlist = "select o.fsubcode, group_concat(distinct ifnull(sb.fsubshort,'') SEPARATOR ', ') as fsubshort,
if(fphotopath = '','-',ifnull(s.fphotopath,'')) as fphotopath,
ifnull(s.fappno,'') as fappno,
ifnull(s.fname,'') as fname,
ifnull(s.fgender,'') as fgender,
ifnull(s.fcaste,'') as fcaste,
ifnull(s.fdegree,'') as fdegree,
if('{$univcode}' = '050',fnational,ifnull(s.fnationality,'')) as fnationality,
ifnull(s.fapprstatus,'') as fapprstatus,
ifnull(s.fapprremarks,'') as fapprremarks,
c.FCOLLNAME,group_concat(o.fsubcode) as subject ,'F' as fmodify
from studadm s
inner join college c on c.FCOLLCODE = s.FCOLLCODE
left join options o on s.fappno = o.fappno
left join subject sb on sb.fsubcode = o.fsubcode and sb.fdegree = o.fdegree and sb.fexamno = o.fexamno
where s.FCOLLCODE='{$college}'{$searchDegree} {$searchComb} {$searchAppr}
and s.fdegree = '{$degree}'
and ifnull(s.fdeleted,'') <> 'T'
{$cnd}
and s.fexamno = '{$sem}'
group by s.fappno,s.fdegree,s.fcollcode
order by s.fname,s.fdegree,s.fcombcode,s.fappno";
//var_dump($admlist);
$lobj_admList = $aobj_context->pobj_db->getAll($admlist);
if($lobj_admList){
echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_admList, 0, "success");
}
else{
$arr['msg']="No data Found";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
}
}
function updateadmapprove($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
// $user = $aobj_context->mobj_data['user'];
$req = $aobj_context->req_body;
$data=$req['data'];
$details = $req['details'];
foreach($data as $key => $v){
if($v['fapprstatus'] == 'APPROVED'){
$user = $aobj_context->mobj_data['user'];
$upddate = "now()";
}else{
$user = "";
$upddate = "";
}
if($v['fmodify'] == 'T'){
$query ="update studadm set FAPPRSTATUS = '{$v['fapprstatus']}', fappstatus = 'verified',
FAPPRDATE ={$upddate},FAPPRUSERNAME = '{$user}', fadmrnd = '{$details['list']}',
FAPPRREMARKS = '{$v['fapprremarks']}',FREMARKS = '{$details['remarks']}'
where fappno = '{$v['fappno']}'";
$result = $aobj_context->pobj_db->Execute($query);
}
}
if($result){
$arr['msg']="updated successfully.";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success");
}
else{
$arr['msg']="Failed to Update";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
}
}
function getADMCombinationreport($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
$deggrp = $aobj_context->mobj_data['deggrp'];
$degree = $aobj_context->mobj_data['degree'];
$college = $aobj_context->mobj_data['college'];
if($degree == "All" && $college != "All"){
$cnd = "where s.fcollcode = '{$college}'";
}else if($degree != "All" && $college == "All"){
$cnd = "where m.fdegree = '{$degree}'";
}else if($degree != "All" && $college != "All"){
$cnd = "where s.fcollcode = '{$college}' and m.fdegree = '{$degree}'";
}else{
$cnd = "";
}
$query="SELECT m.FCOMBCODE as internal_code, m.FCOMBDESC as value from mascomb m
inner join studadm s on m.fcombcode = s.fcombcode
$cnd
group by m.FCOMBCODE";
// var_dump($query);
// die();
$result = $aobj_context->pobj_db->GetAll($query);
if($result){
echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success");
}
else{
$query="SELECT 'Gen' as internal_code, 'General' as value";
$result = $aobj_context->pobj_db->GetAll($query);
echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success");
}
}
?>
|