authpartner

Clone or download

error handling

Modified Files

M doc.php
+4 −0
<?php
<?php
include 'config.php';
include 'config.php';
if(isset($_GET['error_description'])){
header("Location: index.php?message=".$_GET['error_description']);
exit;
}
$code = $_GET['code'];
$code = $_GET['code'];
$state = $_GET['state'];
$state = $_GET['state'];
$url = $config['access_token_download'];
$url = $config['access_token_download'];
$post = array(
$post = array(
'code' => $code,
'code' => $code,
'grant_type' => 'authorization_code',
'grant_type' => 'authorization_code',
'client_id' => $config['client_id_download'],
'client_id' => $config['client_id_download'],
'client_secret' => $config['client_secret_download'],
'client_secret' => $config['client_secret_download'],
'redirect_uri' => $config['download_redirect_uri'],
'redirect_uri' => $config['download_redirect_uri'],
);
);
$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_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);
if(!$notgettingdata[1]){
if(!$notgettingdata[1]){
header("Location: index.php?message=THIS IS ERROR");
header("Location: index.php?message=THIS IS ERROR");
}
}
$getToken = json_decode($notgettingdata[1]);
$getToken = json_decode($notgettingdata[1]);
if (isset($getToken->access_token)) {
if (isset($getToken->access_token)) {
$access_token = $getToken->access_token;
$access_token = $getToken->access_token;
}
}
if (isset($access_token)) {
if (isset($access_token)) {
$doc = new DOMDocument('1.0');
$doc = new DOMDocument('1.0');
$doc->formatOutput = true;
$doc->formatOutput = true;
$doc = new DOMDocument('1.0');
$doc = new DOMDocument('1.0');
$doc->formatOutput = true;
$doc->formatOutput = true;
$root = $doc->createElement('maincontent');
$root = $doc->createElement('maincontent');
$root = $doc->appendChild($root);
$root = $doc->appendChild($root);
$title = $doc->createElement('code');
$title = $doc->createElement('code');
$title = $root->appendChild($title);
$title = $root->appendChild($title);
$enclosure = $doc->createAttribute('num');
$enclosure = $doc->createAttribute('num');
$enclosure->value = $code;
$enclosure->value = $code;
$title->appendChild($enclosure);
$title->appendChild($enclosure);
$title = $doc->createElement('access_token');
$title = $doc->createElement('access_token');
$title = $root->appendChild($title);
$title = $root->appendChild($title);
$text = $doc->createTextNode($access_token);
$text = $doc->createTextNode($access_token);
$text = $title->appendChild($text);
$text = $title->appendChild($text);
$doc->save("xml/hashKey.xml");
$doc->save("xml/hashKey.xml");
}
}
if (file_exists("xml/hashKey.xml")) {
if (file_exists("xml/hashKey.xml")) {
$xml = (array) simplexml_load_file("xml/hashKey.xml") or die("Error: Cannot create object");
$xml = (array) simplexml_load_file("xml/hashKey.xml") or die("Error: Cannot create object");
} else {
} else {
echo "xml/hashKey.xml file doesnot exists";
echo "xml/hashKey.xml file doesnot exists";
}
}
$access_token = $xml['access_token'];
$access_token = $xml['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 = $config['file_uri'];
$urlFile = $config['file_uri'];
$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);
$uriRes = json_decode($resFileNew[1]);
$uriRes = json_decode($resFileNew[1]);
if(isset($uriRes->error) || !$resFileNew){
if(isset($uriRes->error) || !$resFileNew){
header("Location: index.php?message=".$uriRes->error_description);
header("Location: index.php?message=".$uriRes->error_description);
exit;
exit;
}
}
$uriDir = array();
$uriDir = array();
$uriFiles = array();
$uriFiles = array();
foreach ($uriRes->items as $uriI) {
foreach ($uriRes->items as $uriI) {
if ($uriI->type == "dir") {
if ($uriI->type == "dir") {
$uriDir[] = (array) $uriI;
$uriDir[] = (array) $uriI;
} else {
} else {
$uriFiles[] = (array) $uriI;
$uriFiles[] = (array) $uriI;
}
}
}
}
$uriItems = array_merge($uriDir, $uriFiles);
$uriItems = array_merge($uriDir, $uriFiles);
$uriItemsArray['items'] = $uriItems;
$uriItemsArray['items'] = $uriItems;
$dataDirectory['directory'] = $uriRes->directory;
$dataDirectory['directory'] = $uriRes->directory;
$dataF = array_merge($dataDirectory, $uriItemsArray);
$dataF = array_merge($dataDirectory, $uriItemsArray);
$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 = $config['issued_doc_url'];
$urlissued = $config['issued_doc_url'];
$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);
include 'header.php';
include 'header.php';
?>
?>
<div class="se-pre-con"></div>
<div class="se-pre-con"></div>
<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"><img src="images/uploaded_files.png">Uploaded Document</a></li>
<li class="active"><a data-toggle="tab" href="#uploadeddocument"><img src="images/uploaded_files.png">Uploaded Document</a></li>
<li><a data-toggle="tab" href="#issueddocument" ><img src="images/issuedfile.png">Issued Document</a></li>
<li><a data-toggle="tab" href="#issueddocument" ><img src="images/issuedfile.png">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-body" style="min-height: 385px;">
<div class="box box-body" style="min-height: 385px;">
<div class="table-responsive">
<div class="table-responsive">
<table class="table">
<table class="table">
<thead style="color:blueviolet;">
<thead style="color:blueviolet;">
<tr id="trheading">
<tr id="trheading">
<td>Name</td>
<td>Name</td>
<td>Size</td>
<td>Size</td>
<td>Date</td>
<td>Date</td>
<td id="tdUri" style="display:none;">URI</td>
<td id="tdUri" style="display:none;">URI</td>
</tr>
</tr>
<div>
<div>
<span onclick="uriData(null, null)" class="fa fa-home fa-2x" style="color:blueviolet; cursor:pointer; cursor:hand"></span>
<span onclick="uriData(null, null)" class="fa fa-home fa-2x" style="color:blueviolet; cursor:pointer; cursor:hand"></span>
<span id="parent" style="color:blueviolet; font-size: 16px; cursor:pointer; cursor:hand"></span>
<span id="parent" style="color:blueviolet; font-size: 16px; cursor:pointer; cursor:hand"></span>
</div>
</div>
</thead>
</thead>
<tbody id="folderPath">
<tbody id="folderPath">
<?php
<?php
foreach ((array) ($dataF['items']) as $api_detail) {
foreach ((array) ($dataF['items']) as $api_detail) {
if (isset($api_detail['id'])) {
if (isset($api_detail['id'])) {
$api_detail['id'] = $api_detail['id'];
$api_detail['id'] = $api_detail['id'];
$api_detail['parent'] = $api_detail['parent'];
$api_detail['parent'] = $api_detail['parent'];
} else {
} else {
$api_detail['id'] = "";
$api_detail['id'] = "";
}
}
?>
?>
<tr>
<tr>
<?php
<?php
if (($api_detail['type']) == "dir") {
if (($api_detail['type']) == "dir") {
echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
echo '<img src="images/folder.svg"></img>';
echo '<img src="images/folder.svg"></img>';
echo($api_detail['name']);
echo($api_detail['name']);
echo "</td>";
echo "</td>";
}
}
if ($api_detail['type'] == "file") {
if ($api_detail['type'] == "file") {
echo "<td>";
echo "<td>";
echo '<img src="images/file.svg"></img>';
echo '<img src="images/file.svg"></img>';
echo($api_detail['name']);
echo($api_detail['name']);
echo "</td>";
echo "</td>";
}
}
?>
?>
<td><?php echo($api_detail['size']); ?></td>
<td><?php echo($api_detail['size']); ?></td>
<td><?php echo date("d-m-Y", strtotime($api_detail['date'])); ?></td>
<td><?php echo date("d-m-Y", strtotime($api_detail['date'])); ?></td>
<?php if ($api_detail['type'] == "file") { ?>
<?php if ($api_detail['type'] == "file") { ?>
<td>
<td>
<i onclick="download('<?php echo($api_detail['uri'] . ',' . $api_detail['name']); ?>')" class="fa fa-download"> </i>
<i onclick="download('<?php echo($api_detail['uri'] . ',' . $api_detail['name']); ?>')" class="fa fa-download"> </i>
</td>
</td>
<?php }else{
<?php }else{
echo "<td></td>";
echo "<td></td>";
}
}
?>
?>
</tr>
</tr>
<?php }
<?php }
?>
?>
</tbody>
</tbody>
</table>
</table>
<div class="footer">
<div class="footer">
<a class="btn btn-default" style="float: right; margin-left: 10px; border-radius:5px;" href="payment.php">Complete Payment</a>
<a class="btn btn-default" style="float: right; margin-left: 10px; border-radius:5px;" href="payment.php">Complete Payment</a>
<a class="btn btn-default" style="float: right; border-radius:5px;" href="tokan.php">Cancel</a>
<a class="btn btn-default" style="float: right; border-radius:5px;" href="tokan.php">Cancel</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</div>
<div id="issueddocument" class="tab-pane">
<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-body" style="min-height: 385px;">
<div class="box box-body" style="min-height: 385px;">
<table class="table table-responsive">
<table class="table table-responsive">
<thead style="color:#1569C7">
<thead style="color:#1569C7">
<tr>
<tr>
<td>Name</td>
<td>Name</td>
<td>URI</td>
<td>URI</td>
<td>Created On</td>
<td>Created On</td>
</tr>
</tr>
</thead>
</thead>
<?php
<?php
foreach ((array) ($dataI['items']) as $issued_detail):
foreach ((array) ($dataI['items']) as $issued_detail):
?>
?>
<tr><td>
<tr><td>
<?php
<?php
echo '<img src="images/issuedfile.png"></img>';
echo '<img src="images/issuedfile.png"></img>';
echo($issued_detail['name']);
echo($issued_detail['name']);
?>
?>
</td>
</td>
<td><?php echo($issued_detail['uri']); ?></td>
<td><?php echo($issued_detail['uri']); ?></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>
<i onclick="download('<?php echo($issued_detail['uri'] . ',' . $issued_detail['name']); ?>')" class="fa fa-download"> </i>
<i onclick="download('<?php echo($issued_detail['uri'] . ',' . $issued_detail['name']); ?>')" class="fa fa-download"> </i>
</td>
</td>
<?php } ?>
<?php } ?>
</tr>
</tr>
<?php
<?php
endforeach;
endforeach;
?>
?>
</table>
</table>
<div class="footer">
<div class="footer">
<a class="btn btn-default" style="float: right; margin-left: 10px; border-radius:5px;" href="payment.php">Complete Payment</a>
<a class="btn btn-default" style="float: right; margin-left: 10px; border-radius:5px;" href="payment.php">Complete Payment</a>
<a class="btn btn-default" style="float: right; border-radius:5px;" href="tokan.php">Cancel</a>
<a class="btn btn-default" style="float: right; border-radius:5px;" href="tokan.php">Cancel</a>
</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 src="js/modernizr.js"></script>
<script src="js/modernizr.js"></script>
<script>
<script>
function uriData(id, parent) {
function uriData(id, parent) {
$("#folderPath").empty();
$("#folderPath").empty();
$("#tdUri").show();
$("#tdUri").show();
$(".se-pre-con").show();
$(".se-pre-con").show();
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 onclickFnc = "";
var dwnldTd = "";
var dwnldTd = "";
var accessToken = "<?php echo $access_token; ?>";
var accessToken = "<?php echo $access_token; ?>";
var urifnc = "<?php echo $config['uri_path']; ?>";
var urifnc = "<?php echo $config['uri_path']; ?>";
$.post(urifnc, {access_token: accessTocken, id: id}, function (result) {
$.post(urifnc, {access_token: accessTocken, id: id}, function (result) {
$.each(result.items, function (i, l) {
$.each(result.items, function (i, l) {
if (result.items[i].type == "file") {
if (result.items[i].type == "file") {
console.log(result.items);
console.log(result.items);
fileOrFolder = '<img src="images/file.svg"></img>';
fileOrFolder = '<img src="images/file.svg"></img>';
onclickFnc = "onclick='thisIsNotAFolder()'";
onclickFnc = "onclick='thisIsNotAFolder()'";
dwnldTd = "<td><i onclick = 'download(\"" + result.items[i].uri + "\",\"" + result.items[i].name + "\");'; class='fa fa-download'> </i></td>";
dwnldTd = "<td><i onclick = 'download(\"" + result.items[i].uri + "\",\"" + result.items[i].name + "\");'; class='fa fa-download'> </i></td>";
} else {
} else {
fileOrFolder = '<img src="images/folder.svg"></img>';
fileOrFolder = '<img src="images/folder.svg"></img>';
onclickFnc = "onclick='uriData(" + result.items[i].id + "," + result.items[i].parent + ")'";
onclickFnc = "onclick='uriData(" + result.items[i].id + "," + result.items[i].parent + ")'";
dwnldTd = "<td></td>";
dwnldTd = "<td></td>";
}
}
var date = new Date(result.items[i].date);
var date = new Date(result.items[i].date);
var dateformate = date.getDate()+'-'+(date.getMonth()+1) + '-' + date.getFullYear();
var dateformate = date.getDate()+'-'+(date.getMonth()+1) + '-' + date.getFullYear();
uriDataHtml += "<tr><td " + onclickFnc + ">" + fileOrFolder + result.items[i].name + "</td><td>" + result.items[i].size + "</td><td>" + dateformate + "</td>\n\
uriDataHtml += "<tr><td " + onclickFnc + ">" + fileOrFolder + result.items[i].name + "</td><td>" + result.items[i].size + "</td><td>" + dateformate + "</td>\n\
<td>" + result.items[i].uri + "</td>" + dwnldTd + "</tr>";
<td>" + result.items[i].uri + "</td>" + dwnldTd + "</tr>";
$("#folderPath").html(uriDataHtml);
$("#folderPath").html(uriDataHtml);
});
});
$(".footer").show();
$(".footer").show();
$("#trheading").show();
$("#trheading").show();
if((result.items).length==0){
if((result.items).length==0){
$(".footer").hide();
$(".footer").hide();
$("#trheading").hide();
$("#trheading").hide();
$("#folderPath").html("<tr><th colspan='4' style='text-align: center;'><h4>No document uploaded yet</h4></br><p>Upload some of your own documents or certificates!</p></th></tr>");
$("#folderPath").html("<tr><th colspan='4' style='text-align: center;'><h4>No document uploaded yet</h4></br><p>Upload some of your own documents or certificates!</p></th></tr>");
}
}
$("#parent").html("<span onclick=uriData(" + parent + ",null) >" + result.directory + "</span>");
$("#parent").html("<span onclick=uriData(" + parent + ",null) >" + result.directory + "</span>");
$(".se-pre-con").hide();
$(".se-pre-con").hide();
}, "json")
}, "json")
.fail(function () {
.fail(function () {
$("#folderPath").html("some error found!");
$("#folderPath").html("some error found!");
$(".se-pre-con").hide();
$(".se-pre-con").hide();
});
});
}
}
function download(uris, filename) {
function download(uris, filename) {
$(".se-pre-con").show();
$(".se-pre-con").show();
var getdata = uris.split(",");
var getdata = uris.split(",");
var uri = getdata[0];
var uri = getdata[0];
var filename = getdata[1];
var filename = getdata[1];
var accessTocken = "<?php echo $access_token; ?>";
var accessTocken = "<?php echo $access_token; ?>";
var dlscfnc = "<?php echo $config['dlsc_path']; ?>"
var dlscfnc = "<?php echo $config['dlsc_path']; ?>"
var arraydata = {uri: uri, accesstoken: accessTocken, filename: filename}
var arraydata = {uri: uri, accesstoken: accessTocken, filename: filename}
$.ajax({
$.ajax({
url: dlscfnc + 'download.php',
url: dlscfnc + 'download.php',
type: 'POST',
type: 'POST',
data: arraydata
data: arraydata
}).done(function (response)
}).done(function (response)
{
{
$(".se-pre-con").hide();
$(".se-pre-con").hide();
var getdata = JSON.parse(response);
var getdata = JSON.parse(response);
console.log(getdata[1]);
console.log(getdata[1]);
window.open("data:" + getdata[0] + ";base64," + getdata[1], '', 'height=650,width=840');
window.open("data:" + getdata[0] + ";base64," + getdata[1], '', 'height=650,width=840');
});
});
}
}
$(".se-pre-con").fadeOut("slow");
$(".se-pre-con").fadeOut("slow");
</script>
</script>
</html>
</html>
M header.php
+1 −1
<!DOCTYPE html>
<!DOCTYPE html>
<?php include 'config.php'; ?>
<?php include 'config.php'; ?>
<html lang="en">
<html lang="en">
<head>
<head>
<meta charset="utf-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="description" content="">
<meta name="author" content="">
<meta name="author" content="">
<title>DigiLocker Service Center</title>
<title>DigiLocker Service Center</title>
<!-- Bootstrap Core CSS -->
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<!-- Custom CSS -->
<link href="css/style.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">
<link href="css/font-style.css" rel="stylesheet" type="text/css">
<link href="css/font-style.css" rel="stylesheet" type="text/css">
<!-- Custom Fonts -->
<!-- Custom Fonts -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<style>
<style>
ul li span .btn {
ul li span .btn {
background-color:blueviolet;
background-color:blueviolet;
padding:0px;
padding:0px;
border-radius: 4px;
border-radius: 4px;
text-transform: none;
text-transform: none;
margin-left:20px;
margin-left:20px;
}
}
@media (min-width: 768px){
@media (min-width: 768px){
.navbar-nav>li>a {
.navbar-nav>li>a {
font-size:11px;
font-size:11px;
padding-top: 8px;
padding-top: 8px;
padding-bottom: 0px;
padding-bottom: 0px;
color: #fff;
color: #fff;
padding-bottom: 8px;
padding-bottom: 8px;
}
}
.navbar-nav>li>a:hover{ color: #000; background-color:#f0ede4;}
.navbar-nav>li>a:hover{ color: #000; background-color:#f0ede4;}
.row{margin-top: -10px;margin-bottom: 15px;}
.row{margin-top: -10px;margin-bottom: 15px;}
}
}
.dropdown{
.dropdown{
margin:6px 16px;
margin:6px 16px;
color:#fff !important;
color:#fff !important;
cursor: pointer; cursor: hand;
cursor: pointer; cursor: hand;
}
}
.dropdown-submenu {
.dropdown-submenu {
position: relative;
position: relative;
color:#0033FF;
color:#0033FF;
}
}
.dropdown-menu>li{
.dropdown-menu>li{
margin-left: -15px;
margin-left: -15px;
cursor: pointer; cursor: hand;
cursor: pointer; cursor: hand;
}
}
</style>
</style>
</head>
</head>
<body>
<body>
<!-- Navigation -->
<!-- Navigation -->
<div class="row">
<div class="row">
<div class="col-md-6">
<div class="col-md-6">
<a class="navbar-brand pull-left" href="index.html"><img src="images/logo.png"></a>
<a class="navbar-brand pull-left" href="index.html"><img src="images/logo.png"></a>
</div>
</div>
<div class="col-md-6">
<div class="col-md-6">
<a class="navbar-brand pull-right">
<a class="navbar-brand pull-right">
<img src="images/digitalindialogo.png"></a>
<img src="images/digitalindialogo.png"></a>
</div>
</div>
</div>
</div>
<nav role="navigation" style="background-color: blueviolet; margin-bottom: 15px;height: 40px; position: relative;" >
<nav role="navigation" style="background-color: blueviolet; margin-bottom: 15px;height: 40px; position: relative;" >
<div class="container" style="padding-left:0px !important;">
<div class="container" style="padding-left:0px !important;">
<!-- Brand and toggle get grouped for better mobile display -->
<!-- Brand and toggle get grouped for better mobile display -->
<!-- Collect the nav links, forms, and other content for toggling -->
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" >
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" >
<ul class="nav navbar-nav navbar-left ">
<ul class="nav navbar-nav navbar-left ">
<li><a href= "<?php echo $config['dlsc_path']; ?>"><i class="fa fa-home fa-2x" aria-hidden="true"></i></a></li>
<li><a href= "<?php echo $config['dlsc_path']; ?>"><i class="fa fa-home fa-2x" aria-hidden="true"></i></a></li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">AADHAAR
<div class="dropdown-toggle" data-toggle="dropdown">AADHAAR
</div>
</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li><a >Aadhaar Demographic Update</a></li><hr>
<li><a >Aadhaar Demographic Update</a></li><hr>
<li><a>Aadhaar Mobile Update</a></li><hr>
<li><a>Aadhaar Mobile Update</a></li><hr>
<li><a>Best Finger Detection</a></li><hr>
<li><a>Best Finger Detection</a></li><hr>
<li><a>Aadhaar eKYC PVC Print</a></li>
<li><a>Aadhaar eKYC PVC Print</a></li>
</ul>
</ul>
</div>
</div>
</li>
</li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">AGRICULTURE
<div class="dropdown-toggle" data-toggle="dropdown">AGRICULTURE
</div>
</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >Agricultural Machine Store</a></li><hr>
<li><a tabindex="-1" >Agricultural Machine Store</a></li><hr>
<li><a tabindex="-1" >Online Store</a></li><hr>
<li><a tabindex="-1" >Online Store</a></li><hr>
<li><a tabindex="-1" >Farmer Registration</a></li><hr>
<li><a tabindex="-1" >Farmer Registration</a></li><hr>
<li><a tabindex="-1" >Marketplace</a></li>
<li><a tabindex="-1" >Marketplace</a></li>
</ul>
</ul>
</div>
</div>
</li>
</li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">BANKING AND PENSION
<div class="dropdown-toggle" data-toggle="dropdown">BANKING AND PENSION
</div>
</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >RAP Registration</a></li><hr>
<li><a tabindex="-1" >RAP Registration</a></li><hr>
<li><a tabindex="-1" >Basic Banking Course</a></li><hr>
<li><a tabindex="-1" >Basic Banking Course</a></li><hr>
<li><a tabindex="-1" >Life Certificate (LIC)</a></li><hr>
<li><a tabindex="-1" >Life Certificate (LIC)</a></li><hr>
<li><a tabindex="-1" >Pin Pad Device Payment Service</a></li>
<li><a tabindex="-1" >Pin Pad Device Payment Service</a></li>
</ul>
</ul>
</div>
</div>
</li>
</li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">DIGILOCKER</div>
<div class="dropdown-toggle" data-toggle="dropdown">DIGILOCKER</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li>
<li>
<span><form action = "<?php echo $config['code_download'] ?>" method = "GET" role="form">
<span><form action = "<?php echo $config['code_download'] ?>" method = "POST" 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="<?php echo $config['client_id_download'] ?>">
<input type="text" class="form-control" name = "client_id" value="<?php echo $config['client_id_download'] ?>">
</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=<?php echo $config['download_redirect_uri'] ?>>
<input type="text" class="form-control" name = "redirect_uri" value=<?php echo $config['download_redirect_uri'] ?>>
</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>
<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 = "dl_flow" value="signup">
<input type="text" class="form-control" name = "dl_flow" value="signup">
</div>
</div>
<button type="submit" class="btn">Open Digilocker Account</button>
<button type="submit" class="btn">Open Digilocker Account</button>
</form>
</form>
</span>
</span>
</li><hr>
</li><hr>
<li>
<li>
<span><form action = "<?php echo $config['code_download'] ?>" method = "GET" role="form">
<span><form action = "<?php echo $config['code_download'] ?>" 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="<?php echo $config['client_id_download'] ?>">
<input type="text" class="form-control" name = "client_id" value="<?php echo $config['client_id_download'] ?>">
</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=<?php echo $config['download_redirect_uri'] ?>>
<input type="text" class="form-control" name = "redirect_uri" value=<?php echo $config['download_redirect_uri'] ?>>
</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>
<button type="submit" class="btn">Download</button>
<button type="submit" class="btn">Download</button>
</form>
</form>
</span>
</span>
</li><hr>
</li><hr>
<li>
<li>
<span> <form action = "<?php echo $config['code_download'] ?>" method = "GET" role="form">
<span> <form action = "<?php echo $config['code_download'] ?>" 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="<?php echo $config['client_id_upload'] ?>">
<input type="text" class="form-control" name = "client_id" value="<?php echo $config['client_id_upload'] ?>">
</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="<?php echo $config['uploaddoc_redirect_uri'] ?>">
<input type="text" class="form-control" name = "redirect_uri" value="<?php echo $config['uploaddoc_redirect_uri'] ?>">
</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>
<button type="submit" class="btn" >Upload</button>
<button type="submit" class="btn" >Upload</button>
</form>
</form>
</span>
</span>
</li>
</li>
</ul>
</ul>
</div>
</div>
</li>
</li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">ELECTION
<div class="dropdown-toggle" data-toggle="dropdown">ELECTION
</div>
</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >Punjab Election Services</a></li><hr>
<li><a tabindex="-1" >Punjab Election Services</a></li><hr>
<li><a tabindex="-1" >Uttarakhand Election Services</a></li><hr>
<li><a tabindex="-1" >Uttarakhand Election Services</a></li><hr>
<li><a tabindex="-1" >Meghalaya Election Services</a></li><hr>
<li><a tabindex="-1" >Meghalaya Election Services</a></li><hr>
<li><a tabindex="-1" >Rajasthan Election Services</a></li>
<li><a tabindex="-1" >Rajasthan Election Services</a></li>
</ul>
</ul>
</div>
</div>
</li>
</li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">GOVERNMENT
<div class="dropdown-toggle" data-toggle="dropdown">GOVERNMENT
</div>
</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >Birth and Death Application</a></li><hr>
<li><a tabindex="-1" >Birth and Death Application</a></li><hr>
<li><a tabindex="-1" >Forest Services</a></li><hr>
<li><a tabindex="-1" >Forest Services</a></li><hr>
<li><a tabindex="-1" >Online FIR</a></li><hr>
<li><a tabindex="-1" >Online FIR</a></li><hr>
<li><a tabindex="-1" >Ration Card Services</a></li>
<li><a tabindex="-1" >Ration Card Services</a></li>
</ul>
</ul>
</div>
</div>
</li>
</li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">INSURANCE
<div class="dropdown-toggle" data-toggle="dropdown">INSURANCE
</div>
</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >Pradhan Mantri Fasal Bima Yojna</a></li><hr>
<li><a tabindex="-1" >Pradhan Mantri Fasal Bima Yojna</a></li><hr>
<li><a tabindex="-1" >Farmer Package Policy</a></li><hr>
<li><a tabindex="-1" >Farmer Package Policy</a></li><hr>
<li><a tabindex="-1" >Life Insurance</a></li><hr>
<li><a tabindex="-1" >Life Insurance</a></li><hr>
<li><a tabindex="-1" >Personal Accidental</a></li>
<li><a tabindex="-1" >Personal Accidental</a></li>
</ul>
</ul>
</div>
</div>
</li>
</li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">TRAVEL
<div class="dropdown-toggle" data-toggle="dropdown">TRAVEL
</div>
</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >Darshan Booking</a></li><hr>
<li><a tabindex="-1" >Darshan Booking</a></li><hr>
<li><a tabindex="-1" >Bus Ticket Booking</a></li><hr>
<li><a tabindex="-1" >Bus Ticket Booking</a></li><hr>
<li><a tabindex="-1" >Flight Tickets</a></li><hr>
<li><a tabindex="-1" >Flight Tickets</a></li><hr>
<li><a tabindex="-1" >Bus Tickets</a></li>
<li><a tabindex="-1" >Bus Tickets</a></li>
</ul>
</ul>
</div>
</div>
</li>
</li>
</ul>
</ul>
</div>
</div>
<!-- /.navbar-collapse -->
<!-- /.navbar-collapse -->
</div>
</div>
<!-- /.container -->
<!-- /.container -->
</nav>
</nav>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.min.js"></script>
<script>
<script>
$(document).ready(function () {
$(document).ready(function () {
$('.dropdown-submenu a.test').on("click", function (e) {
$('.dropdown-submenu a.test').on("click", function (e) {
$(this).next('ul').toggle();
$(this).next('ul').toggle();
e.stopPropagation();
e.stopPropagation();
e.preventDefault();
e.preventDefault();
});
});
});
});
</script>
</script>
M uploaddoc.php
+4 −3
<?php
<?php
if(isset($_GET['error'])){
header("Location: index.php");
}
include 'config.php';
include 'config.php';
if(isset($_GET['error_description'])){
header("Location: index.php?message=".$_GET['error_description']);
exit;
}
$code = $_GET['code'];
$code = $_GET['code'];
$state = $_GET['state'];
$state = $_GET['state'];
$url = $config['access_token_download'];
$url = $config['access_token_download'];
$post = array(
$post = array(
'code' => $code,
'code' => $code,
'grant_type' => 'authorization_code',
'grant_type' => 'authorization_code',
'client_id' => $config['client_id_upload'],
'client_id' => $config['client_id_upload'],
'client_secret' => $config['client_secret_upload'],
'client_secret' => $config['client_secret_upload'],
'redirect_uri' => $config['uploaddoc_redirect_uri'],
'redirect_uri' => $config['uploaddoc_redirect_uri'],
);
);
$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_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);
if(!$notgettingdata[1]){
if(!$notgettingdata[1]){
header("Location: index.php?message=THIS IS ERROR");
header("Location: index.php?message=THIS IS ERROR");
}
}
$getToken = json_decode($notgettingdata[1]);
$getToken = json_decode($notgettingdata[1]);
if (isset($getToken->access_token)) {
if (isset($getToken->access_token)) {
$access_token = $getToken->access_token;
$access_token = $getToken->access_token;
}
}
if (isset($access_token)) {
if (isset($access_token)) {
$doc = new DOMDocument('1.0');
$doc = new DOMDocument('1.0');
$doc->formatOutput = true;
$doc->formatOutput = true;
$doc = new DOMDocument('1.0');
$doc = new DOMDocument('1.0');
$doc->formatOutput = true;
$doc->formatOutput = true;
$root = $doc->createElement('maincontent');
$root = $doc->createElement('maincontent');
$root = $doc->appendChild($root);
$root = $doc->appendChild($root);
$title = $doc->createElement('code');
$title = $doc->createElement('code');
$title = $root->appendChild($title);
$title = $root->appendChild($title);
$enclosure = $doc->createAttribute('num');
$enclosure = $doc->createAttribute('num');
$enclosure->value = $code;
$enclosure->value = $code;
$title->appendChild($enclosure);
$title->appendChild($enclosure);
$title = $doc->createElement('access_token');
$title = $doc->createElement('access_token');
$title = $root->appendChild($title);
$title = $root->appendChild($title);
$text = $doc->createTextNode($access_token);
$text = $doc->createTextNode($access_token);
$text = $title->appendChild($text);
$text = $title->appendChild($text);
$doc->save("xml/hashhkey.xml");
$doc->save("xml/hashhkey.xml");
}
}
if (file_exists("xml/hashhkey.xml")) {
if (file_exists("xml/hashhkey.xml")) {
$xml = (array) simplexml_load_file("xml/hashhkey.xml") or die("Error: Cannot create object");
$xml = (array) simplexml_load_file("xml/hashhkey.xml") or die("Error: Cannot create object");
} else {
} else {
echo "xml/hashhkey.xml file doesnot exists";
echo "xml/hashhkey.xml file doesnot exists";
}
}
$access_token = $xml['access_token'];
$access_token = $xml['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 = $config['file_uri'];
$urlFile = $config['file_uri'];
$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);
$uriRes = json_decode($resFileNew[1]);
$uriRes = json_decode($resFileNew[1]);
if(isset($uriRes->error) || !$resFileNew){
if(isset($uriRes->error) || !$resFileNew){
header("Location: index.php?message=".$uriRes->error_description);
header("Location: index.php?message=".$uriRes->error_description);
exit;
exit;
}
}
$uriDir = array();
$uriDir = array();
$uriFiles = array();
$uriFiles = array();
foreach ($uriRes->items as $uriI) {
foreach ($uriRes->items as $uriI) {
if ($uriI->type == "dir") {
if ($uriI->type == "dir") {
$uriDir[] = (array) $uriI;
$uriDir[] = (array) $uriI;
} else {
} else {
$uriFiles[] = (array) $uriI;
$uriFiles[] = (array) $uriI;
}
}
}
}
$uriItems = array_merge($uriDir, $uriFiles);
$uriItems = array_merge($uriDir, $uriFiles);
$uriItemsArray['items'] = $uriItems;
$uriItemsArray['items'] = $uriItems;
$dataDirectory['directory'] = $uriRes->directory;
$dataDirectory['directory'] = $uriRes->directory;
$dataF = array_merge($dataDirectory, $uriItemsArray);
$dataF = array_merge($dataDirectory, $uriItemsArray);
include 'header.php';
include 'header.php';
?>
?>
<style>
<style>
#fileUpload {
#fileUpload {
cursor: pointer;
cursor: pointer;
cursor:hand;
cursor:hand;
margin: -14px -4px;
margin: -14px -4px;
opacity: 0;
opacity: 0;
overflow: hidden;
overflow: hidden;
position: relative;
position: relative;
z-index: 20;
z-index: 20;
}
}
.inputfile + label {
.inputfile + label {
background-color: blueviolet;
background-color: blueviolet;
color: #f1e5e6;
color: #f1e5e6;
padding: 5px;
padding: 5px;
}
}
</style>
</style>
<div class="se-pre-con"></div>
<div class="se-pre-con"></div>
<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">
<?php
<?php
if (isset($_GET['message'])) {
if (isset($_GET['message'])) {
$alert = "red";
$alert = "red";
if ($_GET['message'] == "File Uploaded Successfully") {
if ($_GET['message'] == "File Uploaded Successfully") {
$alert = "green";
$alert = "green";
}
}
echo "<div class='alert' id='alert' style='color:" . $alert . "'> <button type='button' class='close' data-dismiss='alert'>x</button>" . $_GET['message'] . "</div>";
echo "<div class='alert' id='alert' style='color:" . $alert . "'> <button type='button' class='close' data-dismiss='alert'>x</button>" . $_GET['message'] . "</div>";
}
}
?>
?>
</div>
</div>
</div>
</div>
<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"><img src="images/uploaded_files.png">Uploaded Document</a></li>
<li class="active"><a data-toggle="tab" href="#uploadeddocument"><img src="images/uploaded_files.png">Uploaded 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-body" style="min-height: 385px;" >
<div class="box box-body" style="min-height: 385px;" >
<div class="row" style="margin-top:7px;">
<div class="row" style="margin-top:7px;">
<div class="col-md-3">
<div class="col-md-3">
<span onclick="uriData(null, null)" class="fa fa-home fa-2x" style="color:blueviolet; cursor:pointer; cursor:hand;"></span>
<span onclick="uriData(null, null)" class="fa fa-home fa-2x" style="color:blueviolet; cursor:pointer; cursor:hand;"></span>
<span id="parent" style="color:blueviolet; font-size: 16px; cursor:pointer; cursor:hand;"></span>
<span id="parent" style="color:blueviolet; font-size: 16px; cursor:pointer; cursor:hand;"></span>
</div>
</div>
<div class="col-md-9 pull-left">
<div class="col-md-9 pull-left">
<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="text" value="<?php echo $code; ?>" name="code" class="hidden"/>
<input type="text" value="<?php echo $code; ?>" name="code" class="hidden"/>
<input type="text" value="<?php echo $state; ?>" name="state" class="hidden"/>
<input type="text" value="<?php echo $state; ?>" name="state" class="hidden"/>
<input type="text" name="filePath" class="hidden" value="" id="filePath"/>
<input type="text" name="filePath" class="hidden" value="" id="filePath"/>
<input type="file" class="inputfile" id="fileUpload" name="fileUpload"/>
<input type="file" class="inputfile" id="fileUpload" name="fileUpload"/>
<label for="fileUpload" style="border-radius:5px;">
<label for="fileUpload" style="border-radius:5px;">
<i class="fa fa-upload"></i>
<i class="fa fa-upload"></i>
<span>Upload Here</span>
<span>Upload Here</span>
</label>
</label>
</form>
</form>
</div>
</div>
</div>
</div>
<div class="table-responsive">
<div class="table-responsive">
<table class="table">
<table class="table">
<thead style="color:blueviolet;">
<thead style="color:blueviolet;">
<tr id="trheading">
<tr id="trheading">
<td>Name</td>
<td>Name</td>
<td>Size</td>
<td>Size</td>
<td>Date</td>
<td>Date</td>
<td id="tdUri" style="display:none;">URI</td>
<td id="tdUri" style="display:none;">URI</td>
</tr>
</tr>
</thead>
</thead>
<tbody id="folderPath">
<tbody id="folderPath">
<?php
<?php
foreach ((array) ($dataF['items']) as $api_detail) {
foreach ((array) ($dataF['items']) as $api_detail) {
if (isset($api_detail['id'])) {
if (isset($api_detail['id'])) {
$api_detail['id'] = $api_detail['id'];
$api_detail['id'] = $api_detail['id'];
$api_detail['parent'] = $api_detail['parent'];
$api_detail['parent'] = $api_detail['parent'];
} else {
} else {
$api_detail['id'] = "";
$api_detail['id'] = "";
}
}
?>
?>
<tr>
<tr>
<?php
<?php
if (($api_detail['type']) == "dir") {
if (($api_detail['type']) == "dir") {
echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
echo '<img src="images/folder.svg" style="margin-right:10px;"></img>';
echo '<img src="images/folder.svg" style="margin-right:10px;"></img>';
echo($api_detail['name']);
echo($api_detail['name']);
}
}
if ($api_detail['type'] == "file") {
if ($api_detail['type'] == "file") {
echo "<td>";
echo "<td>";
echo '<img src="images/file.svg" style="margin-right:10px;"></img>';
echo '<img src="images/file.svg" style="margin-right:10px;"></img>';
echo($api_detail['name']);
echo($api_detail['name']);
}
}
echo "</td>";
echo "</td>";
?>
?>
<td><?php echo($api_detail['size']); ?></td>
<td><?php echo($api_detail['size']); ?></td>
<td><?php echo date("d-m-Y", strtotime($api_detail['date'])); ?></td>
<td><?php echo date("d-m-Y", strtotime($api_detail['date'])); ?></td>
<?php if ($api_detail['type'] == "file") { ?>
<?php if ($api_detail['type'] == "file") { ?>
<?php }
<?php }
?>
?>
</tr>
</tr>
<?php }
<?php }
?>
?>
</tbody>
</tbody>
</table>
</table>
<div class="footer">
<div class="footer">
<a class="btn btn-default" style="float: right; margin-left: 10px; border-radius:5px;" href="payment.php">Complete Payment</a>
<a class="btn btn-default" style="float: right; margin-left: 10px; border-radius:5px;" href="payment.php">Complete Payment</a>
<a class="btn btn-default" style="float: right; border-radius:5px;" href="tokan.php">Cancel</a>
<a class="btn btn-default" style="float: right; border-radius:5px;" href="tokan.php">Cancel</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include 'footer.php' ?>
<?php include 'footer.php' ?>
<script src="js/modernizr.js"></script>
<script src="js/modernizr.js"></script>
<script>
<script>
$(document).on('change', "#fileUpload", function () {
$(document).on('change', "#fileUpload", function () {
$("form").submit();
$("form").submit();
});
});
$("#filePath").val("");
$("#filePath").val("");
function uriData(id, parent) {
function uriData(id, parent) {
$("#folderPath").empty();
$("#folderPath").empty();
$("#fileUpload").val("");
$("#fileUpload").val("");
$("#filePath").val("");
$("#filePath").val("");
$("#tdUri").show();
$("#tdUri").show();
$(".se-pre-con").show();
$(".se-pre-con").show();
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 onclickFnc = "";
var dwnldTd = "";
var dwnldTd = "";
var accessToken = "<?php echo $access_token; ?>";
var accessToken = "<?php echo $access_token; ?>";
var urifnc = "<?php echo $config['uri_path']; ?>";
var urifnc = "<?php echo $config['uri_path']; ?>";
$.post(urifnc, {access_token: accessTocken, id: id}, function (result) {
$.post(urifnc, {access_token: accessTocken, id: id}, function (result) {
$.each(result.items, function (i, l) {
$.each(result.items, function (i, l) {
if (result.items[i].type == "file") {
if (result.items[i].type == "file") {
console.log(result.items);
console.log(result.items);
fileOrFolder = '<img src="images/file.svg" style="margin-right:10px;"></img>';
fileOrFolder = '<img src="images/file.svg" style="margin-right:10px;"></img>';
onclickFnc = "onclick='thisIsNotAFolder()'";
onclickFnc = "onclick='thisIsNotAFolder()'";
dwnldTd = "<td onclick = 'download(\"" + result.items[i].uri + "\",\"" + result.items[i].name + "\");';></td>";
dwnldTd = "<td onclick = 'download(\"" + result.items[i].uri + "\",\"" + result.items[i].name + "\");';></td>";
} else {
} else {
fileOrFolder = '<img src="images/folder.svg" style="margin-right:10px;"></img>';
fileOrFolder = '<img src="images/folder.svg" style="margin-right:10px;"></img>';
onclickFnc = "onclick='uriData(" + result.items[i].id + "," + result.items[i].parent + ")'";
onclickFnc = "onclick='uriData(" + result.items[i].id + "," + result.items[i].parent + ")'";
dwnldTd = "<td></td>";
dwnldTd = "<td></td>";
}
}
var date = new Date(result.items[i].date);
var date = new Date(result.items[i].date);
var dateformate = date.getDate()+'-'+(date.getMonth()+1) + '-' + date.getFullYear();
var dateformate = date.getDate()+'-'+(date.getMonth()+1) + '-' + date.getFullYear();
uriDataHtml += "<tr><td " + onclickFnc + ">" + fileOrFolder + result.items[i].name + "</td><td>" + result.items[i].size + "</td><td>" + dateformate + "</td>\n\
uriDataHtml += "<tr><td " + onclickFnc + ">" + fileOrFolder + result.items[i].name + "</td><td>" + result.items[i].size + "</td><td>" + dateformate + "</td>\n\
<td>" + result.items[i].uri + "</td>" + dwnldTd + "</tr>";
<td>" + result.items[i].uri + "</td>" + dwnldTd + "</tr>";
$("#folderPath").html(uriDataHtml);
$("#folderPath").html(uriDataHtml);
});
});
$(".footer").show();
$(".footer").show();
$("#trheading").show();
$("#trheading").show();
if((result.items).length==0){
if((result.items).length==0){
$(".footer").hide();
$(".footer").hide();
$("#trheading").hide();
$("#trheading").hide();
$("#folderPath").html("<tr><th colspan='4'style='text-align: center;'><h4>No document uploaded yet</h4></br><p>Upload some of your own documents or certificates!</p></th></tr>");
$("#folderPath").html("<tr><th colspan='4'style='text-align: center;'><h4>No document uploaded yet</h4></br><p>Upload some of your own documents or certificates!</p></th></tr>");
}
}
$("#filePath").val(result.directory);
$("#filePath").val(result.directory);
$("#parent").html("<span onclick=uriData(" + parent + ",null)>" + result.directory + "</span>");
$("#parent").html("<span onclick=uriData(" + parent + ",null)>" + result.directory + "</span>");
$(".se-pre-con").hide();
$(".se-pre-con").hide();
}, "json")
}, "json")
.fail(function () {
.fail(function () {
$("#folderPath").html("some error found!");
$("#folderPath").html("some error found!");
$(".se-pre-con").hide();
$(".se-pre-con").hide();
});
});
}
}
$(".se-pre-con").fadeOut("slow");
$(".se-pre-con").fadeOut("slow");
</script>
</script>
<script>
<script>
$("#alert").fadeTo(2000, 500).slideUp(500, function(){ $("#alert").slideUp(5000); });
$("#alert").fadeTo(2000, 500).slideUp(500, function(){ $("#alert").slideUp(5000); });
</script>
</script>
</html>
</html>