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.156.67
Current Path : /var/www/oasis/src/ |
| Current File : /var/www/oasis/src/saveclsdets.php |
<?php
function csaveclsdets($aobj_context){
$collcode = $aobj_context->mobj_data["collcode"];
$usertype = $aobj_context->mobj_data["usertype"];
$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"];
var_dump($classid);die();
if($classid==='undefined')
{
$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}'
and 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");
}
}
}
?>
|