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 : 13.59.83.202
<?php
function loadrvmarksentrytable($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
$query = "SELECT * FROM scandocs WHERE fdoctype = 'Revaluation Marks List'";
$result = $aobj_context->pobj_db->GetAll($query);
// var_dump($result);
if($result)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No data Found..!';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function getdocdetRV($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
$docno = $aobj_context->mobj_data['docno'];
$query = "SELECT * FROM tabhead_rv WHERE fdocno = '{$docno}'
ORDER BY fregcode";
$result_prevdata = $aobj_context->pobj_db->GetAll($query);
$query = "SELECT * FROM scandocs WHERE fdocno = '{$docno}'";
$result = $aobj_context->pobj_db->GetROW($query);
// var_dump($result);
if($result)
{
$arr['prevdata'] = $result_prevdata;
$arr['scandocs'] = $result;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else
{
$arr['msg'] = 'No data Found..!';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
// function getEditdocdet($aobj_context)
// {
// $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
// $univcode = $aobj_context->mobj_data['univcode'];
// $docno = $aobj_context->mobj_data['docno'];
// $query = "SELECT * FROM tabhead_rv WHERE fdocno = '{$docno}'
// ORDER BY fregcode";
// $result = $aobj_context->pobj_db->GetAll($query);
// if($result)
// {
// echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
// }
// else
// {
// $arr['msg'] = 'No data Found..!';
// echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
// }
// }
function saveRVMarks($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$req = $aobj_context->req_body['data'];
$univcode = $aobj_context->mobj_data['univcode'];
$docno = $req['docno'];
$table = $req['table'];
$pktno = $req['pktno'];
$qpcode = $req['qpcode'];
$user = $req['user'];
// var_dump($qpcode);
foreach( $table as $k => $v )
{
$regcode = $qpcode.'-'.$pktno.'-'.$v['slno'];
$values .= "('{$docno}', '{$qpcode}', '{$pktno}', '{$regcode}',
'{$v['mks']}', '{$v['mks']}', now(), '{$user['fname']}', now(), '{$user['fname']}'),";
}
$values = rtrim($values, ',');
$query = "INSERT INTO tabhead_rv (fdocno,fqpcode,fpacket,fregcode,fmarks11,fmarks12,
fcreatedate,fcreateuser,fmoddate,fmoduser)
VALUES {$values}
ON DUPLICATE KEY UPDATE
fmarks11 = values(fmarks11), fmarks12 = values(fmarks12),fmoddate = values(fmoddate), fmoduser = values(fmoduser)
";
// var_dump($query);
$result = $aobj_context->pobj_db->Execute($query);
// var_dump($result);
if($result)
{
$arr['msg'] = 'Updated successfully..!';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else
{
$arr['msg'] = 'Insertion Failed..!';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function saveBoardMaster($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$req = $aobj_context->req_body['data'];
$univcode = $aobj_context->mobj_data['univcode'];
foreach( $req as $k => $v )
{
$values .= "('{$v['fboardcode']}', '{$v['fboardname']}', '{$v['fdeleted']}', '{$v['fchairman']}',
'{$v['fboename']}', '{$v['fboemobileno']}', '{$v['fboeemail']}'),";
}
$values = rtrim($values, ',');
$query = "insert into masboard (fboardcode,fboardname,fdeleted,fchairman,fboename,fboemobileno,fboeemail)
values {$values}
ON DUPLICATE KEY UPDATE
fboardname = values(fboardname), fdeleted = values(fdeleted),fchairman= VALUES(fchairman),fboename= VALUES(fboename)
,fboemobileno= VALUES(fboemobileno),fboeemail= VALUES(fboeemail)";
$result = $aobj_context->pobj_db->Execute($query);
// var_dump($query);
// die();
if($result){
$arr['msg'] = "Updation was Successfull";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}else{
$arr['msg'] = "Updation was not successfull, please try later";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
?>
|