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


Current Path : /proc/thread-self/root/var/www/html/univadmin_bkp/univadmin/src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/univadmin_bkp/univadmin/src/student.php

<?php

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

    $univcode = $aobj_context->mobj_data["univcode"];
    
    $studid = $aobj_context->mobj_data["studid"];
    date_default_timezone_set('Asia/Kolkata');
	$year =  date("Y");
	$month =  date("m");

	// select
	$query = "";
	$query = "select funivcode, ffolder, funivname, fdbname, fstaffmobileno, fgenmsgno
	from dbname 
	where funivcode = '{$univcode}'";
	$result = $aobj_context->mobj_db->GetRow($query);

	$db = $result['fdbname'];
    $funivname = $result['funivname'];
    $ffolder = $result['ffolder'];
    // var_dump($studid);

    if(strlen($studid) == 10)
        $cond = "fmobileno = '{$studid}' and funivcode = '{$univcode}'";
    else
        $cond = "fregno = '{$studid}' and funivcode = '{$univcode}'";

    $query = "select fmobileno, fregno, ifnull(femail,'') as femail, 
    date_format(fdob,'%d/%m/%Y') as fdob, funivcode,
    ifnull(fparentmob,'') as fparentmob from masuser 
    where {$cond} and instr(fusertype,'900')";
    // var_dump($query);
    $result = $aobj_context->mobj_db->GetRow($query);
        
    $fregno = $studid;    
    if(strlen($studid) == 10) 
        $fregno = $result['fregno'];
    
    $query = "select * from student where fregno = '{$fregno}'";
    // var_dump($query);
    $result1 = $aobj_context->pobj_db->GetRow($query);
    // var_dump($result1);
    if(count($result) > 0 || ( count($result1) > 0 &&  strlen($studid) < 10) )
    {
        $regno = $result1['FREGNO'];
        $result['ffolder'] = $ffolder;
        $query = "select distinct s.fregno, s.fname, ifnull(s.ffatname,'') as ffatname, ifnull(s.fmotname,'') as fmotname,
				s.fdegree, s.fcollcode,
                d.fdescpn as degree, d.fexamname, concat(d.fexamdate,' Examination') as fexamdate,
                concat(c.fcollname,', ',c.ftown, ' [', c.fcollcode, ']') as college,
                ifnull(s.fphotopath,'') as fphotopath,
                ifnull(date_format(s.fdob,'%d/%m/%Y'),'') as fdob,
                if(ifnull(fcaste,'') = '', 'GM',fcaste) as fcategory, 
                if(ifnull(s.fgender,'') = 'M','Male', 
                if(ifnull(s.fgender,'') = 'F', 'Female', '-')) as fgender,
                if(ifnull(fconstype,'') = '', 'Normal Fee', fconstype) as feetype,
                if(ifnull(fexamappblk,'No') = 'T','Yes','No') as examblk,
                if(ifnull(fappblock,'No') = 'T','Yes','No') as fappblock,
                if(ifnull(FMP,'No') = 'T','Yes','No') as fmp,
                ifnull(s.fstudid,'') as fstudid
                from student s inner join degree d on s.fdegree = d.fdegree
                inner join college c 
                on s.fcollcode = c.fcollcode
                where s.fregno = '{$regno}'
                group by s.fregno";
        $student_per = $aobj_context->pobj_db->GetRow($query);

        // var_dump($query);
        
        if( count($student_per) > 0) { 

            $res['masuser'] = $result;
            $res['student'] = $student_per;

            echo $aobj_context->mobj_output->ToJSONEnvelope($res,0,"success"); 
            return;
        }
        else {
            $arr['msg'] = 'Student Detail not found';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
            return;
        }
    }
    else
	{
				$arr['msg'] = 'Student Detail not found';
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
        return;
	}
}


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

	$univcode = $aobj_context->mobj_data["univcode"];
    $regno = $aobj_context->mobj_data["studid"];
    
	$query = "";
	$query = "select funivcode, funivname, fdbname, fstaffmobileno, fgenmsgno
	from dbname 
	where funivcode = '{$univcode}'";
	$result = $aobj_context->mobj_db->GetRow($query);

	$db = $result['fdbname'];
    $funivname = $result['funivname'];

    $query = "select de.fexamname, ifnull(su.fqpcode,'') as fqpcode, cd.fexamno, cd.fsubcode, 
    su.fsubname, ifnull(fpassmth,'') as fpassmth, 
    if(ifnull(finserted,'') = 'T','Yes', 'No') as finserted, 
    if(ifnull(fpresent,'') = 'P', 'Yes','No') as fpresent, ifnull(fhallno,'') as fhallno
    from canddet cd inner join  subject su on cd.fdegree = su.fdegree
    and cd.fexamno = su.fexamno and cd.fsubcode = su.fsubcode and su.ftheory = 'T' and su.fintass = 'F'
    inner join degree de on cd.fdegree = de.fdegree
    and cd.fexamno = de.fexamno 
    where cd.fregno = '{$regno}'
    order by fsubcode";
    // var_dump($query);
    $result = $aobj_context->pobj_db->GetAll($query);

    if($result)
    {
        $res['subject'] = $result;
        echo $aobj_context->mobj_output->ToJSONEnvelope($res,0,"success"); 
        return;
    }
    else
	{
		$arr['msg'] = 'Subject Details not found for the student';
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
        return;
	}
}

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

	$univcode = $aobj_context->mobj_data["univcode"];
    $regno = $aobj_context->mobj_data["regno"];
    
	$query = "";

    $query = "select ifnull(fappeara,'') as fappeara, ifnull(fexamfeea,'') as fexamfeea, 
    ifnull(fappearb,'') as fappearb, ifnull(fexamfeeb,'') as fexamfeeb, 
    ifnull(fappearc,'') as fappearc, ifnull(fexamfeec,'') as fexamfeec,
    ifnull(fappeard,'') as fappeard, ifnull(fexamfeed,'') as fexamfeed,
    ifnull(fappeare,'') as fappeare, ifnull(fexamfeee,'') as fexamfeee,
    ifnull(fappearf,'') as fappearf, ifnull(fexamfeef,'') as fexamfeef,
    ifnull(fappearg,'') as fappearg, ifnull(fexamfeeg,'') as fexamfeeg,
    ifnull(fappearh,'') as fappearh, ifnull(fexamfeeh,'') as fexamfeeh,
    ifnull(fappeari,'') as fappeari, ifnull(fexamfeei,'') as fexamfeei,
    ifnull(fappearj,'') as fappearj, ifnull(fexamfeej,'') as fexamfeej, 
    ifnull(frecptdate,'') as frecptdate, ifnull(ftotalfee,'') as ftotalfee, 
    fyear, fexamtype, fcntrcode, fcollname, ffreshexam, fhtblk, felig, fconstype 
    from candsum cs left join college cl on cs.fcntrcode = cl.fcollcode
    where fregno = '{$regno}'";

    // var_dump($query);
    $result = $aobj_context->pobj_db->GetRow($query);

    if(count($result) > 0)
    {
        $res['ech'] = $result;
        echo $aobj_context->mobj_output->ToJSONEnvelope($res,0,"success"); 
        return;
    }
    else
	{
		$arr['msg'] = 'Candidate Summary not found for the student';
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
        return;
	}
}

