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.12.146.108
<?php
function getservinfeeformation($aobj_context)
{
$query = "select distinct FDEGREE as id, CONCAT(FDEGREE,' - ',FDESCPN) as value
from degree where IFNULL(fdeleted,'') <> 'T' and ifnull(FDEGREE,'') <> '' order by FDEGREE";
$results = $aobj_context->mobj_db->GetAll($query);
$query2 = "select distinct FSERVCODE as id, FSERVNAME as value
from servtype where IFNULL(fdeleted,'') <> 'T' order by FSERVCODE";
$results2 = $aobj_context->mobj_db->GetAll($query2);
$query1 = "select distinct FCATEGORY as id, FDESCPN as value
from category where IFNULL(fdeleted,'') <> 'T' order by FCATEGORY";
$results1 = $aobj_context->mobj_db->GetAll($query1);
$arr['degree']=$results;
$arr['category']=$results1;
$arr['servtype']=$results2;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
function loadservfeeheads($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$servcode = trim($aobj_context->mobj_data["servcode"]);
$query = "select distinct FFEECODE as id, FFEEDESC as value
from servfee where FSERVCODE = '{$servcode}' and IFNULL(fdeleted,'') <> 'T' order by FFEECODE";
$results = $aobj_context->mobj_db->GetAll($query);
$arr['servheads'] = $results;
if($results)
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
else
{
$error_msg = 'no details found';
echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"failure");
}
}
function saveservicefeeMaster($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$add_edit = trim($aobj_context->mobj_data["add_edit"]);
$degcode = trim($aobj_context->mobj_data["degcode"]);
$catcode = trim($aobj_context->mobj_data["catcode"]);
$feecode = trim($aobj_context->mobj_data["feecode"]);
$fee = trim($aobj_context->mobj_data["fee"]);
if($add_edit == 'Add')
{
$checkRecord = "select * from servfeestr where FDEGREE = '{$degcode}' and FCATCODE='{$catcode}' and FFEECODE = '{$feecode}'";
$lobj_checkRecord = $aobj_context->mobj_db->getAll($checkRecord);
if(count($lobj_checkRecord) > 0 )
{
$error_msg = 'Service Fee '.$degcode.' '.$catcode.' '.$feecode.' already exist';
echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"failure");
return;
}
else
{
$save_servfee = "INSERT INTO servfeestr(FDEGREE, FCATCODE, FFEECODE, FFEE)
VALUES ('{$degcode}','{$catcode}','{$feecode}','{$fee}')";
$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 servfeestr set FFEE = '{$fee}'
where FDEGREE = '{$degcode}' and FCATCODE='{$catcode}' 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 getservicefeeDetails($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start(); //and FDELETED = 'F'
$degcode =$aobj_context->mobj_data["degcode"];
$catcode =$aobj_context->mobj_data["catcode"];
$feecode =$aobj_context->mobj_data["feecode"];
$get_servfee_details = "select FDEGREE,FCATCODE,FFEECODE,FFEE from servfeestr
where FDEGREE = '{$degcode}' and FCATCODE = '{$catcode}' and FFEECODE = '{$feecode}' ";
//var_dump($get_servfee_details);
$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 disableservicefeeRecord($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);
} */
$degcode =$aobj_context->mobj_data["degcode"];
$catcode =$aobj_context->mobj_data["catcode"];
$feecode =$aobj_context->mobj_data["feecode"];
//$supcodes .= $delete_arr_data[$k]->servicecode.
$disable_supplier_record = "UPDATE servfeestr SET FDELETED = 'T'
where FDEGREE = '{$degcode}' and FCATCODE = '{$catcode}' and FFEECODE = '{$feecode}'";
// var_dump($disable_supplier_record);
$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;
}
}
?>
|