authpartner

Clone or download

folder navigation

Modified Files

M Downloads/pic1.jpg
+- −-
https://developers.digitallocker.gov.in/public/oauth2/1/files/issued/in.gov.digilocker-OTHER-3ff6fdc239da2fc8595042c83ff855e1
https://developers.digitallocker.gov.in/public/oauth2/1/files/issued/in.gov.digilocker-OTHER-3ff6fdc239da2fc8595042c83ff855e1
M browse.php
+0 −1
<?php
<?php
$fileBrowse = $_FILES['fileUpload']['tmp_name'];
$fileBrowse = $_FILES['fileUpload']['tmp_name'];
$filePath = $_POST['filePath']."/".$_FILES['fileUpload']['name'];
$filePath = $_POST['filePath']."/".$_FILES['fileUpload']['name'];
$access_token = $_POST['accessToken'];
$access_token = $_POST['accessToken'];
$fileContent = file_get_contents($fileBrowse);
$fileContent = file_get_contents($fileBrowse);
$finfo = new \finfo(FILEINFO_MIME_TYPE);
$finfo = new \finfo(FILEINFO_MIME_TYPE);
$mime = $finfo->buffer($fileContent);
$mime = $finfo->buffer($fileContent);
$client_secret = 'Pax7Rmv9uWo2KrNcXMtlDtsQN';
$client_secret = 'Pax7Rmv9uWo2KrNcXMtlDtsQN';
$hk = hash_hmac('sha256', $fileContent, $client_secret, true);
$hk = hash_hmac('sha256', $fileContent, $client_secret, true);
$hmac = base64_encode($hk);
$hmac = base64_encode($hk);
$ur = array('Content-Type: '.$mime, 'Authorization: Bearer ' . $access_token, 'path : '.$filePath, 'hmac : ' . $hmac . '');
$ur = array('Content-Type: '.$mime, 'Authorization: Bearer ' . $access_token, 'path : '.$filePath, 'hmac : ' . $hmac . '');
//$fileContent = file_get_contents($filePath);
$ch = curl_init();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://developers.digitallocker.gov.in/public/oauth2/1/file/upload");
curl_setopt($ch, CURLOPT_URL, "https://developers.digitallocker.gov.in/public/oauth2/1/file/upload");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_NOSIGNAL, 1);
curl_setopt($ch, CURLOPT_NOSIGNAL, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fileContent);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fileContent);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TCP_NODELAY, 1);
curl_setopt($ch, CURLOPT_TCP_NODELAY, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $ur);
curl_setopt($ch, CURLOPT_HTTPHEADER, $ur);
$output = curl_exec($ch);
$output = curl_exec($ch);
curl_close($ch);
curl_close($ch);
echo ' Your file has been uploaded';
echo ' Your file has been uploaded';
?>
?>
A doc - Copy.php
+253 −0
<?php
include 'header.php';
$code = $_GET['code'];
$state = $_GET['state'];
$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/doc.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;
$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_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($vhf, CURLOPT_HTTPHEADER, $headers);
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);
$headers = array(
'Authorization: Bearer ' . $access_token
//'Authorization: Basic '. base64_encode("$username:$password")
);
$urlissued = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/issued';
$vhi = curl_init($urlissued);
curl_setopt($vhi, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($vhi, CURLOPT_HTTPHEADER, $headers);
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);
?>
<div id="wrapper">
<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">
<tbody>
<tr>
<th>Name</th>
<th>Size</th>
<th>Date</th>
<th>Action</th>
</tr>
<div onclick="uriData(<?php echo $dataF['items'][0]['parent']; ?>)" >HOME</div>
<div id="parent"></div>
<?php
foreach ($dataF['items'] as $api_detail) {
if (isset($api_detail['id'])) {
$api_detail['id'] = $api_detail['id'];
$api_detail['parent'] = $api_detail['parent'];
} else {
$api_detail['id'] = "";
}
?>
<tr>
<?php /**
<a href="/digibank/uri.php?access_tocken=<?php echo $access_token; ?>&uri=<?php echo($api_detail['uri']); ?>&id=<?php echo($api_detail['id']); ?>"></a>
* * */ ?>
<td onclick="uriData(<?php echo $api_detail['id'] . ',' . $api_detail['parent']; ?>)" id="<?php echo $api_detail['id']; ?>">
<?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']);
}
?>
<div class="row">
<div class="col-md-10 col-md-offset1 dataTable1" style="display:none;">
<table class="table table-responsive table-striped" >
<thead>
</thead>
<tbody class="dataTable" id="div_<?php echo $api_detail['id']; ?>">
</tbody>
</table>
</div>
</div>
</td>
<td><?php echo($api_detail['size']); ?></td>
<td><?php echo($api_detail['date']); ?></td>
<?php if ($api_detail['type'] == "file") { ?>
<td>
<a href="download.php?accessToken=<?php echo $access_token; ?>&uri=<?php echo $api_detail['uri']; ?>&fileName=<?php echo $api_detail['name']; ?>" > <i class="fa fa-download"> </i></a>
</td>
<?php }
?>
</tr>
<?php }
?>
</tbody>
</table>
<div class="footer">
<a class="btn btn-default" style="float: right;" href="payment.php">Done</a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<div id="issueddocument" 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 ($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><?php if ($api_detail['type'] == "file") { ?>
<td>
<a href="download.php?accessToken=<?php echo $access_token; ?>&uri=<?php echo $issued_detail['uri']; ?>&fileName=<?php echo $issued_details['name']; ?>" > <i class="fa fa-download"> </i></a>
</td>
<?php } ?>
</tr>
<?php
endforeach;
?>
</table>
<div class="footer">
<a href="payment.php"><input type="button" class="btn btn-primary" value="Done" /></a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /.container-fluid -->
</div>
</div>
</body>
<?php include 'footer.php' ?>
<script>
function uriData(id, parent) {
alert(id);
alert(parent);
$(".dataTable").empty();
var id = id;
var accessTocken = "<?php echo $access_token; ?>";
var uri = "<?php echo $api_detail['uri']; ?>";
var uriDataHtml = "";
var fileOrFolder = "";
var accessToken = "<?php echo $access_token; ?>";
if (id != null) {
$.post("http://localhost/digibank/uri.php", {access_token: accessTocken, id: id}, function (result) {
$(".dataTable1").show();
$.each(result.items, function (i, l) {
if (result.items[i].type == "file") {
console.log(result.items);
fileOrFolder = "<i class='fa fa-file-o'></i> ";
} else {
fileOrFolder = "<i class='fa fa-folder-o'></i> ";
}
uriDataHtml += "<tr><th>" + fileOrFolder + result.items[i].name + "</th><th>" + result.items[i].type + "</th><th>" + result.items[i].date + "</th>\n\
<th>" + result.items[i].uri + "</th><th>\n\
<a href='download.php?accessToken=" + accessToken + "&uri=" + result.items[i].uri + "&fileName=" + result.items[i].name + "' > <i class='fa fa-download'> </i></a><th></tr>";
$("#div_" + id).html(uriDataHtml);
$("#parent").html("<td onclick=uriData(" + id + ")>" + result.directory + "</td>")
});
}, "json")
.fail(function () {
$(".dataTable1").hide();
});
} else {
alert('This is not a folder');
}
}
</script>
</html>
M doc.php
+75 −90
<?php
<?php
include 'header.php';
include 'header.php';
$code = $_GET['code'];
$code = $_GET['code'];
$state = $_GET['state'];
$state = $_GET['state'];
$url = "https://developers.digitallocker.gov.in/public/oauth2/1/token";
$url = "https://developers.digitallocker.gov.in/public/oauth2/1/token";
$post = array(
$post = array(
'code' => $code,
'code' => $code,
'grant_type' => 'authorization_code',
'grant_type' => 'authorization_code',
'client_id' => 'NIELN3M9',
'client_id' => 'NIELN3M9',
'client_secret' => 'DQ3pWgCtB0I3EhSrtTXU',
'client_secret' => 'DQ3pWgCtB0I3EhSrtTXU',
'redirect_uri' => 'http://localhost/digibank/doc.php',
'redirect_uri' => 'http://localhost/digibank/doc.php',
);
);
$vh = curl_init($url);
$vh = curl_init($url);
curl_setopt($vh, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($vh, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($vh, CURLOPT_POST, true);
curl_setopt($vh, CURLOPT_POST, true);
curl_setopt($vh, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($vh, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($vh, CURLOPT_POSTFIELDS, $post);
curl_setopt($vh, CURLOPT_POSTFIELDS, $post);
//curl_setopt($vh, CURLOPT_HTTPHEADER, $headers);
//curl_setopt($vh, CURLOPT_HTTPHEADER, $headers);
curl_setopt($vh, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($vh, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($vh, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($vh, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($vh, CURLOPT_RETURNTRANSFER, true);
curl_setopt($vh, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($vh);
$result = curl_exec($vh);
curl_close($vh);
curl_close($vh);
$notgettingdata = explode('¿', $result);
$notgettingdata = explode('¿', $result);
$getToken = json_decode($notgettingdata[1]);
$getToken = json_decode($notgettingdata[1]);
$access_token = $getToken->access_token;
$access_token = $getToken->access_token;
$headers = array(
$headers = array(
'Authorization: Bearer ' . $access_token
'Authorization: Bearer ' . $access_token
//'Authorization: Basic '. base64_encode("$username:$password")
//'Authorization: Basic '. base64_encode("$username:$password")
);
);
$urlFile = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/';
$urlFile = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/';
$vhf = curl_init($urlFile);
$vhf = curl_init($urlFile);
curl_setopt($vhf, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($vhf, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($vhf, CURLOPT_HTTPHEADER, $headers);
curl_setopt($vhf, CURLOPT_HTTPHEADER, $headers);
curl_setopt($vhf, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($vhf, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($vhf, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($vhf, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($vhf, CURLOPT_RETURNTRANSFER, true);
curl_setopt($vhf, CURLOPT_RETURNTRANSFER, true);
$resFile = curl_exec($vhf);
$resFile = curl_exec($vhf);
curl_close($vhf);
curl_close($vhf);
$resFileNew = explode('¿', $resFile);
$resFileNew = explode('¿', $resFile);
$dataF = json_decode($resFileNew[1], TRUE);
$dataF = json_decode($resFileNew[1], TRUE);
$headers = array(
$headers = array(
'Authorization: Bearer ' . $access_token
'Authorization: Bearer ' . $access_token
//'Authorization: Basic '. base64_encode("$username:$password")
//'Authorization: Basic '. base64_encode("$username:$password")
);
);
$urlissued = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/issued';
$urlissued = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/issued';
$vhi = curl_init($urlissued);
$vhi = curl_init($urlissued);
curl_setopt($vhi, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($vhi, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($vhi, CURLOPT_HTTPHEADER, $headers);
curl_setopt($vhi, CURLOPT_HTTPHEADER, $headers);
curl_setopt($vhi, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($vhi, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($vhi, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($vhi, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($vhi, CURLOPT_RETURNTRANSFER, true);
curl_setopt($vhi, CURLOPT_RETURNTRANSFER, true);
$resissued = curl_exec($vhi);
$resissued = curl_exec($vhi);
$resissuedErr = curl_error($vhi);
$resissuedErr = curl_error($vhi);
curl_close($vhi);
curl_close($vhi);
$issuedNew = explode('¿', $resissued);
$issuedNew = explode('¿', $resissued);
$dataI = json_decode($issuedNew[1], TRUE);
$dataI = json_decode($issuedNew[1], TRUE);
?>
?>
<div id="wrapper">
<div id="wrapper">
<div id="page-wrapper">
<div id="page-wrapper">
<div class="container-fluid">
<div class="container-fluid">
<!-- Page Heading -->
<!-- Page Heading -->
<div class="row">
<div class="row">
<div class="col-lg-12">
<div class="col-lg-12">
<div class="container">
<div class="container">
<ul class="nav nav-tabs">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#uploadeddocument">Uploaded Document</a></li>
<li class="active"><a data-toggle="tab" href="#uploadeddocument">Uploaded Document</a></li>
<li><a data-toggle="tab" href="#issueddocument">Issued Document</a></li>
<li><a data-toggle="tab" href="#issueddocument">Issued Document</a></li>
</ul>
</ul>
<div class="tab-content">
<div class="tab-content">
<div id="uploadeddocument" class="tab-pane fade in active">
<div id="uploadeddocument" class="tab-pane fade in active">
<section class="content">
<section class="content">
<div class="row">
<div class="row">
<div class="col-md-12">
<div class="col-md-12">
<div class="box box-primary">
<div class="box box-primary">
<div class="box box-body col-sm-12">
<div class="box box-body col-sm-12">
<div class="table-responsive">
<div class="table-responsive">
<table class="table">
<table class="table">
<thead>
<tbody>
<tr>
<tr>
<th>Name</th>
<th>Name</th>
<th>Size</th>
<th>Size</th>
<th>Date</th>
<th>Date</th>
<th>Action</th>
<th>Action</th>
</tr>
</tr>
<div onclick="uriData(<?php echo $dataF['items'][0]['parent']; ?>)" >close</div>
<div><b onclick="uriData(null, null)" >HOME</b><b id="parent"></b></div>
<?php
foreach ($dataF['items'] as $api_detail) {
if (isset($api_detail['id'])) {
$api_detail['id'] = $api_detail['id'];
$api_detail['parent'] = $api_detail['parent'];
} else {
$api_detail['id'] = "";
}
?>
<tr>
<?php /**
<a href="/digibank/uri.php?access_tocken=<?php echo $access_token; ?>&uri=<?php echo($api_detail['uri']); ?>&id=<?php echo($api_detail['id']); ?>"></a>
* * */ ?>
<td onclick="uriData(<?php echo $api_detail['id']; ?>)" id="<?php echo $api_detail['id']; ?>">
<?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']);
}
?>
<div class="row">
</thead>
<div class="col-md-10 col-md-offset1 dataTable1" style="display:none;">
<tbody id="folderPath">
<table class="table table-responsive table-striped" >
<thead>
</thead>
<?php
foreach ($dataF['items'] as $api_detail) {
<tbody class="dataTable" id="div_<?php echo $api_detail['id']; ?>">
if (isset($api_detail['id'])) {
$api_detail['id'] = $api_detail['id'];
</tbody>
$api_detail['parent'] = $api_detail['parent'];
</table>
} else {
</div>
$api_detail['id'] = "";
</div>
}
</td>
?>
<td><?php echo($api_detail['size']); ?></td>
<tr>
<td><?php echo($api_detail['date']); ?></td>
<?php /**
<?php if ($api_detail['type'] == "file") { ?>
<a href="/digibank/uri.php?access_tocken=<?php echo $access_token; ?>&uri=<?php echo($api_detail['uri']); ?>&id=<?php echo($api_detail['id']); ?>"></a>
<td>
* * */ ?>
<a href="download.php?accessToken=<?php echo $access_token; ?>&uri=<?php echo $api_detail['uri']; ?>&fileName=<?php echo $api_detail['name']; ?>" > <i class="fa fa-download"> </i></a>
<?php
</td>
if ($api_detail['type'] == "dir") {
echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
<?php }
echo "<i class='fa fa-folder-o'></i> ";
?>
echo($api_detail['name']);
</tr>
} elseif ($api_detail['type'] == "file") {
echo "<td onclick='thisIsNotAFolder()'>";
echo "<i class='fa fa-file-o'></i> ";
echo($api_detail['name']);
}
echo "</td>";
?>
<td><?php echo($api_detail['size']); ?></td>
<td><?php echo($api_detail['date']); ?></td>
<?php if ($api_detail['type'] == "file") { ?>
<td>
<a href="download.php?accessToken=<?php echo $access_token; ?>&uri=<?php echo $api_detail['uri']; ?>&fileName=<?php echo $api_detail['name']; ?>" > <i class="fa fa-download"> </i></a>
</td>
<?php }
?>
</tr>
<?php }
<?php }
?>
?>
</tbody>
</tbody>
</table>
</table>
<div class="footer">
<div class="footer">
<a class="btn btn-default" style="float: right;" href="payment.php">Done</a>
<a class="btn btn-default" style="float: right;" href="payment.php">Done</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</div>
<div id="issueddocument" class="tab-pane fade in active">
<div id="issueddocument" class="tab-pane">
<section class="content">
<section class="content">
<div class="row">
<div class="row">
<div class="col-md-12">
<div class="col-md-12">
<div class="box box-primary">
<div class="box box-primary">
<div class="box box-body col-sm-12">
<div class="box box-body col-sm-12">
<div class="table-responsive">
<div class="table-responsive">
<table class="table">
<table class="table">
<tr>
<tr>
<th>Name</th>
<th>Name</th>
<th>Size</th>
<th>Size</th>
<th>Date</th>
<th>Date</th>
</tr>
</tr>
<?php
<?php
foreach ($dataI['items'] as $issued_detail):
foreach ($dataI['items'] as $issued_detail):
?>
<tr><td>
<?php
echo "<i class='fa fa-file-o'></i> ";
echo($issued_detail['name']);
?>
?>
<tr><td>
<?php
echo "<i class='fa fa-file-o'></i> ";
echo($issued_detail['name']);
?>
</td>
</td>
<td><?php echo($issued_detail['size']); ?></td>
<td><?php echo($issued_detail['size']); ?></td>
<td><?php echo($issued_detail['date']); ?></td>
<td><?php echo($issued_detail['date']); ?></td>
<td><?php if ($api_detail['type'] == "file") { ?>
<td><?php if ($api_detail['type'] == "file") { ?>
<td>
<td>
<a href="download.php?accessToken=<?php echo $access_token; ?>&uri=<?php echo $issued_detail['uri']; ?>&fileName=<?php echo $issued_details['name']; ?>" > <i class="fa fa-download"> </i></a>
<a href="download.php?accessToken=<?php echo $access_token; ?>&uri=<?php echo $issued_detail['uri']; ?>&fileName=<?php echo $issued_details['name']; ?>" > <i class="fa fa-download"> </i></a>
</td>
</td>
<?php } ?>
<?php } ?>
</tr>
</tr>
<?php
<?php
endforeach;
endforeach;
?>
?>
</table>
</table>
<div class="footer">
<div class="footer">
<a href="payment.php"><input type="button" class="btn btn-primary" value="Done" /></a>
<a href="payment.php"><input type="button" class="btn btn-primary" value="Done" /></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /.container-fluid -->
<!-- /.container-fluid -->
</div>
</div>
</div>
</div>
</body>
</body>
<?php include 'footer.php' ?>
<?php include 'footer.php' ?>
<script>
<script>
function uriData(id) {
function uriData(id, parent) {
alert(id);
$("#folderPath").empty();
$(".dataTable").empty();
var id = id;
var id = id;
var accessTocken = "<?php echo $access_token; ?>";
var accessTocken = "<?php echo $access_token; ?>";
var uri = "<?php echo $api_detail['uri']; ?>";
var uri = "<?php echo $api_detail['uri']; ?>";
var uriDataHtml = "";
var uriDataHtml = "";
var fileOrFolder = "";
var fileOrFolder = "";
var onclickFnc = "";
var accessToken = "<?php echo $access_token; ?>";
var accessToken = "<?php echo $access_token; ?>";
if (id != null) {
$.post("http://localhost/digibank/uri.php", {access_token: accessTocken, id: id}, function (result) {
$(".dataTable1").show();
$.each(result.items, function (i, l) {
if (result.items[i].type == "file") {
$.post("http://localhost/digibank/uri.php", {access_token: accessTocken, id: id}, function (result) {
console.log(result.items);
$.each(result.items, function (i, l) {
fileOrFolder = "<i class='fa fa-file-o'></i> ";
} else {
if (result.items[i].type == "file") {
fileOrFolder = "<i class='fa fa-folder-o'></i> ";
console.log(result.items);
}
fileOrFolder = "<i class='fa fa-file-o'></i> ";
uriDataHtml += "<tr><th>" + fileOrFolder + result.items[i].name + "</th><th>" + result.items[i].type + "</th><th>" + result.items[i].date + "</th>\n\
onclickFnc = "onclick='thisIsNotAFolder()'";
} else {
fileOrFolder = "<i class='fa fa-folder-o'></i> ";
onclickFnc = "onclick='uriData(" + result.items[i].id + "," + result.items[i].parent + ")'";
}
uriDataHtml += "<tr><th " + onclickFnc + ">" + fileOrFolder + result.items[i].name + "</th><th>" + result.items[i].size + "</th><th>" + result.items[i].date + "</th>\n\
<th>" + result.items[i].uri + "</th><th>\n\
<th>" + result.items[i].uri + "</th><th>\n\
<a href='download.php?accessToken=" + accessToken + "&uri=" + result.items[i].uri + "&fileName=" + result.items[i].name + "' > <i class='fa fa-download'> </i></a><th></tr>";
<a href='download.php?accessToken=" + accessToken + "&uri=" + result.items[i].uri + "&fileName=" + result.items[i].name + "' > <i class='fa fa-download'> </i></a><th></tr>";
$("#div_" + id).html(uriDataHtml);
$("#folderPath").html(uriDataHtml);
});
//$("#parent").empty();
$("#parent").append("<i onclick=uriData(" + id + ",null)>" + result.directory + "</i>");
}, "json")
.fail(function () {
$("#folderPath").html("Some error found");
});
});
}, "json")
.fail(function () {
$(".dataTable1").hide();
});
}
} else {
function thisIsNotAFolder() {
alert('This is not a folder');
alert('This is not a folder');
}
}
}
</script>
</script>
</html>
</html>
M download.php
+0 −2
<?php
<?php
$headers = array(
$headers = array(
'Authorization: Bearer ' . $_GET['accessToken']
'Authorization: Bearer ' . $_GET['accessToken']
//'Authorization: Basic '. base64_encode("$username:$password")
//'Authorization: Basic '. base64_encode("$username:$password")
);
);
$uriFile = 'https://developers.digitallocker.gov.in/public/oauth2/1/file/' . $_GET['uri'];
$uriFile = 'https://developers.digitallocker.gov.in/public/oauth2/1/file/' . $_GET['uri'];
$uri = curl_init($uriFile);
$uri = curl_init($uriFile);
curl_setopt($uri, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($uri, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($uri, CURLOPT_HTTPHEADER, $headers);
curl_setopt($uri, CURLOPT_HTTPHEADER, $headers);
curl_setopt($uri, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($uri, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($uri, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($uri, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($uri, CURLOPT_RETURNTRANSFER, true);
curl_setopt($uri, CURLOPT_RETURNTRANSFER, true);
$urFile = curl_exec($uri);
$urFile = curl_exec($uri);
curl_close($uri);
curl_close($uri);
$file = file_put_contents("Downloads/" . $_GET['fileName'], $urFile);
$file = file_put_contents("Downloads/" . $_GET['fileName'], $urFile);
//return file_get_contents("http://".$_SERVER['HTTP_HOST']."/digibank/Downloads/".$_GET['fileName']);
//return file_get_contents("http://".$_SERVER['HTTP_HOST']."/digibank/Downloads/".$_GET['fileName']);
echo "Your File hase been downloaded please <a href='/digibank/Downloads/" . $_GET['fileName'] . "' download>Click Here</a> to view your document";
echo "Your File hase been downloaded please <a href='/digibank/Downloads/" . $_GET['fileName'] . "' download>Click Here</a> to view your document";
?>
?>
M payment.php
+0 −28
<?php include 'header.php' ?>
<?php include 'header.php' ?>
<div class="container">
<div class="container">
<div class="col-lg-2"></div>
<div class="col-lg-2"></div>
<div class="col-lg-8">
<div class="col-lg-8">
<div class="panel panel-default">
<div class="panel panel-default">
<div class="panel-heading">
<div class="panel-heading">
<h4><i class="fa fa-fw fa-link"></i>Payment</h4>
<h4><i class="fa fa-fw fa-link"></i>Payment</h4>
</div>
</div>
<div class="panel-body">
<div class="panel-body">
<form role="form">
<form role="form">
<script src='https://js.stripe.com/v2/' type='text/javascript'></script>
<script src='https://js.stripe.com/v2/' type='text/javascript'></script>
<fohttp://bootsnipp.com/snippets/featured/payment-receipt-bs3rm accept-charset="UTF-8" action="/" class="require-validation" data-cc-on-file="false" data-stripe-publishable-key="pk_bQQaTxnaZlzv4FnnuZ28LFHccVSaj" id="payment-form" method="post">
<fohttp://bootsnipp.com/snippets/featured/payment-receipt-bs3rm accept-charset="UTF-8" action="/" class="require-validation" data-cc-on-file="false" data-stripe-publishable-key="pk_bQQaTxnaZlzv4FnnuZ28LFHccVSaj" id="payment-form" method="post">
<div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" />
<div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" />
<input name="_method" type="hidden" value="PUT" />
<input name="_method" type="hidden" value="PUT" />
<input name="authenticity_token" type="hidden" value="qLZ9cScer7ZxqulsUWazw4x3cSEzv899SP/7ThPCOV8=" /></div>
<input name="authenticity_token" type="hidden" value="qLZ9cScer7ZxqulsUWazw4x3cSEzv899SP/7ThPCOV8=" /></div>
<div class='form-row'>
<div class='form-row'>
<div class='col-xs-12 form-group required'>
<div class='col-xs-12 form-group required'>
<label class='control-label'>Name on Card</label>
<label class='control-label'>Name on Card</label>
<input class='form-control' value="Sanjay Singh" size='4' type='text'>
<input class='form-control' value="Sanjay Singh" size='4' type='text'>
</div>
</div>
</div>
</div>
<div class='form-row'>
<div class='form-row'>
<div class='col-xs-12 form-group card required'>
<div class='col-xs-12 form-group card required'>
<label class='control-label'>Card Number</label>
<label class='control-label'>Card Number</label>
<input autocomplete='off' value="5196200080652015" class='form-control card-number' size='20' type='text'>
<input autocomplete='off' value="5196200080652015" class='form-control card-number' size='20' type='text'>
</div>
</div>
</div>
</div>
<div class='form-row'>
<div class='form-row'>
<div class='col-xs-4 form-group cvc required'>
<div class='col-xs-4 form-group cvc required'>
<label class='control-label'>CVC</label>
<label class='control-label'>CVC</label>
<input autocomplete='off' value="708" class='form-control card-cvc' placeholder='ex. 2021' size='4' type='text'>
<input autocomplete='off' value="708" class='form-control card-cvc' placeholder='ex. 2021' size='4' type='text'>
</div>
</div>
<div class='col-xs-4 form-group expiration required'>
<div class='col-xs-4 form-group expiration required'>
<label class='control-label'>Expiration</label>
<label class='control-label'>Expiration</label>
<input class='form-control card-expiry-month' placeholder='MM' value="02" size='2' type='text'>
<input class='form-control card-expiry-month' placeholder='MM' value="02" size='2' type='text'>
</div>
</div>
<div class='col-xs-4 form-group expiration required'>
<div class='col-xs-4 form-group expiration required'>
<label class='control-label'> </label>
<label class='control-label'> </label>
<input class='form-control card-expiry-year' placeholder='YYYY' value="2017" size='4' type='text'>
<input class='form-control card-expiry-year' placeholder='YYYY' value="2017" size='4' type='text'>
</div>
</div>
</div>
</div>
<div class='form-row'>
<div class='form-row'>
<div class='col-md-12'>
<div class='col-md-12'>
<div class='form-control total btn btn-info'>
<div class='form-control total btn btn-info'>
Ammount:
Ammount:
<span class='amount'>Rs.10</span>
<span class='amount'>Rs.10</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='form-row'>
<div class='form-row'>
<div class='col-md-12 form-group'>
<div class='col-md-12 form-group'>
<a href="loanapproval.php"><input type="button" class="btn btn-primary" value="Pay" /></a>
<a href="loanapproval.php"><input type="button" class="btn btn-primary" value="Pay" /></a>
</div>
</div>
</div>
</div>
<div class='form-row'>
<div class='form-row'>
<div class='col-md-12 error form-group hide'>
<div class='col-md-12 error form-group hide'>
<div class='alert-danger alert'>
<div class='alert-danger alert'>
Please correct the errors and try again.
Please correct the errors and try again.
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</form>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-2"></div>
<div class="col-lg-2"></div>
<!-- /.row -->
<!-- /.row -->
</div>
<script src="js/jquery.js"></script>
<script src="js/jquery.js"></script>
<script>
var dls_server = 'https://developers.digitallocker.gov.in/public/oauth2/1/authorize';
$('.dl_pop').click(function () {
CallDL('code', '7QAKRAJO', '123456', 'http://localhost/curlexample/response.php');
});
function CallDL(requester_id, hash_key, time_st, hostname) {
window.open(dls_server + "?response_type=" + requester_id + "&client_id=" + hash_key + "&state=" + time_st + "&redirect_uri=" + hostname, "_blank", "height=500,width=600,status=yes,toolbar=no,menubar=no,location=no");
}
</script>
<?php include 'footer.php' ?>
<?php include 'footer.php' ?>
M upload.php
+0 −1
<?php include 'header.php' ?>
<?php include 'header.php' ?>
<div class="container">
<div class="container">
<!-- Marketing Icons Section -->
<!-- Marketing Icons Section -->
<div class="row">
<div class="row">
<div class="col-md-2">
<div class="col-md-2">
</div>
</div>
<div class="col-md-8">
<div class="col-md-8">
<div class="panel panel-default">
<div class="panel panel-default">
<div class="panel-heading">
<div class="panel-heading">
<h4><i class="fa fa-fw fa-link"></i>Upload</h4>
<h4><i class="fa fa-fw fa-link"></i>Upload</h4>
</div>
</div>
<div class="panel-body">
<div class="panel-body">
<p>DigiLocker is Government of India's cloud based platform for issuance and verification of documents &amp; certificates digitally. </p>
<p>DigiLocker is Government of India's cloud based platform for issuance and verification of documents &amp; certificates digitally. </p>
<p>With DigiLocker, you can: </p>
<p>With DigiLocker, you can: </p>
<ul class="custom-bullet">
<ul class="custom-bullet">
<li>Access your documents anytime, anywhere.</li>
<li>Access your documents anytime, anywhere.</li>
<li>Share documents digitally for verification.</li>
<li>Share documents digitally for verification.</li>
<li>eSign documents (which is similar to self-attestation).</li>
<li>eSign documents (which is similar to self-attestation).</li>
</ul>
</ul>
<form action = "https://developers.digitallocker.gov.in/public/oauth2/1/authorize" method = "GET" role="form">
<form action = "https://developers.digitallocker.gov.in/public/oauth2/1/authorize" method = "GET" role="form">
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Response Type</label>
<label class="control-label" for="inputSuccess">Response Type</label>
<input type="text" class="form-control" name = "response_type" value="code">
<input type="text" class="form-control" name = "response_type" value="code">
</div>
</div>
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Client ID</label>
<label class="control-label" for="inputSuccess">Client ID</label>
<input type="text" class="form-control" name = "client_id" value="7QAKRAJO">
<input type="text" class="form-control" name = "client_id" value="7QAKRAJO">
</div>
</div>
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Redirect Uri</label>
<label class="control-label" for="inputSuccess">Redirect Uri</label>
<input type="text" class="form-control" name = "redirect_uri" value="http://localhost/digibank/uploaddoc.php">
<input type="text" class="form-control" name = "redirect_uri" value="http://localhost/digibank/uploaddoc.php">
</div>
</div>
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">State</label>
<label class="control-label" for="inputSuccess">State</label>
<input type="text" class="form-control" name = "state" value="123456">
<input type="text" class="form-control" name = "state" value="123456">
</div>
</div>
<!--- <a href="uploaddoc.php"><input type="button" class="btn btn-primary" value="Submit" /></a>-->
<!--- <a href="uploaddoc.php"><input type="button" class="btn btn-primary" value="Submit" /></a>-->
<button type="submit" class="btn btn-default">Access Digilocker</button>
<button type="submit" class="btn btn-default">Access Digilocker</button>
</form>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-2">
<div class="col-md-2">
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /.row -->
<!-- /.row -->
</div>
</div>
<?php include 'footer.php' ?>
<?php include 'footer.php' ?>
M uploaddoc.php
+0 −2
<?php
<?php
include 'header.php';
include 'header.php';
$code = $_GET['code'];
$code = $_GET['code'];
$state = $_GET['state'];
$state = $_GET['state'];
$url = "https://developers.digitallocker.gov.in/public/oauth2/1/token";
$url = "https://developers.digitallocker.gov.in/public/oauth2/1/token";
$post = array(
$post = array(
'code' => $code,
'code' => $code,
'grant_type' => 'authorization_code',
'grant_type' => 'authorization_code',
'client_id' => '7QAKRAJO',
'client_id' => '7QAKRAJO',
'client_secret' => 'Pax7Rmv9uWo2KrNcXMtlDtsQN',
'client_secret' => 'Pax7Rmv9uWo2KrNcXMtlDtsQN',
'redirect_uri' => 'http://localhost/digibank/uploaddoc.php',
'redirect_uri' => 'http://localhost/digibank/uploaddoc.php',
);
);
$vh = curl_init($url);
$vh = curl_init($url);
curl_setopt($vh, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($vh, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($vh, CURLOPT_POST, true);
curl_setopt($vh, CURLOPT_POST, true);
curl_setopt($vh, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($vh, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($vh, CURLOPT_POSTFIELDS, $post);
curl_setopt($vh, CURLOPT_POSTFIELDS, $post);
//curl_setopt($vh, CURLOPT_HTTPHEADER, $headers);
//curl_setopt($vh, CURLOPT_HTTPHEADER, $headers);
curl_setopt($vh, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($vh, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($vh, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($vh, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($vh, CURLOPT_RETURNTRANSFER, true);
curl_setopt($vh, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($vh);
$result = curl_exec($vh);
curl_close($vh);
curl_close($vh);
$notgettingdata = explode('¿', $result);
$notgettingdata = explode('¿', $result);
$getToken = json_decode($notgettingdata[1]);
$getToken = json_decode($notgettingdata[1]);
$access_token = $getToken->access_token;
$access_token = $getToken->access_token;
$headers = array(
$headers = array(
'Authorization: Bearer ' . $access_token
'Authorization: Bearer ' . $access_token
//'Authorization: Basic '. base64_encode("$username:$password")
//'Authorization: Basic '. base64_encode("$username:$password")
);
);
$urlFile = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/';
$urlFile = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/';
$vhf = curl_init($urlFile);
$vhf = curl_init($urlFile);
curl_setopt($vhf, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($vhf, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($vhf, CURLOPT_HTTPHEADER, $headers);
curl_setopt($vhf, CURLOPT_HTTPHEADER, $headers);
curl_setopt($vhf, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($vhf, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($vhf, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($vhf, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($vhf, CURLOPT_RETURNTRANSFER, true);
curl_setopt($vhf, CURLOPT_RETURNTRANSFER, true);
$resFile = curl_exec($vhf);
$resFile = curl_exec($vhf);
curl_close($vhf);
curl_close($vhf);
$resFileNew = explode('¿', $resFile);
$resFileNew = explode('¿', $resFile);
$dataF = json_decode($resFileNew[1], TRUE);
$dataF = json_decode($resFileNew[1], TRUE);
?>
?>
<div class="container">
<div class="container">
<!-- Marketing Icons Section -->
<!-- Marketing Icons Section -->
<div class="row">
<div class="row">
<div class="col-md-1">
<div class="col-md-1">
</div>
</div>
<div class="col-md-10 outerborder">
<div class="col-md-10 outerborder">
<div class="panel panel-default">
<div class="panel panel-default">
<p class="para">
<p class="para">
Important security information:
Important security information:
</p>
</p>
</div>
</div>
<div class="row">
<div class="row">
<ul class="custom-bullet">
<ul class="custom-bullet">
<li class="formrow">
<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>
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>
<li class="formrow">
<li class="formrow">
Never provide your User ID or password to any one on phone or in response to a mail.<a href="#">&nbsp;Report a suspicious mail</a>.
Never provide your User ID or password to any one on phone or in response to a mail.<a href="#">&nbsp;Report a suspicious mail</a>.
</li>
</li>
<li class="formrow">
<li class="formrow">
Do not enter login or other sensitive information in any pop up window.
Do not enter login or other sensitive information in any pop up window.
</li>
</li>
<li class="formrow">
<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>.
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>
</li>
</ul>
</ul>
</div>
</div>
</div>
</div>
<div class="col-md-1">
<div class="col-md-1">
</div>
</div>
</div>
</div>
<div class="row">
<div class="row">
<div class="col-md-1">
<div class="col-md-1">
</div>
</div>
<div class="col-md-2">
<div class="col-md-2">
<form action="browse.php" method="post" enctype="multipart/form-data">
<form action="browse.php" method="post" enctype="multipart/form-data">
<input type="text" value="<?php echo $access_token; ?>" name="accessToken" class="hidden"/>
<input type="text" value="<?php echo $access_token; ?>" name="accessToken" class="hidden"/>
<input type="file" id="fileUpload" name="fileUpload"/>
<input type="file" id="fileUpload" name="fileUpload"/>
<select name="filePath">
<select name="filePath">
<?php
<?php
$itm = "";
$itm = "";
$i = 0;
$i = 0;
foreach ($dataF['items'] as $items) {
foreach ($dataF['items'] as $items) {
if ($items['type'] == "dir") {
if ($items['type'] == "dir") {
$itm .= "<option value='" . $items['name'] . "'>" . $items['name'] . "</option>";
$itm .= "<option value='" . $items['name'] . "'>" . $items['name'] . "</option>";
}
}
}
}
echo "<option value='' selected='selected'>-Select-</option>" . $itm;
echo "<option value='' selected='selected'>-Select-</option>" . $itm;
?>
?>
</select>
</select>
<input type="submit" name="submit" value="Upload image" />
<input type="submit" name="submit" value="Upload image" />
</form>
</form>
</div>
</div>
<div class="col-md-1">
<div class="col-md-1">
</div>
</div>
</div>
</div>
<!-- /.row -->
<!-- /.row -->
</div>
</div>
<?php include 'footer.php' ?>
<?php include 'footer.php' ?>