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


Current Path : /var/www/html/dud/
Upload File :
Current File : /var/www/html/dud/student.php

<?php

function getcmsdropdownmenuvalues($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
	session_start();
	$COLLCODE = $_SESSION['FCOLLCODE'];
	$query = "select c.fcollcode as int_code, concat(c.fcollname,', ', c.FTOWN,' - ',c.fcollcode) as val from college c 
		where FCOLLCODE = '{$COLLCODE}' and ifnull(c.fdeleted,'') <> 'T' order by c.fcollname";
	$results = $aobj_context->mobj_db->GetAll($query);
	
	$arr['college'] = $results;
	
	$query3 = "SELECT FCATEGORY AS int_code,FDESCPN AS val FROM category 
	where ifnull(FDELETED,'') <> 'T' order by FCATEGORY asc ";
	$rst3 = $aobj_context->mobj_db->GetAll($query3);
	$arr['category'] = $rst3;
	
	$query4 = "select fboardcode as int_code, fboardname as val from masboard order by forder";
	 // var_dump($query4);
	$rst4 = $aobj_context->mobj_db->GetAll($query4);
	 // var_dump($rst4);
	$arr['boards'] = $rst4;


	$query = "select distinct  d.fdegree as int_code, concat(d.fdescpn,' - ',d.fdegree) as val from degree  d 
	where ifnull(d.fdeleted,'') <> 'T' and d.fexamno = 'A' and d.fadmdeg = 'T' 
	and fdegree = '{$_SESSION['FDEGREE']}' order by d.fdescpn";
	$results = $aobj_context->mobj_db->GetAll($query);
	$arr['degree'] = $results;

	$query = "SELECT  IFNULL(FCOLLCODE,'') AS idCollege, IFNULL(FDEGREE,'') AS idDegree,
	IFNULL(FNAME,'') AS idStudname, IFNULL(FFATNAME,'') AS idFatname,
	IFNULL(FMOTNAME,'') AS idMotname, IFNULL(FFAT_OCC,'') AS fatocc,
	IFNULL(FEMAIL,'') AS stuEmail, IFNULL(FDOB,'') AS idDob,
	IFNULL(FCASTE,'') AS idCategory, IFNULL(FBLOOD_GROUP,'') AS idBldgrp,
	IFNULL(FCONTACT_NO,'') AS stuMobileno, IFNULL(FNATIONAL,'') AS idNationality,
	IFNULL(FCURRADD1,'') AS cadd1, IFNULL(FCURRADD2,'') AS cadd2,
	IFNULL(FCURRADD3,'') AS cadd3, IFNULL(FCURRADD4,'') AS cadd4,
	IFNULL(FPERMADD1,'') AS padd1, IFNULL(FPERMADD2,'') AS padd2,
	IFNULL(FPERMADD3,'') AS padd3, IFNULL(FPERMADD4,'') AS padd4,
	IFNULL(FPHOTOPATH,'') AS studphoto, IFNULL(FRELIGION,'') AS idReligion,
	IFNULL(FCOMBCODE,'') AS idDegComb, IFNULL(fgender,'') AS gender,
	IFNULL(FCATBIRTH,'') AS idCaste, IFNULL(FMOBILE_NO,'') AS pmobileno,
	IFNULL(FSIGNPATH,'') AS studsign, IFNULL(FAADHARNO,'') AS adhar,
	IFNULL(FSTATE,'') AS fstate, IFNULL(FINCOME,'') AS income,
	IFNULL(FUNIVNAME,'') AS idUnvName, IFNULL(FQMONTH,'') AS idUnvPassMth,
	IFNULL(FQYEAR,'') AS idUnvPassYear, IFNULL(FAPPNO,'') AS fappno,
	IFNULL(FQPERCENTAGE,'') AS idUnvPerc, IFNULL(FQUALEXREGNO,'') AS idUnvRegno,
	IFNULL(FAREA,'') AS area, IFNULL(FQMAXMARKS,'') AS idUnvMaxMarks,
	IFNULL(FQSECMARKS,'') AS idUnvSecMarks, IFNULL(FTYPEQUALEXAM,'') AS idUnvExam,
	IFNULL(fcombcode,'') AS idDegComb, IFNULL(FPERDIST,'') AS pdistrict,
	IFNULL(FPERPINCODE,'') AS ppincode, IFNULL(FPERSATE,'') AS pstate,
	IFNULL(FCOMDIST,'') AS cdistrict, IFNULL(FCOMPINCODE,'') AS cpincode,
	IFNULL(FCOMSTATE,'') AS cstate
	FROM studadm WHERE FCONTACT_NO = '{$_SESSION['MOBILE']}'";

	$result = $aobj_context->mobj_db->GetRow($query);
		
	$arr['perdetl'] = $result;
	$arr['fmobileno'] = $_SESSION['MOBILE'];
	$arr['fdob'] = $_SESSION['FDOB'];
	$arr['fcollcode'] = $_SESSION['FCOLLCODE'];
	$arr['fdegree'] = $_SESSION['FDEGREE'];
	$arr['percnt'] = count($result);
	 

	echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
	return;

}

