-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathymbrik.php
74 lines (64 loc) · 2.14 KB
/
ymbrik.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
session_start();
if(@$_SESSION['auth']!=1) header('Location: login.php');
require('conf.php');
## Määrame baasi mida kuvatakse
if(isset($_GET["inst"])) {
$inst = $_GET["inst"];
} else {
## kui defineerimata siis siis määrame selleks esimese baasi listis
$inst = key($inst_list);
}
require('func/base.php');
require('theme/header.php');
echo '<main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-4 kapsel">
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-1 border-bottom">
<h1 class="h2">'.$inst_list[$inst][0].'</h1>
<div class="btn-toolbar mb-2 mb-md-0">
<div class="btn-group mr-2">
<button type="button" onclick="javascript:history.go(-1)" class="btn btn-sm btn-outline-secondary">Tagasi</button>
</div>
</div>
</div>';
//NB! Apache peab olema õigus failide lugemiseks
//Check for variable
if(isset($_GET['f']))
{
$fileName = $_GET['f'];
$path = $inst_list[$inst][2];
$getFiles = glob("$path/$fileName*");
if(!empty($getFiles)) {
$countFilesFound = count($getFiles);
echo "</ul>";
for($x=0;$x<$countFilesFound;$x++) {
$selectFile=$getFiles[$x];
echo "<b id=\"".$x."\">GUID: ".basename($getFiles[$x])."</b><br><br>";
$getFileContent = file_get_contents($selectFile);
$cleanTags = str_replace(array('S:','SOAP-ENV:','SOAP:','�','tsl:','ns2:','ns3:','ns4:','ns5:','ns6:','ns7:','ns8:','ns9:'),array('','','','','','','','','','','','',''),$getFileContent);
$xml = simplexml_load_string($cleanTags, 'SimpleXMLElement', LIBXML_NOBLANKS);
//Remove empty tags
$xpath = '/*//*[
normalize-space(.) = "" and
not(
@* or
.//*[@*] or
.//comment() or
.//processing-instruction()
)
]';
foreach (array_reverse($xml->xpath($xpath)) as $remove) {
unset($remove[0]);
}
// remove transport tags
unset($xml->Transport);
RecurseXML($xml);
}
} else {
echo "<h3>Faile ei leitud!</h3>";
}
} else {
echo "Viga: Midagi on puudu....";
}
?>
</main>
<?php require('theme/footer.php'); ?>