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 : 52.14.66.242


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/editstddet.php

<?php
function getstudentdet($aobj_context){
   session_start();
   $collcode = $_SESSION['collcode'];
   $univcode = $_SESSION['FUNIVCODE'];
   $regno = $aobj_context->mobj_data["regno"]; 

    if($univcode == '097')
    {
      $query="SELECT st.fname,st.fregno,st.FFATNAME,st.FMOTNAME,st.FCURRADD1,
            IFNULL(st.FCURRADD2,'')AS FCURRADD2,
            IFNULL(st.FCURRADD3,'')AS FCURRADD3,
            IFNULL(st.FCURRADD4,'')AS FCURRADD4,
            IFNULL(st.fpermadd1,'')AS fpermadd1,
            IFNULL(st.fpermadd2,'')AS fpermadd2,
            IFNULL(st.FPERMADD3,'')AS FPERMADD3,
            IFNULL(st.FPERMADD4,'')AS FPERMADD4,
            IFNULL(st.fcommpost,'')AS fcommpost,
            IFNULL(st.fperpost,'')AS fperpost,
            IFNULL(st.fcommtaluk,'')AS fcommtaluk,
            IFNULL(st.fpertaluk,'')AS fpertaluk,
            IFNULL(st.fcommdist,'')AS fcommdist,
            IFNULL(st.FPERDIST,'')AS FPERDIST,
            IFNULL(st.fperstate,'')AS fperstate,
            IFNULL(st.fcommstate,'')AS fcommstate,
            IFNULL(st.fcommpin,'')AS fcommpin,
            IFNULL(st.fperpin,'')AS fperpin,
            IFNULL(m.fmobileno,'')AS FSTUDMOB,
            IFNULL(st.FFATMOB,'')AS FFATMOB,
            IFNULL(st.fguamob,'')AS fguamob,
            IFNULL(st.fmotmob,'')AS fmotmob,
            DATE_FORMAT(st.FDOB,'%d/%m/%Y') AS FDOB
            FROM student st left join logisys3_comexam.masuser m on st.fregno = m.fregno
            and m.funivcode = '{$univcode}'
            WHERE st.FREGNO='{$regno}' AND st.fcollcode = '{$collcode}'";  
  }else
  {
    $query="SELECT fname,fregno,FFATNAME,FMOTNAME,FCURRADD1,
            IFNULL(FCURRADD2,'')AS FCURRADD2,
            IFNULL(FCURRADD3,'')AS FCURRADD3,
            IFNULL(FCURRADD4,'')AS FCURRADD4,
            IFNULL(fpermadd1,'')AS fpermadd1,
            IFNULL(fpermadd2,'')AS fpermadd2,
            IFNULL(FPERMADD3,'')AS FPERMADD3,
            IFNULL(FPERMADD4,'')AS FPERMADD4,
            IFNULL(fcommpost,'')AS fcommpost,
            IFNULL(fperpost,'')AS fperpost,
            IFNULL(fcommtaluk,'')AS fcommtaluk,
            IFNULL(fpertaluk,'')AS fpertaluk,
            IFNULL(fcommdist,'')AS fcommdist,
            IFNULL(FPERDIST,'')AS FPERDIST,
            IFNULL(fperstate,'')AS fperstate,
            IFNULL(fcommstate,'')AS fcommstate,
            IFNULL(fcommpin,'')AS fcommpin,
            IFNULL(fperpin,'')AS fperpin,
            IFNULL(FSTUDMOB,'')AS FSTUDMOB,
            IFNULL(FFATMOB,'')AS FFATMOB,
            IFNULL(fguamob,'')AS fguamob,
            IFNULL(fmotmob,'')AS fmotmob,
            DATE_FORMAT(FDOB,'%d/%m/%Y') AS FDOB
            FROM student WHERE FREGNO='{$regno}' AND fcollcode = '{$collcode}'";  
  }
  $result=$aobj_context->mobj_db->GetRow($query);

if($result){
  echo $aobj_context->mobj_output->TOJSONEnvelope($result, 0, "success"); 
  }
  else{
    $arr['msg']="Invalid Reg No.";
    echo   $aobj_context->mobj_output->TOJSONEnvelope($arr, -1, "failed");
   
  }
}

