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.224.38.170


Current Path : /var/www/html/admission/src/
Upload File :
Current File : /var/www/html/admission/src/practicalMarks.php

<?php
function getCollegeDet($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data['univcode'];
   
    $query = "SELECT m.fcollcode, c.fcollname FROM marks_pr m INNER JOIN college c 
    ON m.fcollcode = c.fcollcode GROUP BY m.fcollcode";
    
    $result = $aobj_context->pobj_db->GetAll($query);
    // var_dump($result);
    // die();
    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 getDegreeColl($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data['univcode'];
    $college = $aobj_context->mobj_data['college'];
    
    if($college = 'All'){
        $con = "";
    }else{
        $con = "WHERE m.fcollcode = '{$college}'";
    }

    $query = "SELECT m.fdegree, d.fdescpn FROM marks_pr m INNER JOIN degree d 
    ON m.fdegree = d.fdegree AND m.fexamno = d.fexamno $con
    GROUP BY d.fdegree";
    
    $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 getSubjDeg($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $college = $aobj_context->mobj_data['college'];
    $degree = $aobj_context->mobj_data['degree'];
    $sem = $aobj_context->mobj_data['sem'];
    
    if($college == 'All'){
        $con = "";
    }else{
        $con = "AND m.fcollcode = '{$college}' ";
    }
    if($sem == 'All'){
        $con = "";
    }else{
        $con1 = "AND m.fexamno = '{$sem}'";
    }

    $query = "SELECT m.fsubcode, s.fsubname FROM subject s INNER JOIN  marks_pr m 
    ON m.fdegree = s. fdegree AND m.fexamno = s.fexamno 
    and s.fcsubcode = m.fsubcode
    WHERE s.fdegree = '{$degree}' $con
    $con1
    GROUP BY m.fdegree,m.fsubcode";
    // var_dump($query);
    // die();
    $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 getSemDeg($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $college = $aobj_context->mobj_data['college'];
    $degree = $aobj_context->mobj_data['degree'];
    
    if($college == 'All'){
        $con = "";
    }else{
        $con = "AND m.fcollcode = '{$college}'";
    }
    
    $query = "SELECT m.fexamno, d.fexamname FROM marks_pr m INNER JOIN degree d 
    ON m.fdegree = d.fdegree AND m.fexamno = d.fexamno WHERE  m.fdegree = '{$degree}'  
    $con GROUP BY m.fexamno";
    
    $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 getBatchSub($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $college = $aobj_context->mobj_data['college'];
    $degree = $aobj_context->mobj_data['degree'];
    $subject = $aobj_context->mobj_data['subject'];
    $sem = $aobj_context->mobj_data['sem'];
    
    
    if($college == 'All'){
        $con = "";
    }else{
        $con = "and pef.fcollcode='{$college}'";
    }
    
    if($sem == 'All'){
        $con1 = "";
    }else{
        $con1 = "AND mp.fexamno = '{$sem}'";
    }

    if($subject == 'All'){
        $con2 = "";
    }else{
        $con2 = "AND mp.fsubcode = '{$subject}'";
    }

    $query = "select pef.fbatch from practical_entry_freeze pef 
    inner join marks_pr mp on mp.fdegree = pef.fdegree and mp.FEXAMNO = pef.FEXAM 
    and mp.fsubcode = pef.fcsubcode and mp.fcollcode = pef.fcollcode
    where pef.fdegree = '{$degree}' $con
    $con2 $con1
    group by pef.fcsubcode,pef.fbatch";

    $result = $aobj_context->pobj_db->GetAll($query);
            
    if($result)
    {
    echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
    }
    else
    {
    $arr['msg'] = 'No Batch Create';
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 	
    }
}

function viewPracticalMarks($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $college = $aobj_context->mobj_data['college'];
    $degree = $aobj_context->mobj_data['degree'];
    $subject = $aobj_context->mobj_data['subject'];
    $sem = $aobj_context->mobj_data['sem'];
    $regfrm = $aobj_context->mobj_data['regfrm'];
    $regto = $aobj_context->mobj_data['regto'];
    $batch = $aobj_context->mobj_data['batch'];
    $user_type = $aobj_context->mobj_data['usertype'];
   
    // var_dump($user_type);
    // die();
    
    if($college == 'All'){
        $con = "";
    }else{
        $con = "AND m.fcollcode='{$college}'";
    }
    
    if($sem == 'All'){
        $con1 = "";
    }else{
        $con1 = "AND m.fexamno = '{$sem}'";
    }

    if($subject == 'All'){
        $con2 = "";
    }else{
        $con2 = "AND m.fsubcode = '{$subject}'";
    }
   
    if($batch == 'All'){
        $con3 = "";
    }else{
        $con3 = "AND pf.fbatch = '{$batch}'";
    }

    if($user_type == '100' || $user_type == '300' || $user_type == '301' || $user_type == '302' || $user_type == '303' ){
        $con4 = "ELSE m.fmarks11";
    }else{
        $con4 = "WHEN m.fmarks11 = m.fmarks11 THEN '*'";
    }

    $query = "SELECT s.fname, s.fregno,sub.fexamno,sub.fsubname,IFNULL (pf.fbatch,'') AS fbatch,
    (CASE
    WHEN m.fmarks11 = '-1' THEN 'Not Entry'
    WHEN m.fmarks11 = '-2' THEN 'AB'
    $con4
    END) AS fmarks,
    DATE_FORMAT(pf.fexamdate, '%d/%m/%Y') AS fdate,fexamtime
    FROM marks_pr m INNER JOIN student s ON  m.fregno = s.fregno AND m.fdegree = s.fdegree AND 			m.fcollcode = s.fcollcode
    INNER JOIN practical_entry_freeze pf ON m.fdegree = pf.fdegree AND m.fbatch = pf.fbatch
    AND m.fsubcode = pf.fcsubcode AND m.fexamno = pf.fexam
    INNER JOIN subject sub ON m.fdegree = sub.fdegree AND m.fsubcode = sub.fcsubcode 
	AND m.fexamno = sub.fexamno
    WHERE m.fdegree = '{$degree}' $con $con2 
    $con1 $con3  
    AND m.fregno BETWEEN '{$regfrm}' AND '{$regto}'
	order by m.fcollcode,m.fdegree,.m.fsubcode,m.fregno,m.fbatch";

    // var_dump($query);
    // die();

    $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"); 	
    }
}
?>