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.118.144.239
<?php
function saveorientationdetails($aobj_context)
{
session_start();
$userid = $_SESSION['userid'];
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
include_once("/JSON.php");
$json = new Services_JSON();
$orientation_arr = stripslashes($aobj_context->mobj_data["orientation_arr"]);
$mobj_jsondata = $json->decode($orientation_arr);
$orientation_arr = get_object_vars($mobj_jsondata);
$queryd = "delete from orientdetl
where fuserid = '{$userid}'";
$rst=$aobj_context->mobj_db->Execute($queryd);
for($k=1;$k<=count($orientation_arr);$k++)
{
$query = "INSERT INTO orientdetl(fuserid,finstname,frefcourse,fsponsname,ffromdate,ftodate,fremarks) VALUES
('{$userid}','{$orientation_arr[$k]->Name}','{$orientation_arr[$k]->Rname}','{$orientation_arr[$k]->Sname}',
date_format(str_to_date('{$orientation_arr[$k]->From}','%d/%m/%Y'),'%Y-%m-%d'),date_format(str_to_date('{$orientation_arr[$k]->To}','%d/%m/%Y'),'%Y-%m-%d'),
'{$orientation_arr[$k]->Remarks}')";
//var_dump($query);die();
$rst = $aobj_context->mobj_db->Execute($query);
}
if($rst)
{
$success_msg= "Updated Successfully";
echo $aobj_context->mobj_output->ToJSONEnvelope($success_msg,0,"success");
}
else
{
$error_msg = "Some Failure as occured";
echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"error");
}
}
function loadOrientationDetails($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start();
$userid = $_SESSION['userid'];
$query1 = "SELECT * FROM orientdetl
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");
}
}
?>
|