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


Current Path : /var/www/html/pget/
Upload File :
Current File : /var/www/html/pget/verify.php

<?php
session_start();
?>

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta
      content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
      name="viewport"
    />
    <title>PG Online Registration</title>
    <!-- Favicon-->
    <link rel="icon" href="images/favicon.jpg" type="image/x-icon" />

    <!-- Google Fonts -->
    <link
      href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800&amp;subset=latin-ext"
      rel="stylesheet"
    />
    <link
      href="https://fonts.googleapis.com/icon?family=Material+Icons"
      rel="stylesheet"
      type="text/css"
    />

    <!-- Bootstrap Core Css -->
    <link href="plugins/bootstrap/css/bootstrap.css" rel="stylesheet" />

    <!-- Waves Effect Css -->
    <link href="plugins/node-waves/waves.css" rel="stylesheet" />

    <!-- Custom Css -->
    <link href="css/style_adm.css" rel="stylesheet" />

    <!-- AdminBSB Themes. You can choose a theme from css/themes instead of get all themes -->
    <link href="css/themes/all-themes.css" rel="stylesheet" />
    <style>
      .font-16 {
        font-size: 16px !important;
      }
    </style>
  </head>

  <body class="theme-pink">
    <!-- Page Loader -->
    <div class="page-loader-wrapper">
      <div class="loader">
        <div class="preloader">
          <div class="spinner-layer pl-red">
            <div class="circle-clipper left">
              <div class="circle"></div>
            </div>
            <div class="circle-clipper right">
              <div class="circle"></div>
            </div>
          </div>
        </div>
        <p>Please wait...</p>
      </div>
    </div>
    <!-- #END# Page Loader -->
    <!-- Top Bar -->
    <nav class="navbar" style="background: linear-gradient(to right,#159957,#155799);">
    <div class="container-fluid" style="color: #fff;">
      <div class="col-md-12 m-t--5">
        <a href="#" class="links" onclick="homeLink()"
          style="float: right;margin-top: 15px; font-size:16px;color: #fff; margin-left: 10px;">Logout</a>
        <a class="links" href="pg_instruction.html"
          style="float: right; padding-top: 15px;font-size:16px;color: #fff;">Home</a>
        <center>
        <script type="text/javascript">
              // var url = window.location.pathname.split("/");
              var url_string = window.location.href;
              var url = new URL(url_string);
              var funivcode = url.searchParams.get("funivcode");
              console.log(funivcode);
              // console.log(url[2]);
              if (funivcode == "026")
                document.write(
                  '<h2 class="brand" style="margin-left: 50px;">VIJAYANAGARA SRI KRISHNADEVARAYA UNIVERSITY</h2>'
                );
                else if (funivcode == "027")
                document.write(
                  '<h2 class="brand" style="margin-left: 50px;">RANI CHANNAMMA UNIVERSITY, BELAGAVI</h2>'
                );
            </script>
        </center>
        <center>
          <h3 class="brand" class="m-t--5" style="margin-top: 10px;">
            Online Registration for PG Entrance 2020-21
          </h3>
        </center>
      </div>
    </div>
  </nav>
    <section class="content" style="margin-top: 11%">
      <div class="row clearfix">
                        
      <div class="container-fluid">
          <div class="col-lg-10 col-md-10 col-sm-12 col-xs-12 ">
            <div class="card p-l-20 p-r-20 p-b-20">
              <div class="p-t-10 p-l-10 p-r-10" style="font-size: 15px;">
<?php

include("/var/www/config.php");
error_reporting(E_ALL);
ini_set('display_errors', 'On');
$funivcode = $_REQUEST['funivcode'];

if($funivcode == '026')
    $db = "logisys3_vku";
else if($funivcode == '027')                
  $db = "logisys3_rcu";
else if($funivcode == '023')                
  $db = "logisys3_dud";

  $servername = SERVERNAME;
  $username   = USERNAME;
  $password  = PASSWORD;
            $conn = new mysqli($servername, $username, $password, $db);
$get_query = "select * from {$db}.maspg where funivcode = '{$funivcode}' and fbank = 'Razorpay'";

$result1=$conn->query($get_query); 

$pgcred = mysqli_fetch_assoc($result1);

define("RAZORPAY_KEY_ID", $pgcred['fkey']);
define("RAZORPAY_KEY_SECRET", $pgcred['fworkingid']);
require('razorpay/config.php');



require('razorpay/razorpay-php/Razorpay.php');
use Razorpay\Api\Api;
use Razorpay\Api\Errors\SignatureVerificationError;

$success = true;

$error = "Payment Failed";

$success = true;

$error = "Payment Failed";


