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.117.232.108
<?php
function saveDegreeInfo($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['db'];
$degree = $aobj_context->mobj_data['degree'];
$degcode = $aobj_context->mobj_data['degcode'];
$examno = $aobj_context->mobj_data['examno'];
$examcode = $aobj_context->mobj_data['examcode'];
$deggrp = $aobj_context->mobj_data['deggrp'];
$qry="select *from qp_degree where fdegree='{$degcode}' and fexamno='{$examcode}'";
$res = $aobj_context->mobj_db->GetRow($qry);
if($res){
if($degcode != ""){
$query = "update qp_degree
set fdescpn='{$degree}',fexamname='{$examno}',fdeggrp='{$deggrp}'
where fdegree='{$degcode}' and fexamno='{$examcode}'";
}
}else{
if($degcode != ""){
$query = "INSERT INTO qp_degree(fdegree,fdescpn,fexamno,fexamname,fdeggrp)
VALUES('{$degcode}','{$degree}','{$examcode}','{$examno}','{$deggrp}')";
}
}
$result = $aobj_context->mobj_db->Execute($query);
if($result)
{
$arr['msg'] = 'Successsfully Inserted';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else
{
$arr['msg'] = 'No Data found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function getDegreeDetails($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['db'];
$qry="select *from qp_degree";
$result = $aobj_context->mobj_db->GetAll($qry);
if($result){
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
return;
}else{
$arr['msg'] = 'Something went wrong try again later';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
function deleteDegree($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['db'];
$deg = $aobj_context->mobj_data['deg'];
$sem = $aobj_context->mobj_data['sem'];
$query = "delete from qp_degree where fdegree='{$deg}' and fexamno='{$sem}'";
$result = $aobj_context->mobj_db->Execute($query);
if($result){
$arr['msg'] = 'Successsfully Deleted';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}else{
$arr['msg'] = 'Something went wrong try again later';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
function updateDegree($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['db'];
$deg = $aobj_context->mobj_data['deg'];
$sem = $aobj_context->mobj_data['sem'];
$query = "select *from qp_degree where fdegree='{$deg}' and fexamno='{$sem}'";
$result = $aobj_context->mobj_db->GetRow($query);
if($result){
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
return;
}else{
$arr['msg'] = 'Something went wrong try again later';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
function getdeggrpfordeg($aobj_context){
$qry="SELECT IFNULL(fdeggrp,'')AS `key`,IFNULL(fdeggrp,'')AS `value`,CONCAT(fdescpn,' -[',fdeggrp,']') AS `label` FROM qp_deggrp";
$res=$aobj_context->mobj_db->GetAll($qry);
if($res){
echo $aobj_context->mobj_output->ToJSONEnvelope($res,0,"success");
return;
}else{
$arr['msg'] = 'Something went wrong try again later';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
?>
|