function getdegreedetails($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
	$college = $aobj_context->mobj_data["college"];

	$query = "select distinct  d.fdegree as int_code, concat(d.fdescpn,' - ',d.fdegree) as val from degree  d 
	where d.fexamno = 'A' and d.fadmdeg = 'T' and ifnull(d.fdeleted,'') <> 'T'
	order by d.fdescpn";
	$results = $aobj_context->mobj_db->GetAll($query);
	$arr['degree'] = $results;
	//
	echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
	return;
}


function getcombinationdetailsdetails($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
	$college = $aobj_context->mobj_data["college"];
	$degree = $aobj_context->mobj_data["degree"];

	$query = "select distinct  m.fcombcode as int_code, concat(m.fcombcode,' - ',m.FCOMBDESC) as val from mascomb m
	where m.fdegree = '{$degree}' and ifnull(m.fdeleted,'') <> 'T' order by m.fcombcode";
	$results = $aobj_context->mobj_db->GetAll($query);
	$arr['mascomb'] = $results;
	//
	echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
	return;
}

function getboarddetails($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
	$boardCode = $aobj_context->mobj_data["boardCode"];

	$query = "select fboardcode, fboardsate, fboardname, faddress, fphoneno 
	from masboard where fboardcode = '{$boardCode}' 
	order by forder";
	$results = $aobj_context->mobj_db->GetRow($query);
	$arr['boardDet'] = $results;
	//
	echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
	return;
}

function loadSubjectdet($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
	$degree = $aobj_context->mobj_data["degree"];
	$combcode = $aobj_context->mobj_data["combcode"];
	$query = "select FTOTSUB from degree where fdegree ='{$degree}' and fexamno = 'A'";
	$results = $aobj_context->mobj_db->GetRow($query);
	$totsub = $results['FTOTSUB'];

	$query = "SELECT fsubcode,fsubname,fsubshort  FROM degree d INNER JOIN subject s ON 
	s.FDEGREE=d.FDEGREE  AND  d.FEXAMNO=s.FEXAMNO
	WHERE d.FDEGREE='{$degree}' AND s.FEXAMNO='A' AND FMANDATORY='T' GROUP BY  s.FSUBCODE
	UNION
	SELECT s.FSUBCODE,s.FSUBNAME,s.FSUBSHORT  FROM degree d INNER JOIN subject s ON 
	s.FDEGREE=d.FDEGREE  AND  d.FEXAMNO=s.FEXAMNO
	LEFT JOIN mascomb m ON m.FDEGREE=d.FDEGREE AND m.fcombcode = '{$combcode}'
	WHERE d.FDEGREE='{$degree}'  AND m.FSUBCODE = s.FSUBCODE  
	GROUP BY  s.FSUBCODE";
	//var_dump($query);
	$mresults = $aobj_context->mobj_db->GetAll($query);
	$mtotalsub = count($mresults);

	$remaing = $totsub - $mtotalsub;

	$query = "select fsubcode,fsubname,fsubshort from subject 
	where fdegree = '{$degree}' 
	and fexamno = 'A' and ifnull(fmandatory,'F') = 'F' 
	and ifnull(fretain,'F') = 'F' and ifnull(fintass,'F') = 'F'
	and ifnull(fsuspend,'F') <> 'T' ";
	
	$rresults = $aobj_context->mobj_db->GetAll($query);

	$arr['totsub'] = $totsub;
	$arr['mresults'] = $mresults;
	$arr['mtotalsub'] = $mtotalsub;
	$arr['rresults'] = $rresults;
	$arr['remaing'] = $remaing;
	

	echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
	return;

}


function loadeditSubjectdet($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
	$degree = $aobj_context->mobj_data["degree"];
	$combcode = $aobj_context->mobj_data["combcode"];
	$appno = $aobj_context->mobj_data["appno"];
	$query = "select FTOTSUB from degree where fdegree ='{$degree}' and fexamno = 'A'";
	$results = $aobj_context->mobj_db->GetRow($query);
	$totsub = $results['FTOTSUB'];

	$query = "SELECT fsubcode,fsubname,fsubshort  FROM degree d INNER JOIN subject s ON 
	s.FDEGREE=d.FDEGREE  AND  d.FEXAMNO=s.FEXAMNO
	WHERE d.FDEGREE='{$degree}' AND s.FEXAMNO='A' AND FMANDATORY='T' GROUP BY  s.FSUBCODE
	UNION
	SELECT s.FSUBCODE,s.FSUBNAME,s.FSUBSHORT  FROM degree d INNER JOIN subject s ON 
	s.FDEGREE=d.FDEGREE  AND  d.FEXAMNO=s.FEXAMNO
	LEFT JOIN mascomb m ON m.FDEGREE=d.FDEGREE AND m.fcombcode = '{$combcode}'
	WHERE d.FDEGREE='{$degree}'  AND m.FSUBCODE = s.FSUBCODE  
	GROUP BY  s.FSUBCODE";
	//var_dump($query);
	$mresults = $aobj_context->mobj_db->GetAll($query);
	$mtotalsub = count($mresults);

	$remaing = $totsub - $mtotalsub;

	$query = "select fsubcode,fsubname,fsubshort from subject where fdegree = '{$degree}' 
	and fexamno = 'A' and ifnull(fmandatory,'F') = 'F' 
	and ifnull(fretain,'F') = 'F' and ifnull(fintass,'F') = 'F'
	and ifnull(fsuspend,'F') <> 'T' and fsubcode  not in (select fsubcode from mascomb where  
	fdegree = '{$degree}')";
	
	$rresults = $aobj_context->mobj_db->GetAll($query);

	$query = "select fsubcode from options where fappno = '{$appno}'";
	$option_sub = $aobj_context->mobj_db->GetAll($query);

	$arr['option_sub'] = $option_sub;
	$arr['totsub'] = $totsub;
	$arr['mresults'] = $mresults;
	$arr['mtotalsub'] = $mtotalsub;
	$arr['rresults'] = $rresults;
	$arr['remaing'] = $remaing;
	

	echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
	return;

}


