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.191.147.146
<?php
function loademploymentdet($aobj_context){
// $mob=$_SESSION["MOBILE"];
$appno=$_SESSION["APPNO"];
$query="SELECT IFNULL(fid,'')as id,
IFNULL(fexpin,'')AS fexpin,
IFNULL(femployer,'')AS femployer,
ifnull(DATE_FORMAT(ffrom,'%d/%m/%Y'),'') AS ffrom,
ifnull(DATE_FORMAT(fto,'%d/%m/%Y'),'') AS fto,
IFNULL(fdesgn,'')AS fdesgn ,
IFNULL(fduration,'')AS fduration
FROM phdemp WHERE fappno='{$appno}'";
$lobj_get_data = $aobj_context->mobj_db->GetAll($query);
if($lobj_get_data){
echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_get_data,0,"success");
}else{
$arr['msg'] = 'Failed to load';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function saveemploymentdet_acu($aobj_context){
$mob=$_SESSION["MOBILE"];
$fappno=$_SESSION["APPNO"];
$expin=$aobj_context->mobj_data["expin"];
$frmdate=$aobj_context->mobj_data["frmdate"];
$todate=$aobj_context->mobj_data["todate"];
$designation=$aobj_context->mobj_data["designation"];
$duration=$aobj_context->mobj_data["duration"];
$employer=$aobj_context->mobj_data["employer"];
$fid=$aobj_context->mobj_data["fid"];
$qry1 = "select ifnull(FPAYSTATUS,'') as FPAYSTATUS
from phdstudadm
where fappno = '{$fappno}'";
$rlt1 = $aobj_context->mobj_db->GetRow($qry1);
if($rlt1['FPAYSTATUS'] == 'success'){
$arr['msg'] = 'You are not able to edit ';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
$qry = "select fappno,fid from phdemp
where fappno = '{$fappno}' and fid = '{$fid}'";
$rlt = $aobj_context->mobj_db->GetRow($qry);
if($rlt['fappno'] == ""){
$query="insert into phdemp (FAPPNO,fexpin,ffrom,fto,femployer,fdesgn,fduration)
values('{$fappno}','{$expin}','{$frmdate}','{$todate}','{$employer}','{$designation}','{$duration}')";
$lobj_get_data = $aobj_context->mobj_db->Execute($query);
if($lobj_get_data){
$arr['msg'] = "Saved Successfully..!!";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}else{
$arr['msg'] = 'Failed to Save';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}else{
$query = "update phdemp set fexpin = '{$expin}',
ffrom = '{$frmdate}',fto = '{$todate}',femployer = '{$employer}',fdesgn = '{$designation}',
fduration = '{$duration}'
where fappno = '{$fappno}' and fid = '{$fid}'";
$run = $aobj_context->mobj_db->Execute($query);
if($run){
$arr['msg'] = "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");
}
}
}
function editempdet_acu($aobj_context){
$appno=$_SESSION["APPNO"];
$fid=$aobj_context->mobj_data["id"];
$qry = "SELECT IFNULL(fid,'')as id,
IFNULL(fexpin,'')AS fexpin,
IFNULL(femployer,'')AS femployer,
ifnull(ffrom,'') AS ffrom,
ifnull(fto,'') AS fto,
IFNULL(fdesgn,'')AS fdesgn ,
IFNULL(fduration,'')AS fduration
FROM phdemp WHERE fappno='{$appno}' and fid = '{$fid}'";
$rltdata = $aobj_context->mobj_db->GetRow($qry);
if($rltdata) {
echo $aobj_context->mobj_output->ToJSONEnvelope($rltdata,0,"success");
}
else {
$arr['msg'] = 'Failed to save';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function deleteempdet_acu($aobj_context)
{
$appno=$_SESSION["APPNO"];
$id=$aobj_context->mobj_data["id"];
$qry = "delete from phdemp
where fappno = '{$appno}' and fid = '{$id}'";
$rltdata = $aobj_context->mobj_db->Execute($qry);
if($rltdata) {
$arr['msg'] = "Deleted Successfully..!";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else {
$arr['msg'] = 'Failed to delete';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
?>
|