function updatestudentdetail($aobj_context){
    session_start();
    $univcode = $_SESSION['FUNIVCODE'];
    $collcode = $_SESSION['collcode'];
    $regno = $aobj_context->mobj_data["regno"];
    $dob = $aobj_context->mobj_data["dob"];

    $fatmob = $aobj_context->mobj_data["fatmob"];
    $motmob = $aobj_context->mobj_data["motmob"];
    $guamob = $aobj_context->mobj_data["guamob"];
    $stdmob = $aobj_context->mobj_data["stdmob"];

    $add1 = $aobj_context->mobj_data["add1"];
    $add2 = $aobj_context->mobj_data["add2"];
    $add3 = $aobj_context->mobj_data["add3"];
    $add4 = $aobj_context->mobj_data["add4"];
    $post = $aobj_context->mobj_data["post"];
    $taluk = $aobj_context->mobj_data["taluk"];
    $district = $aobj_context->mobj_data["district"];
    $state = $aobj_context->mobj_data["state"];
    $pin = $aobj_context->mobj_data["pin"];

    $add01 = $aobj_context->mobj_data["add01"];
    $add02 = $aobj_context->mobj_data["add02"];
    $add03 = $aobj_context->mobj_data["add03"];
    $add04 = $aobj_context->mobj_data["add04"];
    $post01 = $aobj_context->mobj_data["post01"];
    $taluk01 = $aobj_context->mobj_data["taluk01"];
    $district01 = $aobj_context->mobj_data["district01"];
    $state01 = $aobj_context->mobj_data["state01"];
    $pin01 = $aobj_context->mobj_data["pin01"];

    $father = $aobj_context->mobj_data["father"];
    $mother = $aobj_context->mobj_data["mother"];

    $query ="UPDATE student SET ffatmob='{$fatmob}',fmotmob='{$motmob}',fguamob='{$guamob}',
             fstudmob='{$stdmob}', fdob =  DATE_FORMAT(STR_TO_DATE('{$dob}','%d/%m/%Y'),'%Y-%m-%d'),
             FCURRADD1='{$add1}',FCURRADD2='{$add2}',FCURRADD3='{$add3}',
             FCURRADD4='{$add4}',fpermadd1='{$add01}',fpermadd2='{$add02}',FPERMADD3='{$add03}',
             FPERMADD4='{$add04}',fcommpost='{$post}',fperpost='{$post01}',fcommtaluk='{$taluk}',
             fpertaluk=' {$taluk01}',fcommdist='{$district}',FPERDIST='{$district01}',fperstate='{$state01}',
             fcommstate='{$state}',fcommpin='{$pin}',fperpin=' {$pin01}'
             WHERE  FREGNO='{$regno}' AND fcollcode = '{$collcode}'";

     $result=$aobj_context->mobj_db->Execute($query);
  
    if($result){
      $arr['msg'] = "Successfully Saved";
      $response= $aobj_context->mobj_output->TOJSONEnvelope($arr,0,"success");
      echo $response;
    }
    else{
      $arr['msg'] = "Invalid Reg No.";
      echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
    }

      if($father ==true){
            $query1="INSERT INTO logisys3_comexam.masuser (FUNIVCODE, FREGNO, FMOBILENO, FPASSWD, FUSERTYPE, FACTIVE, FUPDTIME,  FTEMP, ftype)
                      VALUES
                      ('{$univcode}', '{$regno}', '{$father}', '{$father}', '900*', 'T',  now(), 'P', 'P')";
                        $result1=$aobj_context->mobj_db->Execute($query1);
                        if($result1){
                          echo $aobj_context->mobj_output->TOJSONEnvelope($result1,0,"success");
                        }
                        else{
                          $arr['msg']="Invalid Reg No.";
                          echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
                        }
         }elseif($mother==true){
              $query1="INSERT INTO logisys3_comexam.masuser (FUNIVCODE, FREGNO, FMOBILENO, FPASSWD, FUSERTYPE, FACTIVE, FUPDTIME,  FTEMP, ftype)
                      VALUES
                      ('{$univcode}', '{$regno}', '{$mother}', '{$mother}', '900*', 'T',  now(), 'P', 'P')";
                        $result1=$aobj_context->mobj_db->Execute($query1);
                        if($result1){
                          echo $aobj_context->mobj_output->TOJSONEnvelope($result1,0,"success");
                        }
                        else{
                          $arr['msg']="Invalid Reg No.";
                          echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
                        }
        }
     
 
}  


?>