function uploaddetails($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 

	$query = "select internal_code as int_code, 
	FCERTDESC as doc_type ,
	ifnull(FFILENAME,REPLACE(REPLACE(FCERTDESC,' ','_'),'+','_')) as FFILENAME
	from 
	masdoc order by forder";
	$results = $aobj_context->mobj_db->GetAll($query);
	$arr['masdoc'] = $results;

	echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
	return;
}

function uploadeditdetails($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
	
	$degree = $aobj_context->mobj_data["degree"];
	$fappno = $aobj_context->mobj_data["fappno"];
	$college = $aobj_context->mobj_data["college"];
	

	$query = "SELECT DISTINCT m.internal_code AS int_code, 
	FCERTDESC AS doc_type ,
	IFNULL(FFILENAME,REPLACE(REPLACE(FCERTDESC,' ','_'),'+','_')) AS FFILENAME,
	ifnull(s.file_path,'') as file_path
	FROM masdoc m
	LEFT JOIN studoc s 
	ON s.fdegree = m.fdegree AND login_cnt = '{$fappno}' AND s.fdoctype = m.FFILENAME 
	AND fcollcode = '{$college}'
	ORDER BY forder";
	$results = $aobj_context->mobj_db->GetAll($query);
	$arr['masdoc'] = $results;

	echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
	return;
}


function getstudentdetails($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
	session_start();
	
	$query = "SELECT cs.fmobileno, cs.femail, cs.fname, cs.fdob,
		CONCAT(dg.fdegree, ' - ', dg.fdescpn) AS fdegree,
		CONCAT('[', cl.fcollcode,'] ', cl.fcollname) AS college
		FROM collstud cs INNER JOIN college cl 
		ON cs.fcollcode = cl.fcollcode INNER JOIN degree dg 
		ON cs.fdegree = dg.fdegree 
		WHERE cs.fmobileno = '{$_SESSION['MOBILE']}'";
	$rst = $aobj_context->mobj_db->GetRow($query);
	
	$query = "select ifnull(ffinsub,'') as ffinsub from studadm where fcontact_no = '{$_SESSION['MOBILE']}'";
	$rst1 = $aobj_context->mobj_db->GetRow($query);
	
	$rst['ffinsub'] = $rst1['ffinsub'];
	if($rst)
	{
		echo $aobj_context->mobj_output->ToJSONEnvelope($rst,0,"success"); 
		return;			
	}		
	else
	{	
		$error_msg = 'Not a valid Register no.';
		echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"failure");
		return;	
	}				
}

function replaceChars($name)
{
	$spl_char = array("*","/","~","!","@","#","$","%","^","&",":",";","?","/","\\","_","-","'"," ","");
	$link_name = strtolower(str_replace($spl_char,"_",$name));
	return str_ireplace("__","_",$link_name);
}

function submitquery($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
	
	$fmessage = $aobj_context->mobj_data["fmessage"];
	$fsubject = $aobj_context->mobj_data["fsubject"];

	if($_SESSION['MOBILE'] != '')
	{	
		$query = "insert into grvhead(fsubject,
		fmessage,
		fusertype,
		funivcode,
		fuserid,
		femailid,fdate)
		values ('{$fsubject}','{$fmessage}','S','041',{$_SESSION['MOBILE']},'{$_SESSION['MOBILE']}',now())";
		//var_dump($query);
		$results = $aobj_context->mobj_db->Execute($query);	
		$last_inserted_id = $aobj_context->mobj_db->Insert_ID();
		if($results)
		{
			$msg = $last_inserted_id;
			echo $aobj_context->mobj_output->ToJSONEnvelope($msg,0,"success"); 
			return;			
		}		
		else
		{	
			$error_msg = 'Not able to submit the query. please try after some time.';
			echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"failure");
			return;	
		}

	}
	else
	{

		$error_msg = 'Please login to submit the query.';
		echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-2,"failure");
		return;
	}	
	
}

?>