authpartner
Clone or download
Modified Files
--- /dev/null
+++ b/fetchdoc.php
@@ -0,0 +1,201 @@
+<?php
+$access_token = $_GET['accesstoken'];
+$headers = array(
+ 'Authorization: Bearer ' . $access_token
+ //'Authorization: Basic '. base64_encode("$username:$password")
+);
+$urlFile = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/';
+$vhf = curl_init($urlFile);
+//curl_setopt($vhf, CURLOPT_CUSTOMREQUEST, "POST");
+//curl_setopt($vhf, CURLOPT_POST, true);
+curl_setopt($vhf, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
+curl_setopt($vhf, CURLOPT_HTTPHEADER, $headers);
+//curl_setopt($vhf, CURLOPT_POSTFIELDS, $post);
+//curl_setopt($vhf, CURLOPT_FOLLOWLOCATION, true);
+curl_setopt($vhf, CURLOPT_SSL_VERIFYPEER, 0);
+curl_setopt($vhf, CURLOPT_SSL_VERIFYHOST, 0);
+curl_setopt($vhf, CURLOPT_RETURNTRANSFER, true);
+$resFile = curl_exec($vhf);
+curl_close($vhf);
+$resFileNew = explode('¿', $resFile);
+$dataF = json_decode($resFileNew[1], TRUE);
+
+
+$urlissued = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/issued';
+$vhi = curl_init($urlissued);
+//curl_setopt($vhi, CURLOPT_CUSTOMREQUEST, "GET");
+//curl_setopt($vhi, CURLOPT_POST, true);
+curl_setopt($vhi, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
+curl_setopt($vhi, CURLOPT_HTTPHEADER, $headers);
+//curl_setopt($vhi, CURLOPT_POSTFIELDS, $post);
+//curl_setopt($vhi, CURLOPT_FOLLOWLOCATION, true);
+curl_setopt($vhi, CURLOPT_SSL_VERIFYPEER, 0);
+curl_setopt($vhi, CURLOPT_SSL_VERIFYHOST, 0);
+curl_setopt($vhi, CURLOPT_RETURNTRANSFER, true);
+$resissued = curl_exec($vhi);
+$resissuedErr = curl_error($vhi);
+curl_close($vhi);
+$issuedNew = explode('¿', $resissued);
+$dataI = json_decode($issuedNew[1], TRUE);
+?>
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="description" content="">
+ <meta name="author" content="">
+ <title>DigiBank</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
+ <!-- Bootstrap Core CSS -->
+ <link href="css/bootstrap.min.css" rel="stylesheet">
+ <!-- Custom CSS -->
+ <link href="css/digi-bank.css" rel="stylesheet">
+ <!-- Custom Fonts -->
+ <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
+ </head>
+ <body>
+ <div id="wrapper">
+ <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
+ <div class="collapse navbar-collapse navbar-ex1-collapse">
+ <ul class="nav navbar-nav side-nav">
+ <li class="active">
+ <a href="index.php"><i class="fa fa-fw fa-clock-o"></i> Link To DigiLocker</a>
+ </li>
+ <li>
+ <a href="link_document.php"><i class="fa fa-fw fa-link"></i> Loan Approvals</a>
+ </li>
+ <li>
+ <a href="statement.php"><i class="fa fa-fw fa-stack-exchange"></i>Account Statements</a>
+ </li>
+ </ul>
+ </div>
+ <div id="page-wrapper">
+ <div class="container-fluid">
+ <!-- Page Heading -->
+ <div class="row">
+ <div class="col-lg-12">
+ <div class="container">
+ <ul class="nav nav-tabs">
+ <li class="active"><a data-toggle="tab" href="#uploadeddocument">Uploaded Document</a></li>
+ <li><a data-toggle="tab" href="#issueddocument">Issued Document</a></li>
+ </ul>
+ <div class="tab-content">
+ <div id="uploadeddocument" class="tab-pane fade in active">
+ <section class="content">
+ <div class="row">
+ <div class="col-md-12">
+ <div class="box box-primary">
+ <div class="box box-body col-sm-12">
+ <div class="table-responsive">
+ <table class="table">
+ <tr>
+ <th>Name</th>
+ <th>Size</th>
+ <th>Date</th>
+ </tr>
+ <?php
+ foreach ($dataF['items'] as $api_detail):
+ ?>
+ <tr>
+ <td><a href="/digibank/uri.php?access_tocken=<?php echo $access_token; ?>&uri=<?php echo($api_detail['uri']); ?>&name=<?php echo($api_detail['name']); ?>">
+ <?php
+ if ($api_detail['type'] == "dir") {
+ echo "<i class='fa fa-folder-o'></i> ";
+ echo($api_detail['name']);
+ } elseif ($api_detail['type'] == "file") {
+ echo "<i class='fa fa-file-o'></i> ";
+ echo($api_detail['name']);
+ }
+ ?></a></td>
+ <td><?php echo($api_detail['size']); ?></td>
+ <td><?php echo($api_detail['date']); ?></td>
+ <td><?php if ($api_detail['type'] == "file") { ?><input type="radio" id="getval" class="getval" onclick="share_its('<?php echo $api_detail['uri']; ?>')"><?php } ?>
+ <?php
+ endforeach;
+ ?>
+ </table>
+ <div class="footer">
+ <button id="share_it" value="" onclick='sharedata();' style=" float:right;display: inline-block; background-color: rgb(51, 122, 183); color: rgb(255, 255, 255);">Share </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </section>
+ </div>
+ <div id="issueddocument" class="tab-pane fade">
+ <section class="content">
+ <div class="row">
+ <div class="col-md-12">
+ <div class="box box-primary">
+ <div class="box box-body col-sm-12">
+ <div class="table-responsive">
+ <table class="table">
+ <tr>
+ <th>Name</th>
+ <th>Size</th>
+ <th>Date</th>
+
+ </tr>
+ <?php
+ foreach ($dataI['items'] as $issued_detail):
+ ?>
+ <tr><td>
+ <?php
+ echo "<i class='fa fa-file-o'></i> ";
+ echo($issued_detail['name']);
+ ?>
+ </td>
+ <td><?php echo($issued_detail['size']); ?></td>
+ <td><?php echo($issued_detail['date']); ?></td>
+ <td><input type="radio"></td>
+
+ </tr>
+ <?php
+ endforeach;
+ ?>
+ </table>
+ <div class="footer">
+ <button id="button_share" value="" onclick='sharedata();' style=" float:right;display: inline-block; background-color: rgb(51, 122, 183); color: rgb(255, 255, 255);">Share </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </section>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <!-- /.container-fluid -->
+ </div>
+ </div>
+ <!-- jQuery -->
+ <script src="js/jquery.js"></script>
+ <!-- Bootstrap Core JavaScript -->
+ <script src="js/bootstrap.min.js"></script>
+ <script>
+ function share_its(seluri)
+ {
+ var uridata = seluri;
+ $("#button_share").val(uridata);
+ }
+ function sharedata()
+ {
+ var uri = $("#button_share").val();
+ window.opener.postMessage(uri, '*');
+ window.close();
+ }
+
+ </script>
+ </body>
+</html>
--- 'a/header.php'
+++ b/header.php
@@ -1,44 +1,44 @@
<!DOCTYPE html>
<html lang="en">
-<head>
+ <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="description" content="">
- <meta name="author" content="">
-
- <title>Bank Demo</title>
-
- <!-- Bootstrap Core CSS -->
- <link href="css/bootstrap.min.css" rel="stylesheet">
-
- <!-- Custom CSS -->
- <link href="css/style.css" rel="stylesheet">
-
- <!-- Custom Fonts -->
- <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
- <style>
- @media (min-width: 768px){
- .navbar-nav>li>a {
- font-size:11px;
- padding-top: 8px;
- padding-bottom: 0px;
- color: #fff;
- padding-bottom: 8px;
- }
- .navbar-nav>li>a:hover{ color: #000; background-color:#f0ede4;}
- }
- </style>
-
-</head>
-
-<body>
-
- <!-- Navigation -->
- <div class="container">
- <div class="navbar-header">
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="description" content="">
+ <meta name="author" content="">
+
+ <title>Bank Demo</title>
+
+ <!-- Bootstrap Core CSS -->
+ <link href="css/bootstrap.min.css" rel="stylesheet">
+
+ <!-- Custom CSS -->
+ <link href="css/style.css" rel="stylesheet">
+
+ <!-- Custom Fonts -->
+ <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
+ <style>
+ @media (min-width: 768px){
+ .navbar-nav>li>a {
+ font-size:11px;
+ padding-top: 8px;
+ padding-bottom: 0px;
+ color: #fff;
+ padding-bottom: 8px;
+ }
+ .navbar-nav>li>a:hover{ color: #000; background-color:#f0ede4;}
+ }
+ </style>
+
+ </head>
+
+ <body>
+
+ <!-- Navigation -->
+ <div class="container">
+ <div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
@@ -47,33 +47,28 @@
</button>
<a class="navbar-brand" href="index.html"><img src="images/digibank.png"></a>
</div>
- </div>
- <nav role="navigation" style="background-color: blueviolet; margin-bottom: 15px;height: 35px; position: relative;" >
- <div class="container">
- <!-- Brand and toggle get grouped for better mobile display -->
-
- <!-- Collect the nav links, forms, and other content for toggling -->
- <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
- <ul class="nav navbar-nav navbar-left ">
- <li>
- <a href="index.php">LINK TO DIGILOCKER</a>
- </li>
- <li>
- <a target="_blank" href="loanapproval.php">APPLY FOR LOAN</a>
- </li>
- <li>
- <a target="_blank" href="accountstatement.php">ACCOUNT STATEMENT</a>
- </li>
- <li>
- <a target="_blank" href="link_document.php">LINK-DOC INDRESH</a>
- </li>
- <li>
- <a target="_blank" href="index_indresh.php">LINK-DLOCK INDRESH</a>
- </li>
-
- </ul>
- </div>
- <!-- /.navbar-collapse -->
</div>
- <!-- /.container -->
- </nav>
\ No newline at end of file
+ <nav role="navigation" style="background-color: blueviolet; margin-bottom: 15px;height: 35px; position: relative;" >
+ <div class="container">
+ <!-- Brand and toggle get grouped for better mobile display -->
+
+ <!-- Collect the nav links, forms, and other content for toggling -->
+ <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
+ <ul class="nav navbar-nav navbar-left ">
+ <li>
+ <a href="index.php">LINK TO DIGILOCKER</a>
+ </li>
+ <li>
+ <a target="_blank" href="loanapproval.php">APPLY FOR LOAN</a>
+ </li>
+ <li>
+ <a target="_blank" href="accountstatement.php">ACCOUNT STATEMENT</a>
+ </li>
+
+
+ </ul>
+ </div>
+ <!-- /.navbar-collapse -->
+ </div>
+ <!-- /.container -->
+ </nav>
\ No newline at end of file
--- 'a/index.php'
+++ b/index.php
@@ -1,67 +1,76 @@
<?php include 'header.php' ?>
- <div class="container">
-
-
- <!-- Marketing Icons Section -->
- <div class="row">
-
- <div class="col-md-2">
- </div>
- <div class="col-md-8">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h4><i class="fa fa-fw fa-link"></i> Link to Digilocker</h4>
- </div>
- <div class="panel-body">
- <p>DigiLocker is Government of India's cloud based platform for issuance and verification of documents & certificates digitally. </p>
- <p>With DigiLocker, you can: </p>
- <ul class="custom-bullet">
- <li>Access your documents anytime, anywhere.</li>
- <li>Share documents digitally for verification.</li>
- <li>eSign documents (which is similar to self-attestation).</li>
-
- </ul>
- <a href="https://digilocker.gov.in/index.php" class="btn btn-default">Access Digilocker</a>
- </div>
+<div class="container">
+ <!-- Marketing Icons Section -->
+ <div class="row">
+ <div class="col-md-2">
+ </div>
+ <div class="col-md-8">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h4><i class="fa fa-fw fa-link"></i> Link to Digilocker</h4>
+ </div>
+ <div class="panel-body">
+ <p>DigiLocker is Government of India's cloud based platform for issuance and verification of documents & certificates digitally. </p>
+ <p>With DigiLocker, you can: </p>
+ <ul class="custom-bullet">
+ <li>Access your documents anytime, anywhere.</li>
+ <li>Share documents digitally for verification.</li>
+ <li>eSign documents (which is similar to self-attestation).</li>
+ </ul>
+ <form action = "https://developers.digitallocker.gov.in/public/oauth2/1/authorize" method = "GET" role="form">
+ <div class="form-group has-success" style="display:none">
+ <label class="control-label" for="inputSuccess">Response Type</label>
+ <input type="text" class="form-control" name = "response_type" value="code">
+ </div>
+ <div class="form-group has-success" style="display:none">
+ <label class="control-label" for="inputSuccess">Client ID</label>
+ <input type="text" class="form-control" name = "client_id" value="NIELN3M9">
+ </div>
+ <div class="form-group has-success" style="display:none">
+ <label class="control-label" for="inputSuccess">Redirect Uri</label>
+ <input type="text" class="form-control" name = "redirect_uri" value="http://localhost/digibank/loanapproval.php">
+ </div>
+ <div class="form-group has-success" style="display:none">
+ <label class="control-label" for="inputSuccess">State</label>
+ <input type="text" class="form-control" name = "state" value="123456">
+ </div>
+ <button type="submit" class="btn btn-default">Access Digilocker</button>
+ </form>
</div>
- </div>
- <div class="col-md-2">
</div>
</div>
- <div class="row">
-
- <div class="col-md-1">
- </div>
- <div class="col-md-10 outerborder">
- <div class="panel panel-default">
- <p class="para">
+ <div class="col-md-2">
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-1">
+ </div>
+ <div class="col-md-10 outerborder">
+ <div class="panel panel-default">
+ <p class="para">
Important security information:
- </p>
- </div>
- <div class="row">
- <ul class="custom-bullet">
-
- <li class="formrow">
- Before logging in, please ensure that the URL address on the address bar of your internet browser starts with <a href="#">demobank.gov.in.</a>
- </li>
- <li class="formrow">
- Never provide your User ID or password to any one on phone or in response to a mail.<a href="#"> Report a suspicious mail</a>.
- </li>
- <li class="formrow">
- Do not enter login or other sensitive information in any pop up window.
- </li>
- <li class="formrow">
- Verify the site's security certificate by clicking on the padlock icon of your internet browser. For more details, <a href="#">click here</a>.
- </li>
-
- </ul>
- </div>
+ </p>
</div>
- <div class="col-md-1">
+ <div class="row">
+ <ul class="custom-bullet">
+ <li class="formrow">
+ Before logging in, please ensure that the URL address on the address bar of your internet browser starts with <a href="#">demobank.gov.in.</a>
+ </li>
+ <li class="formrow">
+ Never provide your User ID or password to any one on phone or in response to a mail.<a href="#"> Report a suspicious mail</a>.
+ </li>
+ <li class="formrow">
+ Do not enter login or other sensitive information in any pop up window.
+ </li>
+ <li class="formrow">
+ Verify the site's security certificate by clicking on the padlock icon of your internet browser. For more details, <a href="#">click here</a>.
+ </li>
+ </ul>
</div>
</div>
- <!-- /.row -->
-
-
- </div>
- <?php include 'footer.php' ?>
\ No newline at end of file
+ <div class="col-md-1">
+ </div>
+ </div>
+ <!-- /.row -->
+</div>
+<?php include 'footer.php' ?>
\ No newline at end of file
--- 'a/loanapproval.php'
+++ b/loanapproval.php
@@ -1,7 +1,34 @@
-<?php include 'header.php' ?>
-
+<?php
+include 'header.php';
+$code = $_GET['code'];
+$state = $_GET['state'];
+$headers = array(
+ 'Content-Type:application/json'
+);
+$url = "https://developers.digitallocker.gov.in/public/oauth2/1/token";
+$post = array(
+ 'code' => $code,
+ 'grant_type' => 'authorization_code',
+ 'client_id' => 'NIELN3M9',
+ 'client_secret' => 'DQ3pWgCtB0I3EhSrtTXU',
+ 'redirect_uri' => 'http://localhost/digibank/loanapproval.php',
+);
+$vh = curl_init($url);
+curl_setopt($vh, CURLOPT_CUSTOMREQUEST, "POST");
+curl_setopt($vh, CURLOPT_POST, true);
+curl_setopt($vh, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
+curl_setopt($vh, CURLOPT_POSTFIELDS, $post);
+//curl_setopt($vh, CURLOPT_HTTPHEADER, $headers);
+curl_setopt($vh, CURLOPT_SSL_VERIFYPEER, 0);
+curl_setopt($vh, CURLOPT_SSL_VERIFYHOST, 0);
+curl_setopt($vh, CURLOPT_RETURNTRANSFER, true);
+$result = curl_exec($vh);
+curl_close($vh);
+$notgettingdata = explode('¿', $result);
+$getToken = json_decode($notgettingdata[1]);
+$access_token = $getToken->access_token;
+?>
<link href="css/jquery.datepick.css" rel="stylesheet">
-
<script src="js/jquery.min.js"></script>
<script src="js/jquery.plugin.js"></script>
<script src="js/jquery.datepick.js"></script>
@@ -15,9 +42,6 @@
alert('The date chosen is ' + date);
}
</script>
-
-
-
<div class="container">
<div class="col-lg-2"></div>
@@ -27,18 +51,12 @@
<h4><i class="fa fa-fw fa-bar-chart"></i> Loan Application Form</h4>
</div>
<div class="panel-body">
-
<form role="form">
-
<div class="col-lg-12">
-
-
<div class="col-lg-12 nor-font form-group">
<label style="font-weight:bold">Personal Details :</label>
<hr>
</div>
-
-
<div class="row">
<div class="col-lg-4 form-group">
<div class="col-lg-12 nor-font">
@@ -80,7 +98,6 @@
<div class="col-lg-3 form-group">
<div class="col-lg-12 nor-font">
<label>Date of Birth</label>
-
<input class="form-control height-form" type="text" id="popupDatepicker">
</div>
</div>
@@ -93,7 +110,7 @@
<div class="text-center">OR</div>
<div class="row">
<div class="col-lg-12">
- <a href="#">Upload from Digilocker</a>
+ <a href="#" onclick="docfetch();">Fetch Document Digilocker</a>
</div>
</div>
</div>
@@ -113,13 +130,10 @@
</div>
</div>
</div>
-
-
<div class="col-lg-12 nor-font form-group">
<label style="font-weight:bold">Address :</label>
<hr>
</div>
-
<div class="row">
<div class="col-lg-4 form-group">
<div class="col-lg-12 nor-font">
@@ -180,34 +194,31 @@
<div class="text-center">OR</div>
<div class="row">
<div class="col-lg-12">
- <a href="#">Upload from Digilocker</a>
+ <a href="#">Fetch Address Digilocker</a>
</div>
</div>
</div>
</div>
</div>
-
<div class="col-lg-12 text-center">
<button class="btn btn-default" type="submit">Submit</button>
<button class="btn btn-default" type="reset">Reset</button>
</div>
</div>
-
</form>
-
-
-
</div>
</div>
-
</div>
<div class="col-lg-2"></div>
-
<!-- /.row -->
-
-
</div>
<script type="text/javascript">
+ var accesstoken = '<?php echo $access_token; ?>';
+ function docfetch()
+ {
+ window.open('fetchdoc.php' + "?accesstoken=" + accesstoken + "", "_blank", "height=600,width=800,status=yes,scrollbars=yes,toolbar=no,menubar=no,location=no");
+
+ }
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
@@ -216,6 +227,14 @@
pageTracker._initData();
pageTracker._trackPageview();
</script>
-<script language="javascript" charset="UTF-8" type="text/javascript" src="js/stats.js"></script>
+<script language="javascript" charset="UTF-8" type="text/javascript" src="js/stats.js"></script>
+<script>
+ window.addEventListener("message", receiveMessage, false);
+function receiveMessage(event)
+{
+ alert(event.data);
+ // ...
+}
+</script>
<?php include 'footer.php' ?>
\ No newline at end of file