if (empty($_POST['razorpay_payment_id']) === false)
{
    $api = new Api(RAZORPAY_KEY_ID, RAZORPAY_KEY_SECRET);
   
    try
    {
        // Please note that the razorpay order ID must
        // come from a trusted source (session here, but
        // could be database or something else)

        $attributes = array(
            'razorpay_order_id' => $_SESSION['razorpay_order_id'],
            'razorpay_payment_id' => $_POST['razorpay_payment_id'],
            'razorpay_signature' => $_POST['razorpay_signature']
        );
       // var_dump($attributes);
        $api->utility->verifyPaymentSignature($attributes);
        //var_dump($api);
    }
    catch(SignatureVerificationError $e)
    {
        $success = false;
        $error = 'Razorpay Error : ' . $e->getMessage();
    }
}
//pay_BM9pU1wNQgNrzY
if ($success === true)
{
    $html = "<p>Your payment was successful</p>
             <p>Payment ID: {$_POST['razorpay_payment_id']}</p>";

            // use Razorpay\Api\Api;
    $paymentid = $_POST['razorpay_payment_id'];
    
    $api = new Api($keyId, $keySecret);
    $payment = $api->payment->fetch("{$paymentid}");

    $servername = SERVERNAME;
    $username   = USERNAME;
    $password  = PASSWORD;
    /* $servername = "localhost";
    $username = "root";
    $password = "";*/
    $dbname = "logisys3_comexam";
    $conn = new mysqli($servername, $username, $password, $dbname);
    
    $get_data = "select * from dbname where ifnull(fdeleted,'') <> 'T'";

    $result1=$conn->query($get_data); 

    if (mysqli_num_rows($result1) > 0) 
    {
        // output data of each row
        $dbnames = array();
        while($row = mysqli_fetch_assoc($result1)) 
        {
            $dbnames[$row['FUNIVCODE']] = $row['FDBNAME'];
        }
    }

    mysqli_close($conn);

    $servername = SERVERNAME;
    $username   = USERNAME;
    $password  = PASSWORD;
  
    /*$servername = "localhost";
    $username = "root";
    $password = "";*/

    $dbname = $dbnames[$payment->notes->univcode];
    $univcode = $payment->notes->univcode;
    $conn = new mysqli($servername, $username, $password, $dbname);

    $status = "success";
    $productinfo = $payment->notes->appno;
    $txnid = $payment->id;

    $payment['TXNAMOUNT'] = ((float)$payment->amount/100);
    
    $firstname = 'razorpay';
    $html = "";
    echo "<h1 style='color:green;'>Thank You. Your order status is success</h1>";
    echo "<h2>Your Transaction ID for this transaction is ".$txnid.".</h2>";
    echo "<h3>We have received a payment of Rs. " . $payment['TXNAMOUNT']  ."</h3>";

    if(substr($productinfo,0,1) == 8){

      $html = "";
      $html="
      <div class='m-l-10 btn btn-primary waves-effect btn' >
      <span onclick=\"PrintApplication('{$productinfo}','{$univcode}');\" style='float:left;margin-left:8px;cursor: pointer; line-height: 19px;font-size:14px;font-weight:bold;'>Click here to take a PrintOut</span>
      </div>";
      echo $html;
    
      $html = "";
      $update="update entstudadm set FPAYREMARKS = '{$txnid}',FPAYID = '{$txnid}', 
      FPAYSTATUS = 'success', FPAYDATE = now()
      where fappno ='{$productinfo}'";
      $result=$conn->query($update);
    } else if(substr($productinfo,0,1) == 9) {
      $update="update entaddcourse set FPAYID = '{$txnid}', 
      FPAYSTATUS = 'success', FPAYDATE = now() where faddappno ='{$productinfo}'";
      $result=$conn->query($update);

      $insert = "insert into entoptdeg(fappno, fdegree)
      select a.fappno, b.fdegree from entaddcourse a, entdeg b 
      where faddappno = '{$productinfo}' and instr(a.fdegree, b.fdegree)";
      $result=$conn->query($insert);

  }
}
else
{
    $html = "<p>Your payment failed</p>
             <p>{$error}</p>";
    echo $html;
}


?>
                    
                      </div>
                    
                  </div>
                   
                  </div>
                </div>
              </div>
            </div>
  </section>

<!-- Modal -->

<script src="plugins/jquery/jquery.min.js"></script>

<!-- Bootstrap Core Js -->
<script src="plugins/bootstrap/js/bootstrap.js"></script>

<!-- Select Plugin Js -->
<script src="plugins/bootstrap-select/js/bootstrap-select.js"></script>

<!-- Slimscroll Plugin Js -->
<script src="plugins/jquery-slimscroll/jquery.slimscroll.js"></script>

<!-- Waves Effect Plugin Js -->
<script src="plugins/node-waves/waves.js"></script>
<!-- Custom Js -->
<script src="js/admin.js"></script>
<!-- Demo Js -->
<script src="js/demo.js"></script>
<script src="js/pg/login.js"></script>
<script src="js/pg/payment.js"></script>
<script src="js/pg/reprint.js"></script>

<script>
  function PrintApplication(appno,univcode)
  {

    var db = ""
    if(univcode =='026')
      db = "vskub";
    else if(univcode =='027')
      db = "rcub";
    else if(univcode =='023')
      db = "dud";

      if(db == 'rcub')
      {
        alert('Print application after login');
        return;
      }else if(db == 'vskub')
      {
      var $host_url =
        "http://" +
        window.location.host +
        "/" +
        window.location.pathname.split("/")[1] +
        "/app.php?db=" +
        db +
        "&a=";
        window.location.href = $host_url + "vkuapplicationFormPGReport&appno=" + appno+ "&degree=all";
      }
  }
</script>
</body>
</html>