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 : 18.188.114.150


Current Path : /var/www/oasis/src/
Upload File :
Current File : /var/www/oasis/src/rvrt_ack_exam_app.php

<?php
function resstuddegree($aobj_context){
    $collcode=$_SESSION['collcode'];
    $query="SELECT DISTINCT s.fdegree, d.FDESCPN FROM res_stud s INNER JOIN degree d ON s.fdegree=d.fdegree WHERE fcollcode='{$collcode}'";
   
    $data = $aobj_context->mobj_db->GetAll($query);
    echo $aobj_context->mobj_output->ToJSONEnvelope($data,0,"success"); 
}
function rvrtackexamapp($aobj_context){
    {
        $collcode=$_SESSION['collcode'];	
        $ack_app_degree = $aobj_context->mobj_data["rv_rt_ack_degree"];
    
         $app_no_from = $aobj_context->mobj_data["app_no_from"];
         $reg_no_from=$aobj_context->mobj_data["reg_no_from"];
         $reg_no_to=$aobj_context->mobj_data["reg_no_to"];
        // $app_no_from=str_pad($app_no_from, 50, "0", STR_PAD_LEFT);
        // $reg_no_from=str_pad($reg_no_from, 8, "0", STR_PAD_LEFT);
       

        if($ack_app_degree == 'all'){
            $join = "";
        }else{
            $join = "AND r.fdegree = '{$ack_app_degree}'";
        }
        
        $app_no_to = $aobj_context->mobj_data["app_no_to"];
        $rtype = $aobj_context->mobj_data["rtype"];
        // var_dump($reg_no_from);die();
        if($rtype === "rvrtall"){
            $cond="";
        }else if($rtype === "rvrtacknowledge"){
            $cond="and ifnull(r.fackdate, '') <> ''";
        }else if($rtype === "not-rvrtack"){
            $cond="and ifnull(r.fackdate, '') = ''";
        }
          $get_data="SELECT DISTINCT r.APPNO, r.FPAYMENTYPE, IFNULL(fackdate,'') AS 
                     fackdate, DATE_FORMAT(r.FAPPDATE,'%d/%m/%Y') AS FAPPDATE,r.FREGNO,s.FNAME, r.FDEGREE,r.FTOTAL FROM 
                     res_stud r INNER JOIN student s ON s.FREGNO=r.FREGNO WHERE 
                     r.FREGNO BETWEEN '{$reg_no_from}' AND '{$reg_no_to}' AND
                     r.FCOLLCODE='{$collcode}' AND r.APPNO between '{$app_no_from}' 
                     AND '{$app_no_to}' 
                     $join {$cond} ORDER BY r.fdegree,r.fregno,r.APPNO";


            $lobj_get_data = $aobj_context->mobj_db->GetAll($get_data);
       
            echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_get_data,0,"success"); 

}
}

function acknokledgementbutton($aobj_context){
    $regno = $aobj_context->mobj_data["regno"];
    $appno = $aobj_context->mobj_data["appno"];
    // var_dump($appno);die();
    $log_name = $_SESSION['usr'];
    $univcode = $_SESSION['FUNIVCODE'];
   
    if($univcode == '051')
    {
        $arr['msg']="Manual Ack. not Allowed contact coe office";
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 
        return;
    }    

                $query = "UPDATE res_stud
                SET fackdate= now(),FACKUSER='{$log_name}',
					FPAYMENTSTATUS = 'success', FPAYMENTCONFIRM = 'success',
					FPAYMENTREMARKS = 'Manaul'
                WHERE FREGNO = '{$regno}' AND APPNO = '{$appno}'";
              
                    $result=$aobj_context->mobj_db->Execute($query);
                   if($univcode == '051' || $univcode == '050'){
                    $update = "insert ignore into tdvs_tabsum(fqpcode,FPACKET,FREGCODE,FVALNO,FYEAR,FEXAMTYPE,fupddate)
                    select t.fqpcode,'0001',t.fregcode,'R',r.FYEAR,r.FEXAMTYPE, now()
                    from res_stud r inner join subject s on r.fdegree = s.fdegree
                    and r.fexamno = s.fexamno and s.fsubcode = left(r.fsubcode,4)
                    inner join tdvs_tabulate t on r.fregno = t.fregno
                    and s.fqpcode = t.fqpcode
                    and r.fyear = t.fyear 
                    and r.fexamtype = t.fexamtype
                    where ifnull(r.fpaymentstatus,'') = 'success'
                    and r.APPNO='{$appno}'
                    and r.FCORRTYPE = 'RV'";
                    $res = $aobj_context->mobj_db->Execute($update);

                    $update = "insert ignore into tdvs_tabsum(fqpcode,FPACKET,FREGCODE,FVALNO,FYEAR,FEXAMTYPE,fupddate)
                    select t.fqpcode,'0001',t.fregcode,'R',r.FYEAR,r.FEXAMTYPE, now()
                    from res_stud r inner join subject s on r.fdegree = s.fdegree
                    and r.fexamno = s.fexamno and s.fsubcode = left(r.fsubcode,4)
                    inner join tdvs_tabulate_bkp t on r.fregno = t.fregno
                    and s.fqpcode = t.fqpcode
                    and r.fyear = t.fyear 
                    and r.fexamtype = t.fexamtype
                    where ifnull(r.fpaymentstatus,'') = 'success'
                    and r.APPNO='{$appno}'
                    and r.FCORRTYPE = 'RV'";
                    $res = $aobj_context->mobj_db->Execute($update);

                    $update = "insert ignore into tdvs_tabhead(fqpcode,FREGCODE,FFILEPATH,FACTIVE,FYEAR,FEXAMTYPE,FSYSDATE)
                    select t.fqpcode,t.fregcode,h.FFILEPATH,'T',r.FYEAR,r.FEXAMTYPE, now()
                    from res_stud r inner join subject s on r.fdegree = s.fdegree
                    and r.fexamno = s.fexamno and s.fsubcode = left(r.fsubcode,4)
                    inner join tdvs_tabulate_bkp t on r.fregno = t.fregno
                    and s.fqpcode = t.fqpcode
                    and r.fyear = t.fyear 
                    and r.fexamtype = t.fexamtype
                    inner join tdvs_tabhead_bkp h on h.fregcode = t.fregcode
                    and h.fqpcode = t.fqpcode
                    where ifnull(r.fpaymentstatus,'') = 'success'
                    and r.APPNO='{$appno}'
                    and r.FCORRTYPE = 'RV'";
                    $res = $aobj_context->mobj_db->Execute($update);
                   
                   }
                   if($result){
                    $arr['msg']="Application(s) acknowledged 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"); 
                }
        

}

?>