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.15.214.244
<?php
function getservinformation($aobj_context)
{
$query = "select distinct FSERVCODE as internal_code, CONCAT(FSERVCODE,' - ',FSERVNAME) as value
from servtype order by FSERVNAME, FSERVCODE";
$results = $aobj_context->mobj_db->GetAll($query);
$arr['servcode']=$results;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
function saveservicefeeheadsMaster($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$add_edit=trim($aobj_context->mobj_data["add_edit"]);
$sercode=trim($aobj_context->mobj_data["sercode"]);
$feecode=trim($aobj_context->mobj_data["feecode"]);
$feedesc=trim($aobj_context->mobj_data["feedesc"]);
$order=trim($aobj_context->mobj_data["order"]);
$mandatory=trim($aobj_context->mobj_data["mandatory"]);
if($add_edit == 'Add')
{
$checkRecord = "select * from servfee where FSERVCODE = '{$sercode}' and FFEECODE='{$feecode}'";
$lobj_checkRecord = $aobj_context->mobj_db->getAll($checkRecord);
if(count($lobj_checkRecord) > 0 )
{
$error_msg = 'Service code '.$sercode.' already exist';
echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"failure");
return;
}
else
{
$save_servfee = "INSERT INTO servfee(fservcode,ffeecode,ffeedesc,forder,fmandatory)
VALUES ('{$sercode}','{$feecode}','{$feedesc}','{$order}','{$mandatory}')";
$lobj_save_servfee = $aobj_context->mobj_db->Execute($save_servfee);
if($lobj_save_servfee)
{
$success_msg = 'Updated successfully.';
echo $aobj_context->mobj_output->ToJSONEnvelope($success_msg,0,"success");
return;
}
else
{
$error_msg = 'Updation failed';
echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"failure");
return;
}
}
}
else if($add_edit == 'Edit')
{
$update_servfee = "update servfee set FFEECODE='{$feecode}',FFEEDESC='{$feedesc}',FORDER='{$order}', fmandatory = '{$mandatory}'
where FSERVCODE = '{$sercode}' and FFEECODE='{$feecode}' ";
//var_dump($update_servfee);
$lobj_update_servfee = $aobj_context->mobj_db->Execute($update_servfee);
if($lobj_update_servfee)
{
$success_msg = 'Updated successfully';
echo $aobj_context->mobj_output->ToJSONEnvelope($success_msg,0,"success");
return;
}
else
{
$error_msg = 'Updation failed';
echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"failure");
return;
}
}
}
function getservicefeecodeDetails($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start(); //and FDELETED = 'F'
$sercode =$aobj_context->mobj_data["sercode"];
$get_servfee_details = "select FSERVCODE,FFEECODE,FFEEDESC,FORDER,FMANDATORY from servfee
where FFEECODE = '{$sercode}' ";
$lobj_get_servfee_details = $aobj_context->mobj_db->getRow($get_servfee_details);
if(count($lobj_get_servfee_details) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_get_servfee_details,0,"success");
return;
}
else
{
$error_msg = 'no details found ';
echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"Disabled");
return;
}
}
function disableservicefeeheadRecord($aobj_context)
{
include_once("/JSON.php");
$json = new Services_JSON();
$lstr_param = stripslashes($aobj_context->mobj_data["delete_arr"]);
$mobj_jsondata = $json->decode($lstr_param);
$delete_arr_data = get_object_vars($mobj_jsondata);
$supcodes = '';
for($k=0;$k<count($delete_arr_data);$k++)
{
//$supcodes .= $delete_arr_data[$k]->servicecode.
$disable_supplier_record = "UPDATE servfee SET FDELETED='T'
WHERE FFEECODE='{$delete_arr_data[$k]->servicecode}' ";
$lobj_rs = $aobj_context->mobj_db->Execute($disable_supplier_record);
}
if($lobj_rs)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,0,"success");
return;
}
else
{
echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_rs,-1,"Failure");
return;
}
}
?>
|