function getStudentExamApplications($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
    $regno = $aobj_context->mobj_data["studid"];

    $query = "select appno, date_format(fdate,'%d/%m/%Y') as fdate, 
    if(fpaymentype = 'Other Banks', ifnull(fpaygateway,''), fpaymentype) as fpaymentype, ftotalfee, 
    ifnull(fackdate,'') as fackdate, ifnull(fackuser,'') as fackuser, 
    ifnull(fpaymentstatus,'') as fpaymentstatus,
    ifnull(fpaygateway,'') as fpaygateway, ifnull(forderid,'') as forderid from appcandsum
    where fregno = '{$regno}' order by fpaymentstatus desc";
    $result = $aobj_context->pobj_db->GetAll($query);

    if(count($result) > 0)
    {
        $res['examApp'] = $result;
        echo $aobj_context->mobj_output->ToJSONEnvelope($res,0,"success"); 
        return;
    }
    else
	{
		$arr['msg'] = 'Exam Application not found for the student';
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
        return;
	}
}

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

    $regno = $aobj_context->mobj_data["studid"];

    $query = "select m.fsubcode, s.fsubname, s.fssubname, s.fsmaxmarks, 
    if(m.fmarks='-2', 'Ab.',if(m.fmarks='-1', 'Pend.', '*')) as fmarks,
    ifnull(m.fpresent,'') as fpresent, 
    ifnull(m.flogname,'') as flogname, ifnull(flogdate,'') as flogdate
    from marks m inner join subject s on m.fdegree = s.fdegree and m.fexamno = s.fexamno
    and m.fsubcode = s.fcsubcode where m.fregno = '{$regno}'";
    $result = $aobj_context->pobj_db->GetAll($query);

    if(count($result) > 0)
    {
        $res['iamarks'] = $result;
        echo $aobj_context->mobj_output->ToJSONEnvelope($res,0,"success"); 
        return;
    }
    else
	{
		$arr['msg'] = 'IA Marks not found for the student';
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
        return;
	}
}

