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


Current Path : /proc/thread-self/root/var/www/html/admission/src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/admission/src/create_user.php

<?php
    include("sendGridMail.php");
    function save_CreateUser($aobj_context){
        $univcode = $aobj_context->mobj_data["univcode"];
        $name = $aobj_context->mobj_data["fullname"];
        $emailid = $aobj_context->mobj_data["emailid"];
        $password = $aobj_context->mobj_data["password"];
        $mobileno = $aobj_context->mobj_data["mobileno"];
        $fusertype = $aobj_context->mobj_data["fusertype"];
        $fuserdeg = $aobj_context->mobj_data["fuserdeg"];
        $fusercoll = $aobj_context->mobj_data["fusercoll"];
        $fsavetype = $aobj_context->mobj_data["fsavetype"];

        $fdeguser = explode(',', $fuserdeg);
        $fcolluser = explode(',', $fusercoll);

        if (in_array('All', $fcolluser)) {
            if (count($fcolluser) > 1) {
                $fcolluser = array_diff($fcolluser, ['All']);
            }
        }
        
        if (in_array('All', $fdeguser)) {
            if (count($fdeguser) > 1) {
                $fdeguser = array_diff($fdeguser, ['All']);
            }
        }
     
        $fcoll = implode('*',$fcolluser);
        $fdeg = implode('*',$fdeguser);
       
        if($fsavetype != "Edit"){
            $query = "select fusername from adm_masuser where fusername='{$emailid}'";
            $res = $aobj_context->pobj_db->GetAll($query);
            
            if(count($res) > 0){
                $arr['msg'] = "Email Id already Exist";
                echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
                return;
            }
            $query = "insert into adm_masuser(fname, fusername, fpassword, fmobileno,fusertype,
                    fcollcode,fdegree,fdeleted)
                    values('{$name}', '{$emailid}', '{$password}', '{$mobileno}','{$fusertype}',
                    '{$fcoll}','{$fdeg}','F')";
        }else{
            $query = "update adm_masuser set fname = '{$name}',fmobileno = '{$mobileno}',
            fusertype = '{$fusertype}',fcollcode = '{$fcoll}',fdegree = '{$fdeg}'
            where fusername = '{$emailid}'";
        }
        
        $res = $aobj_context->pobj_db->Execute($query);

        if($res){
            $arr['msg'] = "User created cuccessfully";
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success");
        }else{
            $arr['msg'] = "Failed to create user data";
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
            return;
        }
    }  
    
    function uploadLeadExcelData($aobj_context){
        require_once 'PHPExcel/Classes/PHPExcel/IOFactory.php';
        $univcode = $aobj_context->mobj_data["univcode"];
        $file = $_FILES['file']['tmp_name'];
        $file_name = $_FILES['file']['name'];
        $user = $_SESSION['MOBILE'];
        

        $folderpath = $aobj_context->main_src."uploads/";


        if(move_uploaded_file($file, 'uploads/'. $file_name)){
            $file = $aobj_context->main_src.'uploads/'.$file_name;

            if(!file_exists($file)){
                $data = "Upload failure. Upload file does not exist";
				echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1, "failure"); 
				return;
            }else{

                $query1 = "drop table if exists tmplead";
                $result1 = $aobj_context->pobj_db->Execute($query1);

                $query2 = "create table tmplead select * from adm_lead where 1=2";
                $result2 = $aobj_context->pobj_db->Execute($query2);

                $query3 = "alter table tmplead add primary key(fleadid auto_increment)";
                $result3 = $aobj_context->pobj_db->Execute($query3);

                $query4 = "alter table tmplead CHANGE fleadid fleadid int(11) NOT NULL AUTO_INCREMENT;";
                $result4 = $aobj_context->pobj_db->Execute($query4);

                $csvFile = $file;
                $handle = fopen($csvFile, "r");

                if ($handle === false) {
                    die("Error opening file");
                }

                $columns = ['fname', 'fmobile', 'femail', 'fdeggrp', 'fdegree', 'fstate', 'fdistrict', 'fadmyear', 'fleadsource', 'fcreateuser', 'fleadfilename', 'fcreateddate', 'ftype'];

                $i=0;
                while (($data = fgetcsv($handle)) !== false) {
                    $values = implode("', '", $data);
                    $explode = explode(",", $values);

                    // var_dump($explode);die();
                    if($explode[0] != "'" && $explode[1] != " ''"){
                        if($i != 0){
                        
                            $sql = "INSERT INTO tmplead (" . implode(", ", $columns) . ") VALUES ('$values', '{$user}', '{$file_name}', now(), 'Registered')";
                            $result = $aobj_context->pobj_db->Execute($sql);
                        }
                    }
                    $i++;
                }

                if($result){

                    $query4 = "update tmplead set femail = null where femail = ''";
                    $result4 = $aobj_context->pobj_db->Execute($query4);

                    $query5 = "insert ignore into adm_lead
                                select * from tmplead";
                    $result5 = $aobj_context->pobj_db->Execute($query5);

                    if($result5){
                        unlink($file);
                        $data = "Upload success";
                        echo $aobj_context->mobj_output->ToJSONEnvelope($data,0,"success"); 
                        return;	
                    }else{
                        $data = "Upload failure. Error while loading excel data to database";
                        echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
                        return;
                    }
                }else{
                    $data = "Upload failure. Error while loading excel data to database";
                    echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
                    return;
                }   
            }
        };  
        
    }

    function getStates($aobj_context){
        $univcode = $aobj_context->mobj_data["univcode"];
        $query = "select fid, fname from adm_state order by fname";
        $result = $aobj_context->pobj_db->GetAll($query);

         if($result){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success"); 
            return;
        }else{
            $data = "failed to get states";
            echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1, "failure"); 
            return;
        }

    }

    function getDistricts($aobj_context){
        $univcode = $aobj_context->mobj_data["univcode"];
        $stateid = $aobj_context->mobj_data["stateid"];

        if($stateid == "" || $stateid == "null" || $stateid == "undefined"){
            $cnd = "";
        }else{
            $cnd = "where fstateid = '{$stateid}';";
        };

        $query = "select fid, fdistrict from adm_district $cnd";
        $result = $aobj_context->pobj_db->GetAll($query);

         if($result){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success"); 
            return;
        }else{
            $data = "failed to get districts";
            echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1, "failure"); 
            return;
        }

    }

    function change_password($aobj_context){
        $univcode = $aobj_context->mobj_data["univcode"];
        $oldpassword = $aobj_context->mobj_data["oldpassword"];
        $passwd = $aobj_context->mobj_data["passwd"];

        $username = $_SESSION['MOBILE'];

        $query = "select fpassword from adm_masuser where fpassword = '{$oldpassword}'
                  and fusername='{$username}'";
        $result = $aobj_context->pobj_db->GetRow($query);

        if($result['fpassword'] === $oldpassword){
            $upd = "update adm_masuser set fpassword = '{$passwd}' where fusername='{$username}'";
            $res = $aobj_context->pobj_db->Execute($upd);

            if($res){
                $data = "Password changed successfully";
                echo $aobj_context->mobj_output->ToJSONEnvelope($data, 0, "success"); 
                return;
            }else{
                $data = "failed to update password";
                echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1, "failure"); 
                return;
            }
        }else{
            $data = "Entered old password is not valid";
            echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1, "failure"); 
            return;
        }
    }
    
    function getCollDet($aobj_context){
        $univcode = $aobj_context->mobj_data["univcode"];
        $fusertype = $aobj_context->mobj_data["fusertype"];

        if($fusertype == 'CA'){
            $query = "select distinct ifnull(fcollcode,'') as fcolldeg,
            ifnull(fcollname,'') as fnamedeg from college";
        }else{
            $query = "select distinct ifnull(fdegree,'') as fcolldeg,
            ifnull(FDESCPN, '') as fnamedeg from degree";
        }
        
        $result = $aobj_context->pobj_db->GetAll($query);

        if($result){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success"); 
            return;
        }else{
            $data = "No Data";
            echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1, "failure"); 
            return;
        }
    }

    function get_Degree($aobj_context){
        $univcode = $aobj_context->mobj_data["univcode"];
        
        $query = "select distinct fdegree, fdescpn from degree order by fdegree";
        $result = $aobj_context->pobj_db->GetAll($query);

         if($result){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success"); 
            return;
        }else{
            $data = "failed to get degrees";
            echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1, "failure"); 
            return;
        }

    }

    function get_user($aobj_context){
        $univcode = $aobj_context->mobj_data["univcode"];
        $fuserid = $_SESSION['USERTYPE'];
        $username = $_SESSION['MOBILE'];
        if($fuserid != 'SA' && $fuserid != 'SU' && $fuserid != 'DU'){
            $cond = "where fusername = '{$username}'";
        }
        
        $query = "select fusername, fname from adm_masuser $cond order by fname";
        $result = $aobj_context->pobj_db->GetAll($query);

         if($result){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success"); 
            return;
        }else{
            $data = "failed to get users";
            echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1, "failure"); 
            return;
        }

    }

    function getUserDet($aobj_context){
        $univcode = $aobj_context->mobj_data["univcode"];
        
        $query = "select *,if(ifnull(fdeleted,'F') = 'T','F','T')as factiive
        from adm_masuser where ifnull(fusertype,'') <> 'AG' order by fname";
        $result = $aobj_context->pobj_db->GetAll($query);

         if($result){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success"); 
            return;
        }else{
            $data = "failed to get users";
            echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1, "failure"); 
            return;
        }

    }

    function userPerDet($aobj_context){
        $univcode = $aobj_context->mobj_data["univcode"];
        $fuserid = $aobj_context->mobj_data["fuserid"];
        $usertype = $_SESSION["USERTYPE"];

        $que = "select * from adm_usertype 
        where fusertype > (select fusertype from adm_usertype 
        where ftypeshort = '{$usertype}')";
        
        $res = $aobj_context->pobj_db->GetAll($que);
        
        $query = "select fname,fusername,fmobileno,fpassword,fusertype,
        ifnull(fcollcode,'All')as fcollcode,
        ifnull(fdegree,'All')as fdegree 
        from adm_masuser where fusercode = '{$fuserid}'";
        $result = $aobj_context->pobj_db->GetRow($query);

         if($result){
            $arr['usertype'] = $res;
            $arr['data'] = $result;
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success"); 
            return;
        }else{
            $data = "failed to get users";
            echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1, "failure"); 
            return;
        }

    }

    function stdchangepass($aobj_context){
        $univcode = $aobj_context->mobj_data["univcode"];
        $oldpassword = $aobj_context->mobj_data["oldpassword"];
        $passwd = $aobj_context->mobj_data["passwd"];

        $username = $_SESSION['MOBILE'];

        $query = "select fpassword from adm_lead where fpassword = '{$oldpassword}'
                  and femail='{$username}'";
        $result = $aobj_context->pobj_db->GetRow($query);

        if($result['fpassword'] === $oldpassword){
            $upd = "update adm_lead set fpassword = '{$passwd}' where femail='{$username}'";
            $res = $aobj_context->pobj_db->Execute($upd);

            $upd = "update adm_stud set fpassword = '{$passwd}' where femail='{$username}'";
            $res = $aobj_context->pobj_db->Execute($upd);

            if($res){
                $data = "Password changed successfully";
                echo $aobj_context->mobj_output->ToJSONEnvelope($data, 0, "success"); 
                return;
            }else{
                $data = "failed to update password";
                echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1, "failure"); 
                return;
            }
        }else{
            $data = "Entered old password is not valid";
            echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1, "failure"); 
            return;
        }
    }

    function todayUpdateData($aobj_context){
        $univcode = $aobj_context->mobj_data["univcode"];
        $ftypeval = $aobj_context->mobj_data["ftypeval"];
        $username = $_SESSION['MOBILE'];
        $usertype = $_SESSION["USERTYPE"];
        $date = date("Y-m-d");

        if($usertype != 'SA' && $usertype != 'SU' && $usertype != 'DU'){
            $cond = "and s.fassign = '{$username}'";
        }
       
        if($ftypeval == 'Follow'){
            $val = "and STR_TO_DATE(ifnull(s.ffollowdate,''), '%Y-%m-%d') = '{$date}'";
        }else if($ftypeval == 'All'){
            $val = "and ifnull(s.ffollowdate,'') <> ''";
        }else if($ftypeval == 'Missed'){
            $val = "and STR_TO_DATE(ifnull(s.ffollowdate,''), '%Y-%m-%d') < '{$date}'
            and ifnull(s.ffollowdate,'') <> ''";
        }else if($ftypeval == 'Walkin'){
            $val = "and STR_TO_DATE(ifnull(s.ffollowdate,''), '%Y-%m-%d') = '{$date}'";
        }

        $query = "select '$username' as usermob,s.fleadid, ifnull(s.fname,'') as fname, ifnull(s.fmobile,'') as fmobile, ifnull(s.femail,'') as femail,
        ifnull( concat(s.fdegree,' - ', d.fdescpn),'') as fdegree,
        ifnull(s.fcreateddate,'') as fcreateddate,
        ifnull(freferstatus,'')as freferstatus, ifnull(flastcall,'New') as flastcall, 
        ifnull(fcallstatus,'New') as fcallstatus, 
        ifnull(s.ffollowdate,'') as ffollowdate, 
        ifnull(s.fwalkindate,'') as fwalkindate, 
        ifnull(s.fleadsource,'') as fleadsource, 
        ifnull(am.fname,'') as fassign,	ifnull(s.fleadstatus,'') as fleadstatus,
        ifnull(ast.fname,'') as fstate
        from adm_lead s left join degree d on s.fdegree = d.fdegree
        left join adm_masuser am on s.fassign = am.fusername
        left join adm_state ast on s.fstate = ast.fid
        where ftype = 'Registered' $cond
        $val
        and ifnull(s.fassign,'') <> ''
        group by s.fleadid order by s.ffollowdate asc";
        
        $result = $aobj_context->pobj_db->GetAll($query);

        if($result){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success"); 
            return;
        }else{
            $arr['msg'] = "No Data found";
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure"); 
            return;
        }
    }

    function getPaymentDet($aobj_context){
        $univcode = $aobj_context->mobj_data["univcode"];
        $detval = $aobj_context->mobj_data["detval"];
        $username = $_SESSION['MOBILE'];
        $usertype = $_SESSION["USERTYPE"];
        $date = date("Y-m-d");

        if($usertype != 'SA' && $usertype != 'SU' && $usertype != 'DU'){
            $cond = "and sa.fassign = '{$username}'";
        }

        if($detval == 'comp'){
            $val = "T";
            $join = "inner";
            $val1 = 'success';
        }else if($detval == 'pend'){
            $val = "";
            $join = "left";
            $val1 = '';
        }
        
        if($detval == 'appnot'){
            $query = "select distinct al.fleadid,al.fname, concat(al.fmobile,' / ',al.femail) as fmobile,
            ifnull(al.fpaymentdate,'') as fconfdate,
            ifnull(am.fname,'') as fassign,d.fdescpn
            from adm_lead al 
            left join degree d on al.fdegree = d.fdegree
            left join adm_masuser am on al.fassign = am.fusername
            where ifnull(fpaymentid,'') <> ''
            and ifnull(ftype,'') = 'Registered'";
        }else{
            $query = "select sa.fappno,sa.fname, concat(sa.fmobile,' / ',sa.femail) as fmobile,
            ifnull(sa.fconfdate,'') as fconfdate,
            ifnull(sa.fassign,'') as fassign,d.fdescpn,
            if(asm.fpaystatus = 'success','Completed','Pending') as fpay,
            ifnull(asf.fpaid,'0.00') as fpaid,ifnull(asf.fbal,'') as fbal,
            ifnull(asm.fpaydate,'') as fpaydate, ifnull(sa.fappvrsts,'') as fappvrsts,
            ifnull(asm.FTRANID,'') as FTRANID
            from adm_stud sa 
            left join degree d on sa.fdegree = d.fdegree and sa.fadmyear = d.fadmyear
            inner join adm_state ast on sa.fstate = ast.fid
            {$join} join adm_studfee asf on sa.fappno = asf.fappno and sa.fdegree = asf.fdegree
            {$join} join adm_studfeesum asm on asm.fappno = sa.fappno and asm.fappno = sa.fappno
            where IFNULL(sa.fconfirm, '') = 'T' and ifnull(sa.fpaymentstatus,'') = '{$val}' 
            and ifnull(asm.fpaystatus,'') = '{$val1}' $cond
            group by sa.fappno";
        }
        // var_dump($query);die();
        $result = $aobj_context->pobj_db->GetAll($query);

        if($result){
            $arr['data'] = $result;
            $arr['usertype'] = $usertype;
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success"); 
            return;
        }else{
            $arr['msg'] = "No Data found";
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure"); 
            return;
        }
    }

    function deleteUserDet($aobj_context){
        $univcode = $aobj_context->mobj_data["univcode"];
        $fuserid = $aobj_context->mobj_data["fuserid"];

        $query = "update adm_masuser set fdeleted = 'T' 
        where fusercode = '{$fuserid}'";

        $result = $aobj_context->pobj_db->Execute($query);
        if($result){
            $arr['msg'] = "Successfully Deleted";
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success"); 
            return;
        }else{
            $arr['msg'] = "Something went wrong try later";
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure"); 
            return;
        }

    }

    function confStdLtr($aobj_context){
        $univcode = $aobj_context->mobj_data["univcode"];
        $fappno = $aobj_context->mobj_data["fappno"];
        $username = $_SESSION['MOBILE'];
        $date = date('Y-m-d H:i:s');
        $onldate = date('d-m-Y');
        
        $query = "select a.*, concat(d.fdescpn,' (',a.fdegree,')') as fdescpn from adm_stud a inner join degree d
        on a.fdegree = d.fdegree where fappno = '{$fappno}'";
        
        $result = $aobj_context->pobj_db->GetRow($query);

        $colldet = "select ifnull(FUNIVNAME,'') as FUNIVNAME, concat(ifnull(FUNIVADD1,'') ,',', ifnull(FUNIVADD2,'')) as FUNIVADD,
                    ifnull(FTOWN,'') as FTOWN, ifnull(funivemail,'') as funivemail,
                    ifnull(funivmobile,'') as funivmobile,ifnull(fadmlink,'') as fadmlink,
                    ifnull(fadmname, '') as fadmname,ifnull(fadmemail,'') as fadmemail
                    from control";
        $collres = $aobj_context->pobj_db->GetRow($colldet);
        $url = $collres['fadmlink'];
        $url_parts = parse_url($url);
        $admlink = $url_parts['host'];
        
        $stdfatname = $result['ffatname'];
        $stddegree = $result['fdescpn'];
        $admyer = $result['fadmyear'];
        $admyar = date("Y", strtotime("+1 year", strtotime($admyer . "-01-01")));
        $admYear = $admyer."-".$admyar;
        $femail = $result['femail'];
        
        $stdgend = '';
        if($result['fgender'] == 'M'){
            $stdgend = 'S/o';
            $stdname = 'Mr '.$result['fname'];
        }else{
            $stdgend = 'D/o';
            $stdname = 'Ms '.$result['fname'];
        }
        $link = $admlink."/app.php?&a=confStdLtrPdf&univcode=".$univcode."&fappno=".$fappno."";
        $logo = "https://universitysolutions.in/admission/img/".$univcode."_logo.jpg";

		$message="<html>";
		$message.="<body>";
		$message.="<style>";		
		$message.=".mail_tbl td{ text-align:left; padding:2px; font-size:12px; 
				font-family: Verdana, Arial, Helvetica, sans-serif;";	
		$message.="</style>";
		$message.="<center><img src='{$logo}' height='100px' width='250px' /></center>";
	
        $message.="<p style='font-size:12px; font-family: Verdana, Arial, Helvetica, sans-serif;'>Application no.: <b>" . $fappno . "</b></p>";
        $message.="<p style='font-size:12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-align:right;'>Date: " . $onldate . "</p>";

		$message.="<p style='line-height: 0;text-align:center'><b>ADMISSION CONFIRMATION</b></p>";

        $message.="<p style='font-size:12px; font-family: Verdana, Arial, Helvetica, sans-serif;margin-top:40px'>
		Download PROVISIONAL ADMISSION CONFIRMATION Letter <button><a href='{$link}'>Download</a></button></p>";

        // $message.= "";
		// $message.="<p style='font-size:12px; font-family: Verdana, Arial, Helvetica, sans-serif'>
		// This is to certify that <b>".$stdname." ".$stdgend." ".$stdfatname."</b> has been provisionally admitted in our institution 
        // for study in <b>".$stddegree."</b> course for the academic year <b>".$admYear."</b> through merit basis and final confirmation 
        // of the admission is subjected to the payment of full fee, submission of original documents and approval of admission 
        // from the university concerned. </p>";

		$message.="<p style='font-size:12px; font-family: Verdana, Arial, Helvetica, sans-serif'>
		Thanking You,</p>";

		$message.="</body>";
		$message.="</html>";
       
		$subject= strtoupper("PROVISIONAL ADMISSION CONFIRMATION LETTER"); 
		
        if($username == '8183865028'){
            $femail = "manu03673@gmail.com";
        }
		$resp = sendGridMail($femail,$subject,$message,$univcode); 
        
        if($resp){
            $qur = "update adm_stud set fappvrsts = 'T', fappvrdate = '{$date}', fappvruser ='{$username}'
            where fappno = '{$fappno}'";

            $res = $aobj_context->pobj_db->Execute($qur);
            if($res){
                $arr['msg'] = "Confirmed Successfully";
                echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success"); 
                return;
            }else{
                $arr['msg'] = "Something went wrong try later";
                echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure"); 
                return;
            }
        }else{
            $arr['msg'] = "Something went wrong try later";
                echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure"); 
                return;
        }
    }

    function getUserTypes($aobj_context){
        $univcode = $aobj_context->mobj_data["univcode"];
        $username = $_SESSION['MOBILE'];
        $usertype = $_SESSION["USERTYPE"];

        $que = "select ifnull(fcollcode,'All')as fcollcode, ifnull(fdegree,'All')as fdegree 
        from adm_masuser where fusername = '{$username}' and ifnull(fdeleted,'F') <> 'T'";
        $res = $aobj_context->pobj_db->GetRow($que);

        $query = "select * from adm_usertype 
        where fusertype > (select fusertype from adm_usertype where ftypeshort = '{$usertype}')";
        
        $result = $aobj_context->pobj_db->GetAll($query);

        if($res['fdegree'] != 'All'){
            $degquery = "select DISTINCT d.fdegree,fdescpn from degree d 
            join adm_masuser a on FIND_IN_SET(d.fdegree, REPLACE(a.fdegree, '*', ',')) > 0
            where fusername = '{$username}' and ifnull(fdeleted,'F') <> 'T'";
        }else{
            $degquery = "select DISTINCT d.fdegree, d.fdescpn from degree d
            where ifnull(fdeleted,'F') <> 'T'";
        }
            $degres = $aobj_context->pobj_db->GetAll($degquery);

        if($res['fcollcode'] != 'All'){
            $collque = "select DISTINCT c.fcollcode,c.fcollname from college c
            join adm_masuser a on FIND_IN_SET(c.fcollcode, REPLACE(a.fcollcode, '*', ',')) > 0
            where fusername = '{$username}' and ifnull(c.fdeleted,'F') <> 'T'";
        }else{
            $collque = "select DISTINCT fcollcode,fcollname from college 
            where ifnull(fdeleted,'F') <> 'T'";
        }
            $collres = $aobj_context->pobj_db->GetAll($collque);
        
        if($result){
            $arr['usertype'] = $result;
            $arr['fdegree'] = $degres;
            $arr['fcoll'] = $collres;
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success"); 
            return;
        }else{
            $arr['msg'] = "No Usertype Data found";
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure"); 
            return;
        }
    }
?>