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.17.175.191
<?php
function getDegreesubtype($aobj_context){
session_start();
$collcode=$_SESSION['collcode'];
$query="select DISTINCT d.fdegree,d.fdescpn,d.fexamno,d.fadmdeg from degree d inner join colldeg c
on d.fdegree=c.fdegree
where fexamno='A' order by FDEGREE";
$result=$aobj_context->mobj_db->GetAll($query);
// var_dump($result);die();
if($result){
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else{
$data['msg'] = 'Failed to load Degree';
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
}
}
function Addsubjtype($aobj_context){
$degree = $aobj_context->mobj_data["degree"];
$type = $aobj_context->mobj_data["type"];
$designation = $aobj_context->mobj_data["designation"];
$subcount = $aobj_context->mobj_data["subcount"];
$order = $aobj_context->mobj_data["order"];
// var_dump($degree,$type,$designation,$subcount,$order,"djskdjbas̄");
// die();
// if($degree=='All'){
// $degreed="fdegree BETWEEN '0' AND 'Z'";
// }else{
// $degreed="fdegree='{$degree}'";
// }
$query="INSERT INTO subtype (fdegree, fsubtype, fdescpn, ftotsub, ftorder)
VALUES ('{$degree}', '{$type}', '{$designation}', '{$subcount}', '{$order}')
ON DUPLICATE KEY UPDATE
fdescpn = '{$designation}',
ftotsub = '{$subcount}',
ftorder ='{$order}'";
// var_dump($query);
// die();
$results=$aobj_context->mobj_db->Execute($query);
if($results)
echo $aobj_context->mobj_output->ToJSONEnvelope($results, 0,"success");
else
$arr['msg'] = "Could Not Add/Update";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
function ViewSubjTypeDet($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$collcode=$_SESSION['collcode'];
$degree = $aobj_context->mobj_data["degree"];
if($degree=='All'){
$degreed="";
}else{
$degreed="where s.fdegree='{$degree}'";
}
$qry="select s.fdegree,d.fdescpn,s.fsubtype,s.fdescpn as discpn,s.ftotsub,
s.ftorder from subtype s inner join degree d on d.fdegree = s.fdegree $degreed
group by s.fdegree;";
$result = $aobj_context->mobj_db->GetAll($qry);
if($result) {
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
} else{
$arr['msg'] = "Subject Type not Added for this Degree";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
}
function EditSubTypeRow($aobj_context) {
$collcode = $_SESSION['collcode'];
$degree = $aobj_context->mobj_data["degree"];
$type = $aobj_context->mobj_data["type"];
$query = "SELECT DISTINCT fdeggrp,fdescpn FROM deggrp ";
$result = $aobj_context->mobj_db->GetAll($query);
if ($result) {
echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success");
} else {
$arr['msg'] = "Data not found";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "error");
return;
}
}
function getDegreesubtypedet($aobj_context){
session_start();
$collcode=$_SESSION['collcode'];
$query="select distinct s.fdegree,d.fdescpn from subtype s
inner join degree d on d.fdegree = s.fdegree group by s.fdegree;";
$result=$aobj_context->mobj_db->GetAll($query);
if($result){
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else{
$data['msg'] = 'Failed to load Degree';
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
}
}
?>
|