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


Current Path : /proc/thread-self/root/var/www/oasis/src/
Upload File :
Current File : //proc/thread-self/root/var/www/oasis/src/attendEntry.php

<?php

function getAttEntDegree($aobj_context){
    @session_start();
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $collcode = $_SESSION['collcode'];
    $funivcode=$_SESSION['FUNIVCODE'];
    // var_dump($collcode,"vikkkkkk");
    // die();

        if($funivcode == '098')
        {
            $query=" SELECT a.fdegree,d.fdescpn FROM student a 
            INNER JOIN degree d ON a.fdegree=d.fdegree
            WHERE a.fcollcode='{$collcode}' 
            and d.fdegree = 'BBA1'
            GROUP BY a.fdegree";
             
            $result = $aobj_context->mobj_db->GetAll($query);
        }else
        {
            $query=" SELECT a.fdegree,d.fdescpn FROM student a 
            INNER JOIN degree d ON a.fdegree=d.fdegree
            WHERE a.fcollcode='{$collcode}' 
            GROUP BY a.fdegree";
             
            $result = $aobj_context->mobj_db->GetAll($query);
        }
        
        // var_dump($query);
        // die();
        if($result)
        {
        echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
        }
        else
        {
        $arr['msg'] = 'No Degree Found';
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 	
        }	
}

function getAttEntSemDet($aobj_context){
    @session_start();
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $collcode = $_SESSION['collcode'];
    $funivcode=$_SESSION['FUNIVCODE'];

    $degree = $aobj_context->mobj_data["degree"];
        if($funivcode == '098')
        {
            $query="SELECT DISTINCT d.fexamno, d.fexamname 
            FROM degree d where fdegree='{$degree}'
            and fexamno = 'D'";
        }else
        {
            $query="SELECT DISTINCT d.fexamno, d.fexamname 
            FROM degree d where fdegree='{$degree}'";
        }
        $result = $aobj_context->mobj_db->GetAll($query);
        // var_dump($query);
        // die();
      
        if($result)
        {
        echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
        }
        else
        {
        $arr['msg'] = 'No Exam Number Found';
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 	
        }	
}

function getAttEntSubDet($aobj_context){
    @session_start();
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $collcode = $_SESSION['collcode'];
    $userid = $_SESSION['user_id'];
    $usrtype = $_SESSION['usrtype'];

    $degree = $aobj_context->mobj_data["degree"];
    $examno = $aobj_context->mobj_data["examno"];
    //var_dump($usrtype);


    $query = "insert ignore into attend (fcollcode, fdegree, fexamno, fsubcode,fregno,fyear, fexamtype)
        select cd.fcollcode, cd.fdegree, cd.fexamno, s.fcsubcode,cd.fregno, cd.fyear, cd.fexamtype
        from canddet cd inner join subject s on cd.fdegree = s.fdegree and cd.fexamno = s.fexamno
        and cd.fsubcode = s.fsubcode
        inner join candsum cs on cd.fregno =cs.fregno
        and cd.fexamno = cs.ffreshexam
        where cd.fcollcode = '{$collcode}'
        and cd.fdegree = '{$degree}'
        and cd.fexamno = '{$examno}'
        and ifnull(s.fattent,'F') = 'T'
        group by cd.fcollcode, cd.fdegree, cd.fexamno,cd.fregno,s.fcsubcode";
        
    $res2 = $aobj_context->mobj_db->Execute($query);

    $cnd = "inner join usersub us on a.fdegree = us.fdegree and a.fcollcode = us.fcollegecode and us.fuser = '{$userid}'
        and INSTR(us.fsubcode,left(s.fsubcode,4))
        and us.fdegree = '{$degree}' and us.fcollegecode = '{$collcode}'";
    
    if($usrtype == '40')
    {
        $cnd = '';    
    }else if($usrtype == '14')
    {
        $cnd = '';  
    }
        $query="SELECT DISTINCT concat(s.fsubname, ' - ', s.fssubname)as fsubname,s.fcsubcode as fsubcode,s.fsubshort 
        FROM subject s INNER JOIN attend a ON s.fdegree=a.fdegree and a.fsubcode = s.fcsubcode
        {$cnd}
        WHERE a.fdegree='{$degree}' AND a.fcollcode='{$collcode}' 
        AND s.fexamno='{$examno}'";
       
        $result = $aobj_context->mobj_db->GetAll($query);

        // var_dump($query);
        // die();
      
        if($result)
        {
        echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
        }
        else
        {
        $arr['msg'] = 'No Subject Found';
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 	
        }	
}


function getAttEntSection($aobj_context)
{
    @session_start();
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $collcode = $_SESSION['collcode'];
    $degree = $aobj_context->mobj_data["degree"];
    $examno = $aobj_context->mobj_data["examno"];

    $query="SELECT a.fsection,a.fdegree,b.fdegree FROM usrsection a INNER JOIN attend b ON a.fdegree=b.fdegree 
    WHERE b.fcollcode='{$collcode}' AND b.fdegree='{$degree}' GROUP BY a.fsection";
    
    $result = $aobj_context->mobj_db->GetAll($query);

    if($result)
    {
        echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
        return;
    }
    else
    {
        $query="SELECT 'All' as fsection";
        $result = $aobj_context->mobj_db->GetAll($query);
        echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 	
        return;
    }	
}
?>