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


Current Path : /var/www/html/admission/src/
Upload File :
Current File : /var/www/html/admission/src/sspdata1_rcub.php

 <?php
 function sspdexamdataanewrcub($aobj_context)
 {

    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
    ini_set('max_execution_time', '300');

    $univcode = $aobj_context->mobj_data["univcode"];
    $uniotp = $aobj_context->mobj_data["uniotp"];
    $degcode = $aobj_context->mobj_data["degcode"];
    $coll_frm = $aobj_context->mobj_data["coll_frm"];
    $coll_to = $aobj_context->mobj_data["coll_to"];
    $reg_frm = $aobj_context->mobj_data["reg_frm"];
    $reg_to = $aobj_context->mobj_data["reg_to"];
    
    if($univcode == '001')
    {
       echo "Not Enabled for GUG";
       return;
       die();
    }  
    
    $query = "select distinct FSSPCODE,FSSPKEY, FSSPUSER,FSSPPWD 
    from logisys3_comexam.dbname
    where funivcode  = '{$univcode}'";
    $result3 = $aobj_context->mobj_db->GetRow($query);
    $univsspcode = $result3['FSSPCODE'];
    $sspkey = $result3['FSSPKEY'];
    $fsspuser = $result3['FSSPUSER'];
    $FSSPPWD = $result3['FSSPPWD'];

    // $query = "select distinct University_SSP_Code,Previous_Year_SSP_College_Code as COLLEGE_SSP_CODE,
    // Previous_Year_SSP_Course_Code as COURSE_CODE 
    // from logisys3_comexam.ssp_univ_marks
    // where ifnull(Previous_Year_SSP_College_Code,'') <> ''
    // and ifnull(finserted,'') <> 'T'
    // and University_SSP_Code  = '{$univsspcode}'
    // and fdegree = '{$degcode}'
    // and fcollcode between '{$coll_frm}' and '{$coll_to}' 
    // and University_Registration_Number between '{$reg_frm}' and '$reg_to'";
    //var_dump($query);
    //die();

    $query = "select distinct University_SSP_Code,Previous_Year_SSP_College_Code as COLLEGE_SSP_CODE,
    Previous_Year_SSP_Course_Code as COURSE_CODE 
    from logisys3_comexam.ssp_univ_marks
    where ifnull(Previous_Year_SSP_College_Code,'') <> ''
    and ifnull(finserted,'') <> 'T'
    and University_SSP_Code  = '{$univsspcode}'
    and University_Registration_Number in('A1856243',
    'A1927924',
    'A1949694',
    'A1965999',
    'A1973104',
    'A2053936',
    'A2077014',
    'C1956254',
    'E1919683',
    'E2015847',
    'S2042898',
    'S2044015',
    'S2044887',
    'HS181827',
    'P2113206',
    'P2113210',
    'P2113221',
    'P2113222',
    'P2113226',
    'P2113234',
    'P2111608',
    'P2112801',
    'P2112821',
    'P2112811',
    'P2112810',
    'P2112822',
    'P2112813',
    'P2111624',
    'BSC19006',
    'BSC19009',
    'P2111645',
    'C2024210',
    'C2024201',
    'C2024183',
    'C2024193',
    'C2024210',
    'MSCC2017',
    'MB201456')";
    $result = $aobj_context->mobj_db->GetAll($query);
    
    foreach($result as $value)
    {
      
        // $query = "select '' as SSP_Student_ID, Student_Name, University_Name, University_SSP_Code, 
        // University_Registration_Number, UG_PG, Previous_Course_Passed_Year, 
        // Previous_Year_SSP_University_Code, Previous_Year_SSP_University_Name, 
        // Previous_Year_SSP_College_Code, Previous_Year_SSP_College_Name, 
        // Previous_Year_SSP_Course_Code, Previous_Year_SSP_Course_Name, 
        // Previous_Year_SSP_Discipline_Code, Previous_Year_SSP_Discipline_Name, 
        // Previous_Year_Course_Year, Previous_Year_Max_Marks, Previous_Year_Obtained_Marks, 
        // Previous_Year_Percentage_Obtained, PASS_or_FAIL, Promoted
        // from logisys3_comexam.ssp_univ_marks 
        // where ifnull(finserted,'') <> 'T' and Previous_Year_SSP_College_Code = '{$value['COLLEGE_SSP_CODE']}'
        // and University_SSP_Code = '{$value['University_SSP_Code']}'
        // and Previous_Year_SSP_Course_Code = '{$value['COURSE_CODE']}'
        // and fdegree = '{$degcode}'
        // and fcollcode between '{$coll_frm}' and '{$coll_to}' 
        // and University_Registration_Number between '{$reg_frm}' and '$reg_to'";

        $query = "select '' as SSP_Student_ID, Student_Name, University_Name, University_SSP_Code, 
        University_Registration_Number, UG_PG, Previous_Course_Passed_Year, 
        Previous_Year_SSP_University_Code, Previous_Year_SSP_University_Name, 
        Previous_Year_SSP_College_Code, Previous_Year_SSP_College_Name, 
        Previous_Year_SSP_Course_Code, Previous_Year_SSP_Course_Name, 
        Previous_Year_SSP_Discipline_Code, Previous_Year_SSP_Discipline_Name, 
        Previous_Year_Course_Year, Previous_Year_Max_Marks, Previous_Year_Obtained_Marks, 
        Previous_Year_Percentage_Obtained, PASS_or_FAIL, Promoted
        from logisys3_comexam.ssp_univ_marks 
        where ifnull(finserted,'') <> 'T' and Previous_Year_SSP_College_Code = '{$value['COLLEGE_SSP_CODE']}'
        and University_SSP_Code = '{$value['University_SSP_Code']}'
        and Previous_Year_SSP_Course_Code = '{$value['COURSE_CODE']}'
        and University_Registration_Number in('A1856243',
        'A1927924',
        'A1949694',
        'A1965999',
        'A1973104',
        'A2053936',
        'A2077014',
        'C1956254',
        'E1919683',
        'E2015847',
        'S2042898',
        'S2044015',
        'S2044887',
        'HS181827',
        'P2113206',
        'P2113210',
        'P2113221',
        'P2113222',
        'P2113226',
        'P2113234',
        'P2111608',
        'P2112801',
        'P2112821',
        'P2112811',
        'P2112810',
        'P2112822',
        'P2112813',
        'P2111624',
        'BSC19006',
        'BSC19009',
        'P2111645',
        'C2024210',
        'C2024201',
        'C2024183',
        'C2024193',
        'C2024210',
        'MSCC2017',
        'MB201456')";
        
        $result1 = $aobj_context->mobj_db->GetAll($query);
    
        if($result1)
        {
            $headers = array
            (
                "Authorization:$sspkey",
                "UserId:$fsspuser",
                "Password:$FSSPPWD",
                "ODP:$uniotp",
                "Content-Type: application/json"
            );
     
          $req = json_encode( $result1 );
       //  var_dump($req);
          $ch = curl_init(); 
          curl_setopt( $ch,CURLOPT_URL, "https://unidata.karnataka.gov.in:8080/UniAPI/api/Push_University_Marks_Data_2122/");
          curl_setopt( $ch,CURLOPT_POST, true );
          curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
          curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
          curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
          curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $result1 ) );
          $result2 = curl_exec($ch);
          //var_dump($result2);
            curl_close( $ch );
            
            
            $res2 = json_decode($result2, true);
          //var_dump($res2);
            $ressspdata = $res2['statusMessage'];
          //  var_dump($ressspdata);
            $resmainresponse = $res2['message'];
            foreach($ressspdata as $val)
            {
              
              $regno = $val['University_Registration_Number'];
              $regres = $val['Message'];
              if($regres == '')
                $regres = $resmainresponse;
              echo  "Reg. No.: ".$regno." Status: ".$regres."\n";

              if($val['Message_Type'] == 'SUCCESS')
              {

                $upd = "update logisys3_comexam.ssp_univ_marks set finserted = 'T',fupddate = now()
                  where ifnull(finserted,'') <> 'T'
                  and University_SSP_Code = '{$univsspcode}'
                  and University_Registration_Number = '{$regno}'";

                $result2 = $aobj_context->mobj_db->Execute($upd);

              }

              $insert = "insert into logisys3_comexam.ssp_bonafide_log(University_SSP_Code,
              University_Registration_Number, fres,ftype) values
              ('{$univsspcode}', '{$regno}','{$regres}','M')";
              $result3 = $aobj_context->mobj_db->Execute($insert);

            }    
      }
      echo "Completed";

    }
}

