0xV3NOMx
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.145.69.185


Current Path : /proc/thread-self/root/var/www/html/univadmin/finance/
Upload File :
Current File : //proc/thread-self/root/var/www/html/univadmin/finance/getBankDetails.php

<?php
    function getBankDetails($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
        $univcode = $aobj_context->mobj_data["univcode"];
        
        $query="select fbankcode, fbankname, fopenbal,
         fopenbaldate ,
        ifnull(fdeleted,'F') as fdeleted
        from fms_masbank";

        $result = $aobj_context->pobj_db->GetAll($query);

        

        if($result){
            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 saveBankDetailsFMS($aobj_context){

        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $univcode = $aobj_context->mobj_data['univcode'];
        $fuser = $aobj_context->mobj_data['fuser'];
        $req = $aobj_context->req_body;
        $data = json_decode($aobj_context->mobj_data["data"], true);
        $date = date("Y-m-d");
    //   var_dump($data);die();
        foreach($data as $key => $val){
            if($val['fdeleted'] == true){
                $fdelte = 'T';
                $cond = ",fdeleteuser";
                $cond1 = ",'{$fuser}'";
                $cond2 = ",fdeleteuser = '{$fuser}'";
                $det = ",fdeletedate";
                $dat = ",'{now()}'";
                $update = ",fdeletedate = '{now()}'";
            }else if($val['fdeleted'] == false){
                $fdelte = 'F';
                $cond = "";
                $cond1 = "";
                $cond2 = "";
                $det = "";
                $dat = "";
                $update = "";
            }
            $query = "insert into fms_masbank(fbankcode, fbankname, fopenbal, fopenbaldate,fdeleted) 
            values('{$val['fbankcode']}','{$val['fbankname']}','{$val['fopenbal']}','{$val['fopenbaldate']}','{$fdelte}')
            ON DUPLICATE KEY UPDATE
            fbankcode = '{$val['fbankcode']}',
            fbankname = '{$val['fbankname']}', 
            fopenbal = '{$val['fopenbal']}',
            fopenbaldate = '{$val['fopenbaldate']}',
            fdeleted = '{$fdelte}'";

            $result = $aobj_context->pobj_db->Execute($query);
        }
          
        if ($result) {
            $arr['msg'] = 'Saved Successfully..!';
          echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success");
        } else {
          $arr['msg'] = 'Failed to Load';
          echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
        }
    }

    function getAccHeadDetFMS($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
        $univcode = $aobj_context->mobj_data["univcode"];
        $budgetYer = $aobj_context->mobj_data["budgetYer"];
        $headTyp = $aobj_context->mobj_data["headTyp"];
        
        $query="select fheadcode,fheaddesc,famount,fdeleted,faccode  from fms_mashead
            where fyear = '{$budgetYer}' and fheadtype = '{$headTyp}'";
        
        $result = $aobj_context->pobj_db->GetAll($query);

        $query="select fbankcode, fbankname from fms_masbank";

        $result1 = $aobj_context->pobj_db->GetAll($query);

        $res['fhead'] = $result;
        $res['facc'] =$result1;

        if($res){
            echo $aobj_context->mobj_output->ToJSONEnvelope($res,0,"success");  
        }else{
            $arr['msg'] = 'Failed to load';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
        }
    }

    function saveHeadDetFMS($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
        $univcode = $aobj_context->mobj_data["univcode"];
        $fuser = $aobj_context->mobj_data["fuser"];
        $req = $aobj_context->req_body;
        $data = $req['data']['head_Tab'];
        $budgetYer = $aobj_context->mobj_data["budgetYer"];
        $headTyp = $aobj_context->mobj_data["headTyp"];
        
        foreach($data as $key => $val){
            if($val['fdeleted'] == true){
                $fdelte = 'T';
            }else if($val['fdeleted'] == false){
                $fdelte = 'F';
            }

            $query = "insert into fms_mashead(fyear,fheadtype,fheadcode, fheaddesc, famount, faccode,fdeleted) 
            values('{$budgetYer}','{$headTyp}','{$val['fheadcode']}','{$val['fheaddesc']}','{$val['famount']}','{$val['faccode']}','{$fdelte}')
            ON DUPLICATE KEY UPDATE
            fyear = '{$budgetYer}',
            fheadtype = '{$headTyp}',
            fheadcode = '{$val['fheadcode']}',
            fheaddesc = '{$val['fheaddesc']}', 
            famount = '{$val['famount']}',
            faccode = '{$val['faccode']}',
            fdeleted = '{$fdelte}'";
            
            $result = $aobj_context->pobj_db->Execute($query);
        }
        
        if($result){
            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 viewHeadsDetails($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
        $univcode = $aobj_context->mobj_data["univcode"];

        $query = "select fyear as Budget_Year,if(fheadtype = 'E','Expenditure','Payment') as Head_Type	
        ,count(*) as Count from fms_mashead GROUP BY fyear, fheadtype";
        // "select fyear,if(fheadtype = 'E','Expenditure','Payment') as fheadtype
        // ,count(*) as count from fms_mashead GROUP BY fyear, fheadtype";
        
        $result = $aobj_context->pobj_db->GetAll($query);
       
        if($result){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");  
        }else{
            $arr['msg'] = 'No Data';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
        }
    }

    function saveAgencyData($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
        $univcode = $aobj_context->mobj_data["univcode"];
        $data1 = json_decode($aobj_context->mobj_data["data"], true);
        
            $query = "insert into fms_masag(fagcode,fagname,faddr1,fphone, ffax, fmobile, femail,fremarks,facno,fifsccode,
            fbankname,fbranch,fpanno) 
            values('{$data1['ag_code']}','{$data1['agency_name']}','{$data1['address']}','{$data1['phoneno']}','{$data1['fax']}',
            '{$data1['mobileno']}','{$data1['email']}','{$data1['remarks']}'
            ,'{$data1['ac_no']}',
            '{$data1['ifsccode']}','{$data1['bankname']}','{$data1['branch']}','{$data1['panno']}')
            ON DUPLICATE KEY UPDATE
            fagcode = '{$data1['ag_code']}',
            fagname = '{$data1['agency_name']}',
            faddr1 = '{$data1['address']}',
            fphone = '{$data1['phoneno']}',
            ffax = '{$data1['fax']}', 
            fmobile = '{$data1['mobileno']}', 
            femail = '{$data1['email']}', 
            fremarks = '{$data1['remarks']}', 
            facno = '{$data1['ac_no']}', 
            fifsccode = '{$data1['ifsccode']}',
            fbankname = '{$data1['bankname']}',
            fbranch = '{$data1['branch']}',
            fpanno = '{$data1['panno']}'
            ";
            
            $result = $aobj_context->pobj_db->Execute($query);
        
        
        if($result){
            $arr['msg'] = 'Saved';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");  
        }else{
            $arr['msg'] = 'Failed to load';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
        }
    }
    
    function viewAgencyDetails($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
        $univcode = $aobj_context->mobj_data["univcode"];
        
        $query="select fagcode,fagname,fmobile from fms_masag";
        
        $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 getEditAgDet($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
        $univcode = $aobj_context->mobj_data["univcode"];
        $fagcode = $aobj_context->mobj_data["fagcode"];

        $query = "select fagname,faddr1,fphone,ffax, fmobile, femail, fremarks, facno, fifsccode,fbankname,fbranch,fpanno
        from fms_masag where fagcode = '{$fagcode}'";
        
        $result = $aobj_context->pobj_db->GetAll($query);
       
        if($result){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");  
        }else{
            $arr['msg'] = 'No Data';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
        }
    }

    function getTaxDet($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
        $univcode = $aobj_context->mobj_data["univcode"];
        
        $query="select * from fms_mastax";
        
        $result = $aobj_context->pobj_db->GetAll($query);

        if($result){
            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 saveTaxDet($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
        $univcode = $aobj_context->mobj_data["univcode"];
        $data = json_decode($aobj_context->mobj_data["data"], true);
        
        foreach($data as $key => $val){

            if($val['fdeleted'] == true){
                $fdelte = 'T';
            }else if($val['fdeleted'] == false){
                $fdelte = 'F';
            }

            $query = "insert into fms_mastax(ftaxcode,ftaxdesc,fpercent, fdeleted)
            values('{$val['ftaxcode']}','{$val['ftaxdesc']}','{$val['fpercent']}',
            '{$fdelte}')
            ON DUPLICATE KEY UPDATE
            ftaxcode = '{$val['ftaxcode']}',
            ftaxdesc = '{$val['ftaxdesc']}',
            fpercent = '{$val['fpercent']}',
            fdeleted = '{$fdelte}'";
            
            $result = $aobj_context->pobj_db->Execute($query);
        }
           
        if($result){
            $arr['msg'] = 'Saved';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");  
        }else{
            $arr['msg'] = 'Failed to load';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
        }
    }

    function getCategoryDet($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
        $univcode = $aobj_context->mobj_data["univcode"];
        
        $query="select * from fms_mascat";
        
        $result = $aobj_context->pobj_db->GetAll($query);

        if($result){
            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 saveCategoryDet($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
        $univcode = $aobj_context->mobj_data["univcode"];
        $data = json_decode($aobj_context->mobj_data["data"], true);
        
        foreach($data as $key => $val){

            if($val['fdeleted'] == true){
                $fdelte = 'T';
            }else if($val['fdeleted'] == false){
                $fdelte = 'F';
            }

            $query = "insert into fms_mascat(fcatcode,fcatdesc,forder, fdeleted)
            values('{$val['fcatcode']}','{$val['fcatdesc']}','{$val['forder']}',
            '{$fdelte}')
            ON DUPLICATE KEY UPDATE
            fcatcode = '{$val['fcatcode']}',
            fcatdesc = '{$val['fcatdesc']}',
            forder = '{$val['forder']}',
            fdeleted = '{$fdelte}'";
            
            $result = $aobj_context->pobj_db->Execute($query);
        }
           
        if($result){
            $arr['msg'] = 'Saved';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");  
        }else{
            $arr['msg'] = 'Failed to load';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
        }
    }

    function getCurrencyDet($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
        $univcode = $aobj_context->mobj_data["univcode"];
        
        $query="select * from fms_mascurr";
        
        $result = $aobj_context->pobj_db->GetAll($query);

        if($result){
            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 deleteRecord($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
        $univcode = $aobj_context->mobj_data["univcode"];
        $fuser = $aobj_context->mobj_data["fuser"];
        $fbankcode = $aobj_context->mobj_data["fbankcode"];
        $fdelete = $aobj_context->mobj_data["fdelete"];
        
        if($fdelete == true){
            $fdelte = 'T';
        }else if($fdelete == false){
            $fdelte = 'F';
        }
        var_dump($fdelte);die();
        $query = "update fms_masbank set fdeleted = '{$fdelte}' where fbankcode = '{$fbankcode}'";
        
        $result = $aobj_context->pobj_db->Execute($query);
        
           
        if($result){
            $arr['msg'] = 'Saved';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");  
        }else{
            $arr['msg'] = 'Failed to load';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
        }
    }

    function saveCurrencyDet($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
        $univcode = $aobj_context->mobj_data["univcode"];
        $data = json_decode($aobj_context->mobj_data["data"], true);
        
        foreach($data as $key => $val){

            if($val['fdeleted'] == true){
                $fdelte = 'T';
            }else if($val['fdeleted'] == false){
                $fdelte = 'F';
            }

            $query = "insert into fms_mascurr(fcurrcode,fcurrency,frate, fdeleted)
            values('{$val['fcurrcode']}','{$val['fcurrency']}','{$val['frate']}',
            '{$fdelte}')
            ON DUPLICATE KEY UPDATE
            fcurrcode = '{$val['fcurrcode']}',
            fcurrency = '{$val['fcurrency']}',
            frate = '{$val['frate']}',
            fdeleted = '{$fdelte}'";
            
            $result = $aobj_context->pobj_db->Execute($query);
        }
           
        if($result){
            $arr['msg'] = 'Saved';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");  
        }else{
            $arr['msg'] = 'Failed to load';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
        }
    }
?>