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


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

<?php

function getBatchWisePracticalDegree($aobj_context){
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$collcode = $_SESSION['collcode'];
	$userID = $_SESSION['user_id'];
	$teachcode = $_SESSION['usr'];
// var_dump($_SESSION);
	$query = "select * from s_sysdb where internal_code = '{$userID}'";
	$res = $aobj_context->mobj_db->GetRow($query);
	$user_type = $res['user_type'];
	$super_wiser = $res['super_wiser'];							

	if($super_wiser == 'T'){
		$cont = "";
	}else{
		if($_SESSION['FUNIVCODE'] !== '021'){
			$cont = "and a.fteachcode = '{$teachcode}'";
		}
	}

	$join = "inner join attendsum a on d.fdegree = a.fdegree
	         $cont"; 
	if($user_type =='40' || $user_type =='14')
		$join = "";

	
	$query = "SELECT d.fdegree, d.fdescpn FROM degree d 
              INNER JOIN student c ON d.fdegree = c.fdegree  
              {$join}
              WHERE c.fcollcode = '{$collcode}' 
              AND IFNULL(d.fdeleted ,'') <> 'T' 
              group by d.fdegree;";
			//  var_dump($query);
	$result = $aobj_context->mobj_db->GetAll($query);

		if($result){
			echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
		}else{
			$data = 'Fail to load degree';
			echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
		}  
}

function getBatchWisePracticalSemister($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$collcode = $_SESSION['collcode'];
	$userID = $_SESSION['user_id'];
	$teachcode = $_SESSION['usr'];
    $degree = $aobj_context->mobj_data["degree"];

    $query = "SELECT d.fexamname, d.fexamno FROM degree d 
              inner join colldeg c on d.fdegree = c.fdegree
              WHERE d.fdegree = '{$degree}' and c.fcollcode = '{$collcode}'
              GROUP BY d.fexamno";
	$result = $aobj_context->mobj_db->GetAll($query);  

    if($result){
		echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
	}else{
		$data = 'Fail to load semester';
		echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
	}  
}

function getBatchWisePracticalSubject($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$collcode = $_SESSION['collcode'];
	$userID = $_SESSION['user_id'];
	$teachcode = $_SESSION['usr'];
    $degree = $aobj_context->mobj_data["degree"];
    $sem = $aobj_context->mobj_data["sem"];
    $query = "select * from attendsum where fteachcode = '{$teachcode}'";
    $result = $aobj_context->mobj_db->GetRow($query);
    $teacode = $result['fteachcode'];
    if(strtoupper($teachcode) == strtoupper($teacode)){
        $qry = "SELECT fcsubcode, s.fsubname FROM subject s 
                INNER JOIN attendsum a ON s.fdegree = a.fdegree AND s.fexamno = a.fexamno
                and s.fcsubcode = a.fsubcode
                WHERE a.fteachcode = '{$teachcode}' AND a.fdegree = '{$degree}'
                GROUP BY a.fsubcode
                order by s.fsubname";
    }else{
        $qry = "SELECT fcsubcode, 
                s.fsubname FROM subject s INNER JOIN attendsum a 
                ON s.fdegree = a.fdegree AND s.fexamno = a.fexamno 
                and s.fcsubcode = a.fsubcode  inner join marks_pr m 
                on s.fdegree = m.fdegree and s.fcsubcode = m.fsubcode 
                where m.fdegree = '{$degree}' and m.fexamno = '{$sem}'
                and m.fcollcode = '{$collcode}' 
                GROUP BY s.fsubcode;";
    }
    $result_ = $aobj_context->mobj_db->GetAll($qry);  
    if($result_){
        echo $aobj_context->mobj_output->ToJSONEnvelope($result_,0,"success"); 
    }else{
        $data = 'Fail to load subject';
		echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
    }
}

function getBatchWiseValMax($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$collcode = $_SESSION['collcode'];
	$userID = $_SESSION['user_id'];
	$teachcode = $_SESSION['usr'];
    $degree = $aobj_context->mobj_data["degree"];
    $sem = $aobj_context->mobj_data["sem"];
    $subject = $aobj_context->mobj_data["subject"];

    $query = "SELECT fcsubcode, 
                s.fsubname, s.fvalmax FROM subject s INNER JOIN attendsum a 
                ON s.fdegree = a.fdegree AND s.fexamno = a.fexamno 
                and s.fcsubcode = a.fsubcode  inner join marks_pr m 
                on s.fdegree = m.fdegree and s.fcsubcode = m.fsubcode 
                where m.fdegree = '{$degree}' and m.fexamno = '{$sem}'
                and s.fcsubcode = '{$subject}'
                and m.fcollcode = '{$collcode}' 
                GROUP BY s.fsubcode;";
    $result_ = $aobj_context->mobj_db->GetRow($query); 
    if($result_){
        echo $aobj_context->mobj_output->ToJSONEnvelope($result_,0,"success"); 
    }else{
        $data = 'Fail to get Maxmarks';
		echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
    }
}

