-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathall-items.php
More file actions
91 lines (72 loc) · 2.65 KB
/
all-items.php
File metadata and controls
91 lines (72 loc) · 2.65 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
include('header.php');
include('export/export_zip.php');
?>
<?php
function statusIcon($status) {
if ($status == "true") {
return "<i class=\"fa fa-check\" aria-hidden=\"true\"></i>";
}
if ($status == "false") {
return "<i class=\"fa fa-times\" aria-hidden=\"true\"></i>";
}
}
?>
<script src="script/deleteRecord.js"></script>
<div class="delete-dialog">Are you sure you want to delete this record?</div>
<div class="recordtitle-bkg">
<div class="recordtitle">
<div class="inner-area"><h2 class="page-top-heading">All Items</h2></div>
</div>
</div>
<div class="decoration-bar">
<div class="pure-g">
<div class="pure-u-1-4 decor1"></div>
<div class="pure-u-1-4 decor2"></div>
<div class="pure-u-1-4 decor3"></div>
<div class="pure-u-1-4 decor4"></div>
</div>
</div>
<div class="inner-area">
<div class="pure-g">
<div class="pure-u-1">
<div class="content_box">
<?php
use RAMP\Util\RecordList;
use RAMP\Util\Database;
$db = Database::getInstance();
$rl = new RecordList($db);
$allItems = $rl->getList();
include('includes/all_items_table_header.php');
foreach($allItems as $item):
echo "<tr id='{$item['eac_id']}'>";
echo "<td>".$item['Name']."</a></td>";
echo "<td>".statusIcon($item['ingest_status']['statuses'][0]['status'])."</td>";
echo "<td>".statusIcon($item['ingest_status']['statuses'][1]['status'])."</td>";
echo "<td>".statusIcon($item['ingest_status']['statuses'][2]['status'])."</td>";
echo "<td><a href='#' onclick='deleteRecord({$item['eac_id']})'><i class=\"fa fa-trash\" aria-hidden=\"true\"></i></a></td>";
echo "<td><a href='ajax/download_eac.php?eac_id={$item['eac_id']}'><i class=\"fa fa-download\" aria-hidden=\"true\"></i></a></td>";
echo "</tr>";
endforeach;
echo "</table>";
?>
<div class="pure-button ramp-button action-button export-zip-download">
<?php
// Run function to create the export zip file
exportZip();
?>
<a href="export/ramp-export.zip">Download All Records <i class="fa fa-download" aria-hidden="true"></i></a>
</div>
</div>
</div>
</div>
</div>
<script>
if ($('tbody').children().size() === 1) {
$('.export-zip-download').remove();
$('.content_box').html('<p>There are no items. You will need to <a href="ead_convert.php">import items</a> before they are displayed here.</p>');
}
</script>
<?php
include('footer.php');
?>