function sspdexamdataanewMaual($aobj_context)
{

   $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
   ini_set('max_execution_time', '300');

   $univcode = $aobj_context->mobj_data["univcode"];
   $uniotp = $aobj_context->mobj_data["uniotp"];
   $degcode = $aobj_context->mobj_data["degcode"];
   $coll_frm = $aobj_context->mobj_data["coll_frm"];
   $coll_to = $aobj_context->mobj_data["coll_to"];
   $reg_frm = $aobj_context->mobj_data["reg_frm"];
   $reg_to = $aobj_context->mobj_data["reg_to"];
   
   if($univcode == '001')
   {
      echo "Not Enabled for GUG";
      return;
      die();
   }  
   
   $query = "select distinct FSSPCODE,FSSPKEY, FSSPUSER,FSSPPWD 
   from logisys3_comexam.dbname
   where funivcode  = '{$univcode}'";
   $result3 = $aobj_context->mobj_db->GetRow($query);
   $univsspcode = $result3['FSSPCODE'];
   $sspkey = $result3['FSSPKEY'];
   $fsspuser = $result3['FSSPUSER'];
   $FSSPPWD = $result3['FSSPPWD'];

   $query = "select distinct University_SSP_Code,Previous_Year_SSP_College_Code as COLLEGE_SSP_CODE,
   Previous_Year_SSP_Course_Code as COURSE_CODE 
   from logisys3_comexam.ssp_univ_marks
   where ifnull(Previous_Year_SSP_College_Code,'') <> ''
   and ifnull(finserted,'') <> 'T'
   and University_SSP_Code  = '{$univsspcode}' 
   and University_Registration_Number in()";
   $result = $aobj_context->mobj_db->GetAll($query);
   
   foreach($result as $value)
   {
     
       $query = "select '' as SSP_Student_ID, Student_Name, University_Name, University_SSP_Code, 
       University_Registration_Number, UG_PG, Previous_Course_Passed_Year, 
       Previous_Year_SSP_University_Code, Previous_Year_SSP_University_Name, 
       Previous_Year_SSP_College_Code, Previous_Year_SSP_College_Name, 
       Previous_Year_SSP_Course_Code, Previous_Year_SSP_Course_Name, 
       Previous_Year_SSP_Discipline_Code, Previous_Year_SSP_Discipline_Name, 
       Previous_Year_Course_Year, Previous_Year_Max_Marks, Previous_Year_Obtained_Marks, 
       Previous_Year_Percentage_Obtained, PASS_or_FAIL, Promoted
       from logisys3_comexam.ssp_univ_marks 
       where ifnull(finserted,'') <> 'T' and Previous_Year_SSP_College_Code = '{$value['COLLEGE_SSP_CODE']}'
       and University_SSP_Code = '{$value['University_SSP_Code']}'
       and Previous_Year_SSP_Course_Code = '{$value['COURSE_CODE']}'
       and University_Registration_Number in()";
       
       $result1 = $aobj_context->mobj_db->GetAll($query);
   
       if($result1)
       {
           $headers = array
           (
               "Authorization:$sspkey",
               "UserId:$fsspuser",
               "Password:$FSSPPWD",
               "ODP:$uniotp",
               "Content-Type: application/json"
           );
    
         $req = json_encode( $result1 );
      //  var_dump($req);
         $ch = curl_init(); 
         curl_setopt( $ch,CURLOPT_URL, "https://unidata.karnataka.gov.in:8080/UniAPI/api/Push_University_Marks_Data_2122/");
         curl_setopt( $ch,CURLOPT_POST, true );
         curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
         curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
         curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
         curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $result1 ) );
         $result2 = curl_exec($ch);
         //var_dump($result2);
           curl_close( $ch );
           
           
           $res2 = json_decode($result2, true);
         //var_dump($res2);
           $ressspdata = $res2['statusMessage'];
         //  var_dump($ressspdata);
           $resmainresponse = $res2['message'];
           foreach($ressspdata as $val)
           {
             
             $regno = $val['University_Registration_Number'];
             $regres = $val['Message'];
             if($regres == '')
               $regres = $resmainresponse;
             echo  "Reg. No.: ".$regno." Status: ".$regres."\n";

             if($val['Message_Type'] == 'SUCCESS')
             {

               $upd = "update logisys3_comexam.ssp_univ_marks set finserted = 'T',fupddate = now()
                 where ifnull(finserted,'') <> 'T'
                 and University_SSP_Code = '{$univsspcode}'
                 and University_Registration_Number = '{$regno}'";

               $result2 = $aobj_context->mobj_db->Execute($upd);

             }

             $insert = "insert into logisys3_comexam.ssp_bonafide_log(University_SSP_Code,
             University_Registration_Number, fres,ftype) values
             ('{$univsspcode}', '{$regno}','{$regres}','M')";
             $result3 = $aobj_context->mobj_db->Execute($insert);

           }    
     }
     echo "Completed";

   }
}


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

    $univcode = $aobj_context->mobj_data["univcode"];
    $degcode = $aobj_context->mobj_data["degcode"];
    $coll_frm = $aobj_context->mobj_data["coll_frm"];
    $coll_to = $aobj_context->mobj_data["coll_to"];
    $reg_frm = $aobj_context->mobj_data["reg_frm"];
    $reg_to = $aobj_context->mobj_data["reg_to"];
    //var_dump($univcode);
    //die();
    $query = "select distinct FSSPCODE,FSSPKEY  
    from logisys3_comexam.dbname
    where funivcode  = '{$univcode}'";
    $result3 = $aobj_context->mobj_db->GetRow($query);
    $univsspcode = $result3['FSSPCODE'];
    
    if($result3)
    {
      
    }
    else
    {
      $data = "SSP Uni. Code not found contact admin";
      echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"error"); 
      return;
    }
  
  
    $query = "select distinct University_Name, University_SSP_Code, 
    sum(if(ifnull(finserted,'F') = 'F',1,0)) as not_pushed,
    sum(if(ifnull(finserted,'F') = 'T',1,0)) as pushed,
    count(*) as tot
        from logisys3_comexam.ssp_univ_marks
        where University_SSP_Code  = '{$univsspcode}' 
        and fdegree = '{$degcode}'
        and fcollcode between '{$coll_frm}' and '{$coll_to}' 
        and University_Registration_Number between '{$reg_frm}' and '$reg_to'";
  //   var_dump($query);
  //   die();
    $result = $aobj_context->mobj_db->GetRow($query);
    
    if($result)
    {
      $data = "Uploaded Pushed";
        echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
        return;	
    }
    else
    {
      $data = "No Details uploaded.";
      echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"error"); 
      return;
    }
  
  }

  ?>