function GetVivaSubjectDetailsPractical($aobj_context)
{
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
    $degcode = $aobj_context->mobj_data["degcode"];
    $subcode = $aobj_context->mobj_data["subcode"];
    $exam_no = $aobj_context->mobj_data["exam_no"];
    $collcode = $_SESSION['collcode'];

    $query = "SELECT fcsubcode, 
                s.fsubname, s.fvalmax FROM subject s INNER JOIN attendsum a 
                ON s.fdegree = a.fdegree AND s.fexamno = a.fexamno 
                and s.fcsubcode = a.fsubcode  inner join marks_pr m 
                on s.fdegree = m.fdegree and s.fcsubcode = m.fsubcode 
                where m.fdegree = '{$degcode}' and m.fexamno = '{$exam_no}'
                and s.fcsubcode = '{$subcode}'
                and m.fcollcode = '{$collcode}' 
                GROUP BY s.fsubcode;";
                
    $result_ = $aobj_context->mobj_db->GetRow($query); 
 	
    $qry="select pm.FVVCODE,s.FSUBNAME,fvalmax as fsmaxmarks from practical_master pm
		 inner join subject s on s.FEXAMNO=pm.FEXAMNO		
		and
		s.FDEGREE=pm.FDEGREE
		and 
		s.FCSUBCODE=pm.FVVCODE
		 where pm.FDEGREE='{$degcode}' and pm.FEXAMNO='{$exam_no}' and pm.FPRCODE='{$subcode}' and pm.FVVCODE!=''";
	
    $lobj_rs = $aobj_context->mobj_db->GetRow($qry);     
	
	if($result_)	
	{   $arr['valmax'] = $result_;
        $arr['viva'] = $lobj_rs;
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
		return;
	}
	else
	{
		$err_data="No Viva Subject"; 
		echo $aobj_context->mobj_output->ToJSONEnvelope($err_data,-1,"Failure"); 
		return;
	}
}

function getBatchWisePracticalSubjectLastDate($aobj_context)
{
	session_start();	
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$college_code = $_SESSION['collcode'];
	
	$screen_type = trim($aobj_context->mobj_data["screen_type"]);

	$examno = trim($aobj_context->mobj_data["examno"]);
	$degree = trim($aobj_context->mobj_data["degree"]); 

    $qry = "SELECT fcsubcode, 
                s.fsubname FROM subject s INNER JOIN attendsum a 
                ON s.fdegree = a.fdegree AND s.fexamno = a.fexamno 
                and s.fcsubcode = a.fsubcode  inner join marks_pr m 
                on s.fdegree = m.fdegree and s.fcsubcode = m.fsubcode 
                where m.fdegree = '{$degree}' and m.fexamno = '{$examno}'
                and m.fcollcode = '{$college_code}' 
                GROUP BY s.fsubcode;";
    $result_ = $aobj_context->mobj_db->GetAll($qry);                
	
	if($screen_type == 'IAM')
		$lstr = "ifnull(FIAFROM,'1990-01-01') AND ifnull(FIATO,'1990-01-01')";
	else if($screen_type == 'PR')
		$lstr = "ifnull(FPRFROM,'1990-01-01') AND ifnull(FPRTO,'1990-01-01')";
	else if($screen_type == 'ADM')
		$lstr = "ifnull(FADMFROM,'1990-01-01') AND ifnull(FADMTO,'1990-01-01')";
	else if($screen_type == 'EAF')
		$lstr = "ifnull(FAPPFROM,'1990-01-01') AND ifnull(FAPPTO,'1990-01-01')";
	else if($screen_type == 'HT')
		$lstr = "ifnull(FHTFROM,'1990-01-01') AND ifnull(FHTTO,'1990-01-01')";
	else if($screen_type == 'att')
		$lstr = "ifnull(fattfrom,'1990-01-01') AND ifnull(fattto,'1990-01-01')";
	$query = "select sum(case when DATE_FORMAT(NOW(),'%Y-%m-%d') not between {$lstr} then 1 else 0 end) as flastdate,
	fsuspend from collexam where fcollcode = '{$college_code}' and fdegree = '{$degree}' and fexamno = '{$examno}' group by fsuspend";
	//var_dump($query);
	$result = $aobj_context->mobj_db->GetRow($query);
/* */
	if($result['fsuspend'] == 'T')
	{	
		$arr = "This degree is suspended temporarily";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure"); 
	}
	else  if(strtoupper($_SESSION['user_type'])=='SUPERUSER')
	{
		$arr = $result_;
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
	} 
	else if($result['flastdate'] > 0)
	{
		$arr = "Last date is over for the given details";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-2,"Failure");
	}
	
	else
	{
		$arr = $result_;
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
	}
}