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.144.255.198
<?php
function viewuploadpassword($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
$examdate = $aobj_context->mobj_data['examdate'];
$session = $aobj_context->mobj_data['session'];
$query = "select ifnull(date_format(fexamdate,'%d/%m/%Y'),'') as fexamdate,
ifnull(fsession,'') as fsession,
ifnull(fqpcode,'') as fqpcode,
ifnull(ffilepath,'') as ffilepath,
ifnull(fpwd1,'') as fpwd1,
ifnull(fpwd2,'') as fpwd2,
ifnull(date_format(fupddate,'%d/%m/%Y'),'') as fupddate,
ifnull(fupduser,'') as fupduser,
ifnull(fid,'') as fid
from qpupload
where fexamdate = date_format(STR_TO_DATE('{$examdate}', '%d/%m/%Y'),'%Y-%m-%d')
and fsession ='{$session}'";
$result = $aobj_context->pobj_db->GetAll($query);
if (count($result) > 0) {
echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success");
} else {
$arr['msg'] = 'Failed to Load';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
}
}
function updateuplpwd($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
$req = $aobj_context->req_body;
$data = $req['data']['viewpwd'];
foreach($data as $key => $val){
$query = "update qpupload set fpwd1 = '{$val[fpwd1]}',fpwd2 = '{$val[fpwd2]}'
where fexamdate = date_format(STR_TO_DATE('{$val['fexamdate']}', '%d/%m/%Y'),'%Y-%m-%d')
and fsession = '{$val['fsession']}' and fid = '{$val['fid']}'";
$result = $aobj_context->pobj_db->Execute($query);
}
if ($result) {
$arr['msg'] = 'Password Updated 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");
}
}
?>
|