function getExamno($aobj_context){

	$univcode = $aobj_context->mobj_data["univcode"];
    $regno = $aobj_context->mobj_data["regno"];

    $query = "SELECT DISTINCT fexamno FROM res_fee WHERE fregno = '{$regno}'";
    $result = $aobj_context->pobj_db->GetAll($query);
    // var_dump($query);
    // var_dump($result);
    if(count($result) > 0)
    {
        echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
        return;
    }
    else
	{
        echo $aobj_context->mobj_output->ToJSONEnvelope($result,-1,"failure");
        return;
	}
}

function getResults($aobj_context){

    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 

	$univcode = $aobj_context->mobj_data["univcode"];
    $regno = $aobj_context->mobj_data["regno"];
    $exam = $aobj_context->mobj_data["examno"];

    $query = "select if(FSUBSIDARY = 'T',concat(s.FSUBNAME,' **'),s.FSUBNAME) as FSUBNAME,s.FLTP,
    sum(s.FSMAXMARKS) as FSMAXMARKS,
    if(FTHUE='','-',FTHUE) as FTHUE ,
    if(FPRUE='','-',FPRUE) as FPRUE ,
    if(FTHVV='','-',FTHVV) as FTHVV ,
    if(FPRVV='','-',FPRVV) as FPRVV,
    if(FTHIA='','-',FTHIA) as FTHIA,
    if(FPRIA='','-',FPRIA) as FPRIA,
    if(FTHTOT='','-',FTHTOT) as FTHTOT,
    if(FPRTOT='','-',FPRTOT) as FPRTOT,
    if(FTHPASSMTH='','-',FTHPASSMTH) as FTHPASSMTH,
    if(FPRPASSMTH='','-',FPRPASSMTH) as FPRPASSMTH,
    if(FCREDITS = '','-',FCREDITS) as FCREDITS,
    if(ifnull(FGP,'') = '','-',FGP) as FGP,
    if(ifnull(FCP,'') = '','-',FCP) as FCP,
    if(ifnull(FGRADE,'') = '','-',FGRADE) as FGRADE,
    if(ifnull(FSGPA,'') = '','-',FSGPA) as FSGPA,
    if(ifnull(FCGPA,'') = '','-',FCGPA) as FCGPA,
    FMAXMARKS,FTOTMARKS,FPREVMAX,FPREVTOT,FPERCENT,FCLASS,FMCNUMBER,FYEAR,FEXAMTYPE, FSCHEME
    from resmarks rm
    inner join subject s on s.FDEGREE=rm.FDEGREE
    and s.FEXAMNO=rm.FEXAMNO and s.FSUBCODE=rm.FSUBCODE 
    where rm.FREGNO='{$regno}' and 
    rm.FEXAMNO='{$exam}'
    group by s.FSUBCODE";
    // var_dump($query);
    $result = $aobj_context->pobj_db->GetAll($query);
    // var_dump($result);
    $title1 = array();
    $send_data = array();
    $final_data = array();
    $marks = "";
    if(count($result) > 0)
    {
        $FSCHEME = $result[0]['FSCHEME'];
        if($FSCHEME == 'CR')
          {
              //$w      = array('5','50','5','8','8','8','8','10');
                      
              if($univcode == '023' || $univcode == '035')
              {
                  
                  $title1 = ['SlNo','SubjectName',
                  "Th_Pr",
                  'UnivExam',
                  'Viva',
                  'IA',
                  'Total',
                  "CreditHrs",
                  "GradePoints",
                  "CreditPoints",
                  'Remarks'];

              }else
              {
                  $title1 = ['SlNo','SubjectName',
                  "Th_Pr",
                      "UnivExam",
                      "CreditHrs",
                      "GradePoints",
                      "CreditPoints",
                      'Remarks'];

              }	
                  
              $w      = ['5','50','5','8','8','8','8','8','8','8','10'];
              
          }else
          {		
              $title1 = ['SlNo','SubjectName',
              "Th_Pr",
              'UnivExam',
              'Viva','IA',
              'Total',
              'Remarks'];
              $w      = ['5','50','5','8','8','8','8','10'];
          }

        $FMAXMARKS = $result[0]['FMAXMARKS'];
        $FTOTMARKS = $result[0]['FTOTMARKS'];
        $FPREVMAX  = $result[0]['FPREVMAX'];
        $FPREVTOT  = $result[0]['FPREVTOT'];
        $FPERCENT  = $result[0]['FPERCENT'];
        $FCLASS    = $result[0]['FCLASS'];
        $FMCNUMBER = $result[0]['FMCNUMBER'];
        $FYEAR     = $result[0]['FYEAR'];
        $FEXAMTYPE = $result[0]['FEXAMTYPE'];	
        $FSCHEME   = $result[0]['FSCHEME'];	
        
        $sl_no=0;
        foreach($result as $k=>$v)
        {
            $sl_no++;
            $FSUBNAME   = $v['FSUBNAME'];
            $FSMAXMARKS = $v['FSMAXMARKS']; 
            $FLTP       = $v['FLTP'];
            $FTHUE      = $v['FTHUE'];
            $FPRUE      = $v['FPRUE'];
            $FTHVV      = $v['FTHVV'];
            $FPRVV      = $v['FPRVV'];
            $FTHIA      = $v['FTHIA'];
            $FPRIA      = $v['FPRIA'];
            $FTHTOT     = $v['FTHTOT'];
            $FPRTOT     = $v['FPRTOT'];
            $FGRADE     = $v['FGRADE']; 
            $FTHPASSMTH = trim($v['FTHPASSMTH']);
            $FPRPASSMTH = trim($v['FPRPASSMTH']);

            $FTHPASSMTH = preg_replace("/[^A-Za-z0-9+-]/","",$FTHPASSMTH); 
            $FPRPASSMTH = preg_replace("/[^A-Za-z0-9+-]/","",$FPRPASSMTH); 

            $FEXAMNO       = $v['FEXAMNO'];
            $FEXAMNAME     = $v['FEXAMNAME'];
            $FRESULTDATE   = $v['FRESULTDATE'];
            $FRESULTSCHEME = $v['FRESULTSCHEME'];
            $FCREDITS      = $v['FCREDITS'];
            $FGP           = $v['FGP'];
            $FCP           = $v['FCP'];
            $FSGPA         = $v['FSGPA'];
            $FCGPA         = $v['FCGPA'];

            if($FTHUE != "-" && $FPRUE != "-")
            {
                $mthprue  = "Th. </br>Pr.";
                $uni_exam = "{$FTHUE}</br> {$FPRUE}";

                // $mthprue  = GetTdData("Th.","Pr.");
                // $uni_exam = GetTdData($FTHUE,$FPRUE);
            }
            else if($FTHUE != "-")
            {
                $mthprue  = "Th.";
                $uni_exam = "{$FTHUE}";

                // $mthprue  = GetTdData("Th.","");
                // $uni_exam = GetTdData($FTHUE,"");
            }
            else
            {
                $mthprue  = "Pr.";
                $uni_exam = "{$FPRUE}";
                // $mthprue  = GetTdData("Pr.","");
                // $uni_exam = GetTdData($FPRUE,"");
            }
            
            if($univcode=='018')
            {
                $mthprue = "-";
            }

                #########viva$########
            if($FTHVV!="-" && $FPRVV!="-")
            {
                if(empty($FPRVV))
                    $viva_exam = $FTHVV;
                else
                    $viva_exam = $FPRVV;
            }
            else if($FTHVV!="-")
            {
                $viva_exam = $FTHVV;
            }
            else
            {
                $viva_exam = $FPRVV; 
            }
                #########IA########
            if($FTHIA!="-" && $FPRIA!="-")
            {
                if(empty($FPRIA))
                    $ia_exam = $FTHIA;
                else
                    $ia_exam = $FPRIA;

            }
            else if($FTHIA != "-")
            {
                $ia_exam = $FTHIA;
            }
            else
            {
                $ia_exam = $FPRIA;  
            }
                #########TOTAl########
            if($FTHTOT!="-" && $FPRTOT!="-")
            {
                if(empty($FPRTOT))
                    $total = $FTHTOT;
                else
                    $total = $FPRTOT;
            }
            else if($FTHTOT != "-")
            {
                $total= $FTHTOT;
            }else
            {
                $total= $FPRTOT; 
            }
                #########Remarks########
            if($univcode == '018')
            {
                $FPRPASSMTH="";
            }
            if(strtolower($FTHPASSMTH) == strtolower($FPRPASSMTH))
            {
                $remarks = $FTHPASSMTH; 
            }
            else if(strtolower($FTHPASSMTH)=="pass" && strtolower($FPRPASSMTH)=="pass")
            {
                $remarks = "Pass"; 
            }
            else if(strtolower($FTHPASSMTH)=="fail" && strtolower($FPRPASSMTH)=="fail")
            {
                $pass_color = "red;";
                $remarks    = "Fail"; 
            }
            else if(strtolower($FTHPASSMTH)!="-" && strtolower($FPRPASSMTH)=="-")
            {
                $remarks  = $FTHPASSMTH; 
            }
            else if(strtolower($FTHPASSMTH)=="-" && strtolower($FPRPASSMTH)!="-")
            {
                $remarks  = $FPRPASSMTH; 
            }else
            {
                if(empty($FPRPASSMTH))
                    $remarks = $FTHPASSMTH;
                else
                    $remarks = $FPRPASSMTH;
                // return $remarks;
            }
                //--remarks--//
            $send_data['sl_no'] = $sl_no;
            $send_data['subject'] = $FSUBNAME;

            if($univcode == '040'){
                $send_data['mthprue'] = $mthprue;
                $send_data['uni_exam'] = $FLTP; 
                $send_data['viva_exam'] = $viva_exam; 
                $send_data['ia_exam'] = $ia_exam; 
                $send_data['thtot'] = $total;
            }else
            {
                $send_data['mthprue'] = $mthprue;
                $send_data['uni_exam'] = $uni_exam; 
                $send_data['viva_exam'] = $viva_exam; 
                $send_data['ia_exam'] = $ia_exam; 
                $send_data['thtot'] = $total;
            }

            if($univcode == '035' || $univcode == '039' || $univcode == '023')
            {	
                if($FSCHEME == 'CR')
                {	
                    $send_data['FCREDITS'] =$FCREDITS;
                    $send_data['FGP'] =$FGP;
                    $send_data['FCP'] =$FCP;
                }
            }
            $send_data['remarks']= $remarks;

            if(($univcode == '035' || $univcode == '039' || $univcode == '023') && $FSCHEME == 'CR')
			{	
				if($FCLASS == 'Fail, Promoted')
					$result =$FCLASS;//grade
				else
					$result = $FCLASS;
			}else
                $result = $FCLASS;
                
            $send_data['result'] = $result;
            
			if($FSCHEME != 'CR' || ($univcode == '035' || $univcode == '039' || $univcode == '023')){
                $send_data['FMAXMARKS'] = $FMAXMARKS;
                $send_data['FTOTMARKS'] = $FTOTMARKS;
            }
            if($FSCHEME == 'CR')
			{	
				if($FCGPA != '0.00'){
                    $send_data['FCGPA'] = $FCGPA;
                    $send_data['FSGPA'] = $FSGPA;
                }
			}else
                $send_data['FPERCENT'] = $FPERCENT;

            if($FPREVMAX != "0000" && !empty($FPREVMAX))
                $send_data['FPREVMAX'] = $FPREVMAX; $send_data['FPREVTOT'] = $FPREVTOT;
        $send_data['FSCHEME'] =$FSCHEME;
        array_push($final_data,$send_data);
    }


    $res['headers'] = $title1;
    $res['body'] = $final_data;
    echo $aobj_context->mobj_output->ToJSONEnvelope($res,0,"success"); 
    return;
}
    else
	{
        echo $aobj_context->mobj_output->ToJSONEnvelope($result,-1,"failure");
        return;
	}
}

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

	$univcode = $aobj_context->mobj_data["univcode"];
    $regno = $aobj_context->mobj_data["regno"];
    $exam = $aobj_context->mobj_data["examno"];

    $query = "select s.FSUBNAME,  rm.fsubcode, rm.fssubname, rm.fmarks, rm.fyear, rm.fexamtype
    from resmarksdet rm left join subject s on s.FDEGREE = rm.fdegree
    and s.FEXAMNO = rm.fexamno and s.FCSUBCODE = rm.fsubcode
    where fregno = '{$regno}' and rm.fexamno = '{$exam}'
    order by s.fsubcode, s.fssubcode";
    $result = $aobj_context->pobj_db->GetAll($query); 
    // var_dump($query);
    // var_dump($result);
    if(empty($result))
    {
        echo $aobj_context->mobj_output->ToJSONEnvelope($result,-1,"failure"); 
        return;	
    }
    $final_arr=array();

    foreach($result as $k=>$v)
    {
        $FSUBNAME=$v['FSUBNAME'];
        $fssubname=$v['fssubname'];
        $fmarks=$v['fmarks'];
        $fsubcode=$v['fsubcode'];

        $final_arr[$FSUBNAME][$fsubcode]['s']=$fssubname;
        $final_arr[$FSUBNAME][$fsubcode]['m']=$fmarks;

    }

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


