authpartner
Clone or download
Modified Files
--- 'a/doc.php'
+++ b/doc.php
@@ -29,10 +29,10 @@ if(!$notgettingdata[1]){
header("Location: index.php?message=THIS IS ERROR");
}
$getToken = json_decode($notgettingdata[1]);
-
if (isset($getToken->access_token)) {
$access_token = $getToken->access_token;
}
+$file = "xml/hashKey.xml";
if (isset($access_token)) {
$doc = new DOMDocument('1.0');
$doc->formatOutput = true;
@@ -49,12 +49,12 @@ if (isset($access_token)) {
$title = $root->appendChild($title);
$text = $doc->createTextNode($access_token);
$text = $title->appendChild($text);
- $doc->save("xml/hashKey.xml");
+ $doc->save($file);
}
-if (file_exists("xml/hashKey.xml")) {
- $xml = (array) simplexml_load_file("xml/hashKey.xml") or die("Error: Cannot create object");
+if (file_exists($file)) {
+ $xml = (array) simplexml_load_file($file) or die("Error: Cannot create object");
} else {
- echo "xml/hashKey.xml file doesnot exists";
+ echo $file. " file doesnot exists";
}
$access_token = $xml['access_token'];
@@ -86,8 +86,9 @@ foreach ($uriRes->items as $uriI) {
$uriFiles[] = (array) $uriI;
}
}
+$item = "items";
$uriItems = array_merge($uriDir, $uriFiles);
-$uriItemsArray['items'] = $uriItems;
+$uriItemsArray[$item] = $uriItems;
$dataDirectory['directory'] = $uriRes->directory;
$dataF = array_merge($dataDirectory, $uriItemsArray);
@@ -144,10 +145,10 @@ include 'header.php';
</thead>
<tbody id="folderPath">
<?php
- foreach ((array) ($dataF['items']) as $api_detail) {
+ foreach ((array) ($dataF[$item]) as $api_detail) {
if (isset($api_detail['id'])) {
- $api_detail['id'] = $api_detail['id'];
- $api_detail['parent'] = $api_detail['parent'];
+ $api_id = $api_detail['id'];
+ $api_parent = $api_detail['parent'];
} else {
$api_detail['id'] = "";
}
@@ -155,23 +156,23 @@ include 'header.php';
<tr>
<?php
if (($api_detail['type']) == "dir") {
- echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
+ echo '<td onclick="uriData(' . $api_id . ',' . $api_parent . ')">';
echo '<img src="images/folder.svg"></img>';
- echo($api_detail['name']);
+ echo $api_detail['name'];
echo "</td>";
}
if ($api_detail['type'] == "file") {
echo "<td>";
echo '<img src="images/file.svg"></img>';
- echo($api_detail['name']);
+ echo $api_detail['name'];
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>
<?php if ($api_detail['type'] == "file") { ?>
<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>
<?php }else{
echo "<td></td>";
@@ -211,14 +212,14 @@ include 'header.php';
<tr><td>
<?php
echo '<img src="images/issuedfile.png"></img>';
- echo($issued_detail['name']);
+ echo $issued_detail['name'];
?>
</td>
- <td><?php echo($issued_detail['uri']); ?></td>
- <td><?php echo($issued_detail['date']); ?></td>
+ <td><?php echo$issued_detail['uri']; ?></td>
+ <td><?php echo$issued_detail['date']; ?></td>
<td><?php if ($api_detail['type'] == "file") { ?>
<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>
<?php } ?>
</tr>
--- 'a/header.php'
+++ b/header.php
@@ -158,7 +158,6 @@
<label class="control-label" for="inputSuccess">State</label>
<input type="text" class="form-control" name = "state" value="123456">
</div>
-
<button type="submit" class="btn">Download</button>
</form>
</span>
--- 'a/index.php'
+++ b/index.php
@@ -1,11 +1,11 @@
<?php include 'header.php' ;
?>
-<!-- Marketing Icons Section -->
<div class="col-lg-12">
<div class="container">
<?php
- if (isset($_GET['message'])) {
- $message=$_GET['message'];
+ $msg = "message";
+ if (isset($_GET[$msg])) {
+ $message=$_GET[$msg];
$alert = "red";
echo "<div class='alert' id='alert' style='color:" . $alert . "'> <button type='button' class='close' data-dismiss='alert'>x</button>" . $message . "</div>";
--- 'a/tokan.php'
+++ b/tokan.php
@@ -1,5 +1,5 @@
<?php
-
+ $file = "xml/hashKey.xml";
$doc = new DOMDocument('1.0');
$doc->formatOutput = true;
$root = $doc->createElement('maincontent');
@@ -13,12 +13,12 @@
$title = $root->appendChild($title);
$text = $doc->createTextNode("");
$text = $title->appendChild($text);
- $doc->save("xml/hashKey.xml");
+ $doc->save($file);
$doc->save("xml/hashhKey.xml");
-if (file_exists("xml/hashKey.xml")) {
- $xml = (array) simplexml_load_file("xml/hashKey.xml") or die("Error: Cannot create object");
+if (file_exists($file)) {
+ $xml = (array) simplexml_load_file($file) or die("Error: Cannot create object");
} else {
- echo "xml/hashKey.xml file doesnot exists";
+ echo $file. " file doesnot exists";
}
header("Location: index.php");
?>
--- 'a/uploaddoc.php'
+++ b/uploaddoc.php
@@ -32,6 +32,7 @@ $getToken = json_decode($notgettingdata[
if (isset($getToken->access_token)) {
$access_token = $getToken->access_token;
}
+$file = "xml/hashKey.xml";
if (isset($access_token)) {
$doc = new DOMDocument('1.0');
$doc->formatOutput = true;
@@ -48,12 +49,12 @@ if (isset($access_token)) {
$title = $root->appendChild($title);
$text = $doc->createTextNode($access_token);
$text = $title->appendChild($text);
- $doc->save("xml/hashhkey.xml");
+ $doc->save($file);
}
-if (file_exists("xml/hashhkey.xml")) {
- $xml = (array) simplexml_load_file("xml/hashhkey.xml") or die("Error: Cannot create object");
+if (file_exists($file)) {
+ $xml = (array) simplexml_load_file($file) or die("Error: Cannot create object");
} else {
- echo "xml/hashhkey.xml file doesnot exists";
+ echo $file. " file doesnot exists";
}
$access_token = $xml['access_token'];
@@ -116,12 +117,13 @@ include 'header.php';
<div class="col-lg-12">
<div class="container">
<?php
- if (isset($_GET['message'])) {
+ $msg = "message";
+ if (isset($_GET[$msg])) {
$alert = "red";
- if ($_GET['message'] == "File Uploaded Successfully") {
+ if ($_GET[$msg] == "File Uploaded Successfully") {
$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[$msg] . "</div>";
}
?>
</div>
@@ -170,8 +172,8 @@ include 'header.php';
<?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'];
+ $api_id = $api_detail['id'];
+ $api_parent = $api_detail['parent'];
} else {
$api_detail['id'] = "";
}
@@ -179,18 +181,18 @@ include 'header.php';
<tr>
<?php
if (($api_detail['type']) == "dir") {
- echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
+ echo '<td onclick="uriData(' . $api_id . ',' . $api_parent . ')">';
echo '<img src="images/folder.svg" style="margin-right:10px;"></img>';
- echo($api_detail['name']);
+ echo $api_detail['name'];
}
if ($api_detail['type'] == "file") {
echo "<td>";
echo '<img src="images/file.svg" style="margin-right:10px;"></img>';
- echo($api_detail['name']);
+ echo $api_detail['name'];
}
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>
<?php if ($api_detail['type'] == "file") { ?>
<?php }