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.142.198.108
<?php
function saveDeggrp($aobj_context){
$data = json_decode($aobj_context->mobj_data['data'], true);
if($data['type'] =="update"){
$qry = "UPDATE qp_deggrp
SET fdescpn='{$data['desp']}',fyear='{$data['year']}',fexamtype='{$data['mode']}',fexamdate='{$data['exmdate']}'
WHERE fdeggrp='{$data['deggrp']}'";
}else if($data['type']=="insert"){
$qry = "INSERT INTO qp_deggrp(fdeggrp,fdescpn,fyear,fexamtype,fexamdate,ftype,fdeleted)
VALUES('{$data['deggrp']}','{$data['desp']}','{$data['year']}','{$data['mode']}','{$data['exmdate']}','','')";
}
$res = $aobj_context->mobj_db->Execute($qry);
if($res){
$arr['msg'] = 'Successfully Saved';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, 'success');
} else {
$arr['msg'] = 'Failed to update';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
function getdeggrpdata($aobj_context){
$dbname = $aobj_context->mobj_data["db"];
$qry = "select ifnull(fdeggrp,'')as fdeggrp, ifnull(fdescpn,'')as fdescpn,
ifnull(fyear,'')as fyear,
ifnull(fexamtype,'')as fexamtype,
ifnull(fexamdate,'')as fexamdate FROM qp_deggrp";
$res = $aobj_context->mobj_db->GetAll($qry);
if($res){
echo $aobj_context->mobj_output->ToJSONEnvelope($res, 0, 'success');
} else {
$arr['msg'] = 'Failed to update';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
function toDeleteDeggrpData($aobj_context){
$dbname = $aobj_context->mobj_data["db"];
$deggrp = $aobj_context->mobj_data["deggrp"];
$qry="delete from qp_deggrp where fdeggrp='{$deggrp}'";
$res = $aobj_context->mobj_db->Execute($qry);
if($res){
$arr['msg'] = 'Delete 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");
return;
}
}
function toEditDeggrpData($aobj_context){
$dbname = $aobj_context->mobj_data["db"];
$deggrp = $aobj_context->mobj_data["deggrp"];
$qry="select *from qp_deggrp where fdeggrp='{$deggrp}'";
$res = $aobj_context->mobj_db->GetRow($qry);
if($res){
echo $aobj_context->mobj_output->ToJSONEnvelope($res, 0, 'success');
} else {
$arr['msg'] = 'Failed to update';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
?>
|