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.133.155.48
<?php
function csaveclsdets($aobj_context){
$collcode = $aobj_context->mobj_data["collcode"];
$user = $aobj_context->mobj_data["user"];
$clsname = $aobj_context->mobj_data["clsname"];
$teachcode = $aobj_context->mobj_data["teachcode"];
$univcode = $aobj_context->mobj_data["univcode"];
$classid=$aobj_context->mobj_data["clsid"];
$usertype=$aobj_context->mobj_data["usertype"];
// if($usertype==='T'){
// $cnd= "and a.fteachcode='{$user}'";
// $usr="{$user}";
// }else{
// $cnd='';
// $usr='';
// }
if($classid==='undefined')
{
if($usertype==='T'){
$Insertquery = "insert into attclass (fteachcode,fcollcode,fclassname)
values('{$user}','{$collcode}','{$clsname}')";
}else{
$Insertquery = "insert into attclass (fteachcode,fcollcode,fclassname)
values('{$teachcode}','{$collcode}','{$clsname}')";
}
$result = $aobj_context->mobj_db->Execute($Insertquery);
if($result){
$arr['msg'] = "Data inserted successfully";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else{
$data['msg'] = 'Faile to load';
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
}
}else{
$upd ="update attclass set fclassname = '{$clsname}',fupddate = now()
where
#fteachcode = '{$teachcode}'
fcollcode ='{$collcode}'
and fclassid = '{$classid}'";
$result = $aobj_context->mobj_db->Execute($upd);
if($result){
$data['msg'] = "Data updated successfully";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,0,"success");
}else{
$data['msg'] = 'Faile to load';
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
}
}
}
?>
|