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.143.237.203
<?php
function savePostDetails($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
include_once("/JSON.php");
session_start();
$userid = $_SESSION['userid'];
$json = new Services_JSON();
$post_arr = stripslashes($aobj_context->mobj_data["post_arr"]);
$mobj_jsondata = $json->decode($post_arr);
$post_arr = get_object_vars($mobj_jsondata);
$queryd = "delete from postdet
where fuserid = '{$userid}'";
$rst=$aobj_context->mobj_db->Execute($queryd);
for($k=1;$k<=count($post_arr);$k++)
{
$query = "insert into postdet(fuserid,fdegncode,fdegree)
values({$userid},'{$post_arr[$k]->post}','{$post_arr[$k]->course}')";
$rst=$aobj_context->mobj_db->Execute($query);
}
if($rst)
{
$arr = "Updated Successfully";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else
{
$arr = "Some Failure as occured";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error");
}
}
function loadPostDetails($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start();
$userid = $_SESSION['userid'];
$query1 = "SELECT p.*, concat('student_photos/{$userid}/{$userid}','_photo.jpg') as photo,
concat('student_photos/{$userid}/{$userid}','_sign.jpg') as sign FROM postdet p
where fuserid = '{$userid}'";
$result1 = $aobj_context->mobj_db->GetAll($query1);
if($result1)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result1,0,"success");
}
else
{
$arr = "Some Failure as occured";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error");
}
}
?>
|