function stuRegRemove($aobj_context){

    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 

	$univcode = $aobj_context->mobj_data["univcode"];
    $regno = $aobj_context->mobj_data["studid"];

    $query = "select m.fregno, m.funivcode, p.fname, m.fmobileno, m.femail,
    m.fdob from masuser m inner join pushstud p 
    on m.funivcode = p.funivcode and m.fregno = p.fregno 
    where m.fregno = '{$regno}' and m.funivcode = '{$univcode}'";
    $result = $aobj_context->mobj_db->GetAll($query); 
    // var_dump($query);
    // var_dump($result);
    if(empty($result))
    {
        $msg = "Failed to get student details";
        echo $aobj_context->mobj_output->ToJSONEnvelope($msg,-1,"failure"); 
        return;	
    }
    
    echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 

}

function delStudReg($aobj_context){

    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 

	$univcode = $aobj_context->mobj_data["univcode"];
    $regno = $aobj_context->mobj_data["regno"];

    $query = "select FMOBILENO,FMOBILEOTP,FMOBOTPTIME,FOTPCOUNTER,FMOBILEVALID,FEMAIL,FEMAILOTP,FEMAILOTPTIME,FEMAILHASH,
    FEMAILVALID,FREGNO,FDOB,FADHARNO,FPARENTMOB,FPASSWD,FUNIVCODE,FACTIVE,FRESETOTP,FRESETOTPTIME,FRESETOTPCOUNT,FAPPMOBID,FUPDTIME, now(), 'univadm' from masuser 
    where fregno = '{$regno}' and funivcode= '{$univcode}'";
    $res = $aobj_context->mobj_db->GetRow($query); 
    
    if($res)
    {
        $query = "insert into masuser_del (FMOBILENO,FMOBILEOTP,FMOBOTPTIME,FOTPCOUNTER,FMOBILEVALID,FEMAIL,FEMAILOTP,FEMAILOTPTIME,FEMAILHASH,
        FEMAILVALID,FREGNO,FDOB,FADHARNO,FPARENTMOB,FPASSWD,FUNIVCODE,FACTIVE,FRESETOTP,FRESETOTPTIME,FRESETOTPCOUNT,FAPPMOBID,FUPDTIME,FDELETETIME,FDELETEUSER)
        select FMOBILENO,FMOBILEOTP,FMOBOTPTIME,FOTPCOUNTER,FMOBILEVALID,FEMAIL,FEMAILOTP,FEMAILOTPTIME,FEMAILHASH,
        FEMAILVALID,FREGNO,FDOB,FADHARNO,FPARENTMOB,FPASSWD,FUNIVCODE,FACTIVE,FRESETOTP,FRESETOTPTIME,FRESETOTPCOUNT,FAPPMOBID,FUPDTIME, now(), 'univadm' from masuser 
        where fregno = '{$regno}' and funivcode= '{$univcode}'";

        $result = $aobj_context->mobj_db->Execute($query);


        if(!$result)
        {
            $msg = "Student Removal Failedd. Please try again";
            echo $aobj_context->mobj_output->ToJSONEnvelope($msg,-1,"Failure"); 
            return;
        }
        
        $query = "delete from masuser
        where fregno = '{$regno}' and funivcode ='{$univcode}'";
        // var_dump($query);
        $results = $aobj_context->mobj_db->Execute($query);

        if(!$results)
        {
            $msg['msg'] = "Student Removal Failed1. Please try again";
            echo $aobj_context->mobj_output->ToJSONEnvelope($msg,-1,"Failure"); 
            return;
        }
        else
        {
            $msg['msg'] = "Deleted successfully.";
            echo $aobj_context->mobj_output->ToJSONEnvelope($msg,0,"success"); 
            return;
        }
    }else
    {
        $msg['msg'] = "Student Registration not done. Please try again";
        echo $aobj_context->mobj_output->ToJSONEnvelope($msg,-1,"Failure"); 
        return;
    }
}