-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabcdcheck.php
50 lines (48 loc) · 2.07 KB
/
abcdcheck.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
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<style>
body{font-family: Arial, Helvetica; font-size: 12pt}
table{border-collapse: collapse;}
th {border: 1px solid black; font-style: bold}
td {font-size: 10pt; border: 1px solid grey}
</style>
</head>
<body>
<h1>GFBio ABCD check</h1>
<table><tr><th>Archive</th><th>ABCD Version</th><th>Dataset title</th><th>File creation</th><th>Metadata modified (abcd:DateModified)</th></th><th>Data Center (abcd:TechnicalContact)</th><th>Publisher (abcd:Owner)</th></tr>
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$abcddir='ABCD';
$dirlisting = scandir($abcddir);
#print_r($dirlisting);
foreach ($dirlisting as $dir){
$abcd=null;
if(is_dir($abcddir.'/'.$dir)&&$dir!='..'&&$dir!='.'){
$abcdversion='2.06';
echo '<tr>';
$abcdfile=$abcddir.'/'.$dir.'/'.'response.00001.xml';
if(file_exists($abcdfile)){
$xml=file_get_contents($abcdfile);
$biocasexml=simplexml_load_string($xml);
$abcd=$biocasexml->children('http://www.tdwg.org/schemas/abcd/2.06');
if(sizeof($abcd)==0) {
$abcd=$biocasexml->children('http://www.tdwg.org/schemas/abcd/2.1');
$abcdversion='2.1';
}
echo '<td>'.$dir.'</td>';
echo '<td>'.$abcdversion.'</td>';
echo '<td>'.$abcd->DataSet->Metadata->Description->Representation->Title.'</td>';
echo '<td>'.date ("d.m.Y", filemtime($abcdfile)).'</td>';
echo '<td>'.$abcd->DataSet->Metadata->RevisionData->DateModified.'</td>';
echo '<td>'.$abcd->DataSet->TechnicalContacts->TechnicalContact->Name.'</td>';
#DataSets/DataSet/Metadata/Owners/Owner/Organisation/Name/Representation/Text
echo '<td>'.$abcd->DataSet->Metadata->Owners->Owner->Organisation->Name->Representation->Text.'</td>';
}
echo '<tr>';
}
}
?>
</body>
</table>
</html>