authpartner
Clone or download
Merge branch 'develop' of https://openforge.gov.in/plugins/git/digitallocker/development_auth_partner_sm_app into develop
Conflicts: xml/hashKey.xml xml/hashhkey.xml
Modified Files
--- 'a/.gitignore'
+++ b/.gitignore
@@ -69,7 +69,4 @@ user_guide_src/cilexer/pycilexer.egg-inf
.DS_Store
config.php
-xml/*
-/xml/*
-xml/hashKey.xml
-xml/hashhkey.xml
+xml/
--- 'a/css/styles.css'
+++ b/css/styles.css
@@ -5,6 +5,7 @@
/*
* 1.1 Common styles
*/
+
::-moz-selection {
color: #fff;
background: #000000; }
@@ -5303,35 +5304,18 @@ h3.widget-title.side-nav {margin-top: 20
.no-padding {
padding: 0 !important; }
- /**
-#loading {
- content: '';
- display: block;
- top: 0;
- left: 0;
- bottom: 0;
- right: 0;
- position:absolute;
- width: 100%; height: 100%;
- background: url('loading.gif') no-repeat center center;
- margin:0 auto;
- z-index:10000000;
- /**opacity: 0.4; **/
-}
-**/
+
+
/* Paste this css to your style sheet file or under head tag */
/* This only works with JavaScript,
if it's not present, don't show loader */
-.no-js #loader { display: none; }
-.js #loader { display: block; position: absolute; left: 100px; top: 0; }
.se-pre-con {
- display: none;
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 9999;
- opacity: 0.2;
+ opacity: 0.1;
background: url(loading.gif) center no-repeat transparent;
}
\ No newline at end of file
--- 'a/doc.php'
+++ b/doc.php
@@ -1,66 +1,55 @@
<?php
-include 'header.php';
include 'config.php';
$code = $_GET['code'];
$state = $_GET['state'];
+$url = $config['access_token_download'];
+$post = array(
+ 'code' => $code,
+ 'grant_type' => 'authorization_code',
+ 'client_id' => $config['client_id_download'],
+ 'client_secret' => $config['client_secret_download'],
+ 'redirect_uri' => $config['download_redirect_uri'],
+);
+$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_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]);
+
+if (isset($getToken->access_token)) {
+ $access_token = $getToken->access_token;
+}
+if (isset($access_token)) {
+ $doc = new DOMDocument('1.0');
+ $doc->formatOutput = true;
+ $doc = new DOMDocument('1.0');
+ $doc->formatOutput = true;
+ $root = $doc->createElement('maincontent');
+ $root = $doc->appendChild($root);
+ $title = $doc->createElement('code');
+ $title = $root->appendChild($title);
+ $enclosure = $doc->createAttribute('num');
+ $enclosure->value = $code;
+ $title->appendChild($enclosure);
+ $title = $doc->createElement('access_token');
+ $title = $root->appendChild($title);
+ $text = $doc->createTextNode($access_token);
+ $text = $title->appendChild($text);
+ $doc->save("xml/hashKey.xml");
+}
if (file_exists("xml/hashKey.xml")) {
$xml = (array) simplexml_load_file("xml/hashKey.xml") or die("Error: Cannot create object");
} else {
echo "xml/hashKey.xml file doesnot exists";
}
$access_token = $xml['access_token'];
-$cd = (array) $xml['code']['num'];
-if ($cd != $code) {
- $url = $config['access_token_download'];
- $post = array(
- 'code' => $code,
- 'grant_type' => 'authorization_code',
- 'client_id' => $config['client_id_download'],
- 'client_secret' => $config['client_secret_download'],
- 'redirect_uri' => $config['download_redirect_uri'],
- );
- $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]);
-
- if (isset($getToken->access_token)) {
- $access_token = $getToken->access_token;
- }
- if (isset($access_token)) {
- $doc = new DOMDocument('1.0');
- $doc->formatOutput = true;
- $doc = new DOMDocument('1.0');
- $doc->formatOutput = true;
- $root = $doc->createElement('maincontent');
- $root = $doc->appendChild($root);
- $title = $doc->createElement('code');
- $title = $root->appendChild($title);
- $enclosure = $doc->createAttribute('num');
- $enclosure->value = $code;
- $title->appendChild($enclosure);
- $title = $doc->createElement('access_token');
- $title = $root->appendChild($title);
- $text = $doc->createTextNode($access_token);
- $text = $title->appendChild($text);
- $doc->save("xml/hashKey.xml");
- }
- if (file_exists("xml/hashKey.xml")) {
- $xml = (array) simplexml_load_file("xml/hashKey.xml") or die("Error: Cannot create object");
- } else {
- echo "xml/hashKey.xml file doesnot exists";
- }
- $access_token = $xml['access_token'];
-}
$headers = array(
'Authorization: Bearer ' . $access_token
@@ -95,6 +84,8 @@ $resissuedErr = curl_error($vhi);
curl_close($vhi);
$issuedNew = explode('¿', $resissued);
$dataI = json_decode($issuedNew[1], TRUE);
+
+include 'header.php';
?>
<div class="se-pre-con"></div>
<div id="wrapper">
@@ -123,49 +114,52 @@ $dataI = json_decode($issuedNew[1], TRUE
<td>Date</td>
<td id="tdUri" style="display:none;">URI</td>
</tr>
- <div><b onclick="uriData(null, null)" class="fa fa-home fa-2x" style="color:blueviolet;"></b><b id="parent" style="color:blueviolet;"></b></div>
+ <div>
+ <b onclick="uriData(null, null)" class="fa fa-home fa-2x" style="color:blueviolet; cursor:pointer; cursor:hand"></b>
+ <b id="parent" style="color:blueviolet; cursor:pointer; cursor:hand"></b>
+ </div>
</thead>
<tbody id="folderPath">
- <?php
- foreach ((array) ($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
- if (($api_detail['type']) == "dir") {
- echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
- echo '<img src="images/folder.svg"></img>';
- echo($api_detail['name']);
- }
- if ($api_detail['type'] == "file") {
- echo "<td onclick='thisIsNotAFolder()'>";
- echo '<img src="images/file.svg"></img>';
- echo($api_detail['name']);
+ <?php
+ foreach ((array) ($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'] = "";
}
- echo "</td>";
?>
- <td><?php echo($api_detail['size']); ?></td>
- <td><?php echo($api_detail['date']); ?></td>
- <?php if ($api_detail['type'] == "file") { ?>
- <td>
- <button onclick="download('<?php echo($api_detail['uri'] . ',' . $api_detail['name']); ?>')"><i class="fa fa-download"> </i></button>
+ <tr>
+ <?php
+ if (($api_detail['type']) == "dir") {
+ echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
+ echo '<img src="images/folder.svg"></img>';
+ echo($api_detail['name']);
+ }
+ if ($api_detail['type'] == "file") {
+ echo "<td onclick='thisIsNotAFolder()'>";
+ echo '<img src="images/file.svg"></img>';
+ 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>
+ <button onclick="download('<?php echo($api_detail['uri'] . ',' . $api_detail['name']); ?>')"><i class="fa fa-download"> </i></button>
- </td>
- <?php }
- ?>
- </tr>
- <?php }
- ?>
+ </td>
+ <?php }
+ ?>
+ </tr>
+ <?php }
+ ?>
</tbody>
</table>
<div class="footer">
- <a class="btn btn-primary" style="float: right; margin-left: 10px; border-radius:5px;" href="payment.php">Complete Payment</a>
- <a class="btn btn-primary" style="float: right; border-radius:5px;" href="index.php">Cancel</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="index.php">Cancel</a>
</div>
</div>
</div>
@@ -209,8 +203,8 @@ $dataI = json_decode($issuedNew[1], TRUE
?>
</table>
<div class="footer">
- <a class="btn btn-primary" style="float: right; margin-left: 10px; border-radius:5px;" href="payment.php">Complete Payment</a>
- <a class="btn btn-primary" style="float: right; border-radius:5px;" href="index.php">Cancel</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="index.php">Cancel</a>
</div>
</div>
</div>
@@ -230,60 +224,62 @@ $dataI = json_decode($issuedNew[1], TRUE
<?php include 'footer.php' ?>
<script src="js/modernizr.js"></script>
<script>
- function uriData(id, parent) {
- $("#folderPath").empty();
- $("#tdUri").show();
- var id = id;
- var accessTocken = "<?php echo $access_token; ?>";
- var uri = "<?php echo $api_detail['uri']; ?>";
- var uriDataHtml = "";
- var fileOrFolder = "";
- var onclickFnc = "";
- var dwnldTd = "";
- var accessToken = "<?php echo $access_token; ?>";
- var urifnc = "<?php echo $config['uri_path']; ?>";
- $.post(urifnc, {access_token: accessTocken, id: id}, function (result) {
- $.each(result.items, function (i, l) {
- if (result.items[i].type == "file") {
- console.log(result.items);
- fileOrFolder = '<img src="images/file.svg"></img>';
- onclickFnc = "onclick='thisIsNotAFolder()'";
- dwnldTd = "<td onclick = 'download(\"" + result.items[i].uri + "\",\"" + result.items[i].name + "\");';><button><i class='fa fa-download'> </i></button></td>";
- } else {
- fileOrFolder = '<img src="images/folder.svg"></img>';
- onclickFnc = "onclick='uriData(" + result.items[i].id + "," + result.items[i].parent + ")'";
- dwnldTd = "<td></td>";
- }
- uriDataHtml += "<tr><td " + onclickFnc + ">" + fileOrFolder + result.items[i].name + "</td><td>" + result.items[i].size + "</td><td>" + result.items[i].date + "</td>\n\
- <td>" + result.items[i].uri + "</td>" + dwnldTd + "</tr>";
- $("#folderPath").html(uriDataHtml);
- });
- $("#parent").html("<b onclick=uriData(" + parent + ",null) >" + result.directory + "</b>");
- }, "json")
- .fail(function () {
- $("#folderPath").html("Some error found");
- });
- }
- function download(uris, filename) {
- $(".se-pre-con").show();
- var getdata = uris.split(",");
- var uri = getdata[0];
- var filename = getdata[1];
- var accessTocken = "<?php echo $access_token; ?>";
- var dlscfnc = "<?php echo $config['dlsc_path']; ?>"
- var arraydata = {uri: uri, accesstoken: accessTocken, filename: filename}
- $.ajax({
- url: dlscfnc + 'download.php',
- type: 'POST',
- data: arraydata
- }).done(function (response)
- {
- $(".se-pre-con").hide();
- var getdata = JSON.parse(response);
- console.log(getdata[1]);
- window.open("data:" + getdata[0] + ";base64," + getdata[1], '', 'height=650,width=840');
+function uriData(id, parent) {
+ $("#folderPath").empty();
+ $("#tdUri").show();
+ $(".se-pre-con").show();
+ var id = id;
+ var accessTocken = "<?php echo $access_token; ?>";
+ var uri = "<?php echo $api_detail['uri']; ?>";
+ var uriDataHtml = "";
+ var fileOrFolder = "";
+ var onclickFnc = "";
+ var dwnldTd = "";
+ var accessToken = "<?php echo $access_token; ?>";
+ var urifnc = "<?php echo $config['uri_path']; ?>";
+ $.post(urifnc, {access_token: accessTocken, id: id}, function (result) {
+ $.each(result.items, function (i, l) {
+ if (result.items[i].type == "file") {
+ console.log(result.items);
+ fileOrFolder = '<img src="images/file.svg"></img>';
+ onclickFnc = "onclick='thisIsNotAFolder()'";
+ dwnldTd = "<td onclick = 'download(\"" + result.items[i].uri + "\",\"" + result.items[i].name + "\");';><button><i class='fa fa-download'> </i></button></td>";
+ } else {
+ fileOrFolder = '<img src="images/folder.svg"></img>';
+ onclickFnc = "onclick='uriData(" + result.items[i].id + "," + result.items[i].parent + ")'";
+ dwnldTd = "<td></td>";
+ }
+ uriDataHtml += "<tr><td " + onclickFnc + ">" + fileOrFolder + result.items[i].name + "</td><td>" + result.items[i].size + "</td><td>" + result.items[i].date + "</td>\n\
+ <td>" + result.items[i].uri + "</td>" + dwnldTd + "</tr>";
+ $("#folderPath").html(uriDataHtml);
});
- }
- $(".se-pre-con").fadeOut("slow");
+ $("#parent").html("<b onclick=uriData(" + parent + ",null) >" + result.directory + "</b>");
+ $(".se-pre-con").hide();
+ }, "json")
+ .fail(function () {
+ $("#folderPath").html("Some error found");
+ });
+}
+function download(uris, filename) {
+ $(".se-pre-con").show();
+ var getdata = uris.split(",");
+ var uri = getdata[0];
+ var filename = getdata[1];
+ var accessTocken = "<?php echo $access_token; ?>";
+ var dlscfnc = "<?php echo $config['dlsc_path']; ?>"
+ var arraydata = {uri: uri, accesstoken: accessTocken, filename: filename}
+ $.ajax({
+ url: dlscfnc + 'download.php',
+ type: 'POST',
+ data: arraydata
+ }).done(function (response)
+ {
+ $(".se-pre-con").hide();
+ var getdata = JSON.parse(response);
+ console.log(getdata[1]);
+ window.open("data:" + getdata[0] + ";base64," + getdata[1], '', 'height=650,width=840');
+ });
+}
+$(".se-pre-con").fadeOut("slow");
</script>
</html>
\ No newline at end of file
--- 'a/footer.php'
+++ b/footer.php
@@ -32,7 +32,6 @@
</footer>
</div>
<!-- /.container -->
-<!-- jQuery -->
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
</body>
--- 'a/header.php'
+++ b/header.php
@@ -78,7 +78,7 @@
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">AADHAAR
</div>
- <ul class="dropdown-menu" style="margin-left: -8px;">
+ <ul class="dropdown-menu" style="margin-left: -5px;">
<li><a >Aadhaar Demographic Update</a></li><hr>
<li><a>Aadhaar Mobile Update</a></li><hr>
<li><a>Best Finger Detection</a></li><hr>
@@ -90,12 +90,11 @@
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">AGRICULTURE
</div>
- <ul class="dropdown-menu" style="margin-left: -8px;">
+ <ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >Agricultural Machine 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" >Marketplace</a></li>
-
</ul>
</div>
</li>
@@ -103,7 +102,7 @@
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">BANKING AND PENSION
</div>
- <ul class="dropdown-menu" style="margin-left: -8px;">
+ <ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >RAP Registration</a></li><hr>
<li><a tabindex="-1" >Basic Banking Course</a></li><hr>
<li><a tabindex="-1" >Life Certificate (LIC)</a></li><hr>
@@ -115,7 +114,7 @@
<li>
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">DIGILOCKER</div>
- <ul class="dropdown-menu" style="margin-left: -8px;">
+ <ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" href="https://digilocker.gov.in/public/register">Open Digilocker Account</a>
</li><hr>
<li>
@@ -169,12 +168,11 @@
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">ELECTION
</div>
- <ul class="dropdown-menu" style="margin-left: -8px;">
+ <ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >Punjab 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" >Rajasthan Election Services</a></li>
-
</ul>
</div>
</li>
@@ -182,12 +180,11 @@
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">GOVERNMENT
</div>
- <ul class="dropdown-menu" style="margin-left: -8px;">
+ <ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >Birth and Death Application</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" >Ration Card Services</a></li>
-
</ul>
</div>
</li>
@@ -195,12 +192,11 @@
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">INSURANCE
</div>
- <ul class="dropdown-menu" style="margin-left: -8px;">
+ <ul class="dropdown-menu" style="margin-left: -5px;">
<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" >Life Insurance</a></li><hr>
<li><a tabindex="-1" >Personal Accidental</a></li>
-
</ul>
</div>
</li>
@@ -208,7 +204,7 @@
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">TRAVEL
</div>
- <ul class="dropdown-menu" style="margin-left: -8px;">
+ <ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >Darshan Booking</a></li><hr>
<li><a tabindex="-1" >Bus Ticket Booking</a></li><hr>
<li><a tabindex="-1" >Flight Tickets</a></li><hr>
--- 'a/uploaddoc.php'
+++ b/uploaddoc.php
@@ -1,5 +1,4 @@
<?php
-include 'header.php';
include 'config.php';
$code = $_GET['code'];
$state = $_GET['state'];
@@ -16,7 +15,6 @@ curl_setopt($vh, CURLOPT_CUSTOMREQUEST,
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);
@@ -70,7 +68,25 @@ $resFile = curl_exec($vhf);
curl_close($vhf);
$resFileNew = explode('¿', $resFile);
$dataF = json_decode($resFileNew[1], TRUE);
+
+include 'header.php';
?>
+<style>
+ #fileUpload {
+ cursor: pointer;
+ cursor:hand;
+ margin: -14px -4px;
+ opacity: 0;
+ overflow: hidden;
+ position: relative;
+ z-index: 20;
+ }
+ .inputfile + label {
+ background-color: blueviolet;
+ color: #f1e5e6;
+ padding: 5px;
+ }
+</style>
<div class="se-pre-con"></div>
<div id="wrapper">
<div id="page-wrapper">
@@ -88,21 +104,22 @@ $dataF = json_decode($resFileNew[1], TRU
<div class="row">
<div class="col-md-12">
<div class="box box-body col-sm-12" >
- <div class="row" style="margin-top:10px;">
- <div class="col-md-6"><b onclick="uriData(null, null)" class="fa fa-home fa-2x" style="color:blueviolet;"></b><b id="parent" style="color:blueviolet;"></b>
+ <div class="row" style="margin-top:7px;">
+ <div class="col-md-3">
+ <b onclick="uriData(null, null)" class="fa fa-home fa-2x" style="color:blueviolet; cursor:pointer; cursor:hand;"></b>
+ <b id="parent" style="color:blueviolet; cursor:pointer; cursor:hand;"></b>
</div>
- <div class="col-md-6">
+ <div class="col-md-9 pull-left">
<form action="browse.php" method="post" enctype="multipart/form-data" >
- <div class="col-md-8" style="padding-left:130px;">
- <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 $state; ?>" name="state" class="hidden"/>
- <input type="text" name="filePath" class="hidden" value="" id="filePath"/>
- <input type="file" id="fileUpload" name="fileUpload"/>
- </div>
- <div class="col-md-4 " >
- <input type="submit" name="submit" class="btn btn-primary" value="Upload" style="height:23px; width:78px; padding:0px !important;">
- </div>
+ <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 $state; ?>" name="state" class="hidden"/>
+ <input type="text" name="filePath" class="hidden" value="" id="filePath"/>
+ <input type="file" class="inputfile" id="fileUpload" name="fileUpload"/>
+ <label for="fileUpload">
+ <i class="fa fa-upload"></i>
+ <span>Upload Here</span>
+ </label>
</form>
</div>
</div>
@@ -116,45 +133,45 @@ $dataF = json_decode($resFileNew[1], TRU
</tr>
</thead>
<tbody id="folderPath">
- <?php
- foreach ((array) ($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
- if (($api_detail['type']) == "dir") {
- echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
- echo '<img src="images/folder.svg"></img>';
- echo($api_detail['name']);
- }
- if ($api_detail['type'] == "file") {
- echo "<td onclick='thisIsNotAFolder()'>";
- echo '<img src="images/file.svg"></img>';
- echo($api_detail['name']);
+ <?php
+ foreach ((array) ($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'] = "";
}
- echo "</td>";
?>
- <td><?php echo($api_detail['size']); ?></td>
- <td><?php echo($api_detail['date']); ?></td>
- <?php if ($api_detail['type'] == "file") { ?>
- <td>
- <button onclick="download('<?php echo($api_detail['uri'] . ',' . $api_detail['name']); ?>')"><i class="fa fa-download"> </i></button>
- </td>
- <?php }
- ?>
- </tr>
- <?php }
- ?>
+ <tr>
+ <?php
+ if (($api_detail['type']) == "dir") {
+ echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
+ echo '<img src="images/folder.svg"></img>';
+ echo($api_detail['name']);
+ }
+ if ($api_detail['type'] == "file") {
+ echo "<td onclick='thisIsNotAFolder()'>";
+ echo '<img src="images/file.svg"></img>';
+ 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>
+ <button onclick="download('<?php echo($api_detail['uri'] . ',' . $api_detail['name']); ?>')"><i class="fa fa-download"> </i></button>
+ </td>
+ <?php }
+ ?>
+ </tr>
+ <?php }
+ ?>
</tbody>
</table>
<div class="footer">
- <a class="btn btn-primary" style="float: right; margin-left: 10px; border-radius:5px;" href="payment.php">Complete Payment</a>
- <a class="btn btn-primary" style="float: right; border-radius:5px;" href="index.php">Cancel</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="index.php">Cancel</a>
</div>
</div>
</div>
@@ -171,66 +188,70 @@ $dataF = json_decode($resFileNew[1], TRU
<?php include 'footer.php' ?>
<script src="js/modernizr.js"></script>
<script>
-
+$(document).on('change', "#fileUpload", function () {
+ $("form").submit();
+});
+$("#filePath").val("");
+function uriData(id, parent) {
+ $("#folderPath").empty();
+ $("#fileUpload").val("");
$("#filePath").val("");
- function uriData(id, parent) {
- $("#folderPath").empty();
- $("#fileUpload").val("");
- $("#filePath").val("");
- $("#tdUri").show();
- var id = id;
- var accessTocken = "<?php echo $access_token; ?>";
- var uri = "<?php echo $api_detail['uri']; ?>";
- var uriDataHtml = "";
- var fileOrFolder = "";
- var onclickFnc = "";
- var dwnldTd = "";
- var accessToken = "<?php echo $access_token; ?>";
- var urifnc = "<?php echo $config['uri_path']; ?>";
- $.post(urifnc, {access_token: accessTocken, id: id}, function (result) {
- $.each(result.items, function (i, l) {
-
- if (result.items[i].type == "file") {
- console.log(result.items);
- fileOrFolder = '<img src="images/file.svg"></img>';
- onclickFnc = "onclick='thisIsNotAFolder()'";
- dwnldTd = "<td onclick = 'download(\"" + result.items[i].uri + "\",\"" + result.items[i].name + "\");';><button><i class='fa fa-download'> </i></button></td>";
- } else {
- fileOrFolder = '<img src="images/folder.svg"></img>';
- onclickFnc = "onclick='uriData(" + result.items[i].id + "," + result.items[i].parent + ")'";
- dwnldTd = "<td></td>";
- }
- uriDataHtml += "<tr><td " + onclickFnc + ">" + fileOrFolder + result.items[i].name + "</td><td>" + result.items[i].size + "</td><td>" + result.items[i].date + "</td>\n\
- <td>" + result.items[i].uri + "</td>" + dwnldTd + "</tr>";
- $("#folderPath").html(uriDataHtml);
- });
- $("#filePath").val(result.directory);
- $("#parent").html("<b onclick=uriData(" + parent + ",null)>" + result.directory + "</b>");
- }, "json")
- .fail(function () {
- $("#folderPath").html("Some error found");
- });
- }
- function download(uris, filename) {
- $(".se-pre-con").show();
- var getdata = uris.split(",");
- var uri = getdata[0];
- var filename = getdata[1];
- var accessTocken = "<?php echo $access_token; ?>";
- var dlscfnc = "<?php echo $config['dlsc_path']; ?>"
- var arraydata = {uri: uri, accesstoken: accessTocken, filename: filename}
- $.ajax({
- url: dlscfnc+'download.php',
- type: 'POST',
- data: arraydata
- }).done(function (response)
- {
- $(".se-pre-con").hide();
- var getdata = JSON.parse(response);
- console.log(getdata[1]);
- window.open("data:" + getdata[0] + ";base64," + getdata[1], '', 'height=650,width=840');
+ $("#tdUri").show();
+ $(".se-pre-con").show();
+ var id = id;
+ var accessTocken = "<?php echo $access_token; ?>";
+ var uri = "<?php echo $api_detail['uri']; ?>";
+ var uriDataHtml = "";
+ var fileOrFolder = "";
+ var onclickFnc = "";
+ var dwnldTd = "";
+ var accessToken = "<?php echo $access_token; ?>";
+ var urifnc = "<?php echo $config['uri_path']; ?>";
+ $.post(urifnc, {access_token: accessTocken, id: id}, function (result) {
+ $.each(result.items, function (i, l) {
+
+ if (result.items[i].type == "file") {
+ console.log(result.items);
+ fileOrFolder = '<img src="images/file.svg"></img>';
+ onclickFnc = "onclick='thisIsNotAFolder()'";
+ dwnldTd = "<td onclick = 'download(\"" + result.items[i].uri + "\",\"" + result.items[i].name + "\");';><button><i class='fa fa-download'> </i></button></td>";
+ } else {
+ fileOrFolder = '<img src="images/folder.svg"></img>';
+ onclickFnc = "onclick='uriData(" + result.items[i].id + "," + result.items[i].parent + ")'";
+ dwnldTd = "<td></td>";
+ }
+ uriDataHtml += "<tr><td " + onclickFnc + ">" + fileOrFolder + result.items[i].name + "</td><td>" + result.items[i].size + "</td><td>" + result.items[i].date + "</td>\n\
+<td>" + result.items[i].uri + "</td>" + dwnldTd + "</tr>";
+ $("#folderPath").html(uriDataHtml);
});
- }
- $(".se-pre-con").fadeOut("slow");
+ $("#filePath").val(result.directory);
+ $("#parent").html("<b onclick=uriData(" + parent + ",null)>" + result.directory + "</b>");
+ $(".se-pre-con").hide();
+ }, "json")
+ .fail(function () {
+ $("#folderPath").html("Some error found");
+ });
+}
+function download(uris, filename) {
+ $(".se-pre-con").show();
+ var getdata = uris.split(",");
+ var uri = getdata[0];
+ var filename = getdata[1];
+ var accessTocken = "<?php echo $access_token; ?>";
+ var dlscfnc = "<?php echo $config['dlsc_path']; ?>"
+ var arraydata = {uri: uri, accesstoken: accessTocken, filename: filename}
+ $.ajax({
+ url: dlscfnc + 'download.php',
+ type: 'POST',
+ data: arraydata
+ }).done(function (response)
+ {
+ $(".se-pre-con").hide();
+ var getdata = JSON.parse(response);
+ console.log(getdata[1]);
+ window.open("data:" + getdata[0] + ";base64," + getdata[1], '', 'height=650,width=840');
+ });
+}
+$(".se-pre-con").fadeOut("slow");
</script>
</html>
\ No newline at end of file
--- 'a/xml/hashKey.xml'
+++ b/xml/hashKey.xml
@@ -1,5 +1,10 @@
<?xml version="1.0"?>
<maincontent>
+<<<<<<< HEAD
<code num="96858eb0ae6e8bf2a7d039884607e64123491d93"/>
<access_token>b22b8855d8181f04d13e365e931555c903af71e5</access_token>
+=======
+ <code num="20ed1cc268156605f5281a52e2adf5c1c4b2c083"/>
+ <access_token>f3d904f5c239c28b620e28dad6265fbad321b029</access_token>
+>>>>>>> b79261665b00b1e2d582f3671952cc8bd3cd11b5
</maincontent>
--- 'a/xml/hashhkey.xml'
+++ b/xml/hashhkey.xml
@@ -1,5 +1,10 @@
<?xml version="1.0"?>
<maincontent>
+<<<<<<< HEAD
<code num="4a0bb790b1f7509e18264a363dcab2d09bf9a016"/>
<access_token>72ffd3b88365481579eadbb19518935d7a43ef09</access_token>
+=======
+ <code num="7ba70ff76b57de95f1643ee669affb27c5c5ec5c"/>
+ <access_token>86a8123cb941790bedf2c2f9d97d389375f5a420</access_token>
+>>>>>>> b79261665b00b1e2d582f3671952cc8bd3cd11b5
</maincontent>