Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit a2ccf9f

Browse files
committed
Bug fixes
* Next upload date now submits to the database * Added an “Inactive” tab to complement the existing “Active” tab
1 parent 77bdabe commit a2ccf9f

File tree

5 files changed

+67
-3
lines changed

5 files changed

+67
-3
lines changed

add.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
$username = trim($_REQUEST['username']);
8484
$password = trim($_REQUEST['password']);
8585
$frequency = trim($_REQUEST['frequency']);
86-
if($form_data['next_load'] != '') {
87-
$next_load = trim(date('Y-m-d', strtotime($_REQUEST['next_load'])));
86+
if($_REQUEST['next_load'] != '') {
87+
$next_load = date('Y-m-d', strtotime($_REQUEST['next_load']));
8888
} else {
8989
$next_load = NULL;
9090
}

assets/styles/styles.css

+44
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,48 @@ ul li {
5858
}
5959
.w15 {
6060
min-width: 15em;
61+
}
62+
/* CHART LISTS */
63+
.chartlist {
64+
font-size: 1.5em;
65+
float: left;
66+
width: 15em;
67+
}
68+
.chartlist li {
69+
position: relative;
70+
display: block;
71+
border: 1px solid #eee;
72+
_zoom: 1;
73+
}
74+
.chartlist li a {
75+
display: block;
76+
padding: 0.4em 4.5em 0.4em 0.5em;
77+
position: relative;
78+
z-index: 2;
79+
}
80+
.chartlist .count {
81+
display: block;
82+
position: absolute;
83+
top: 0;
84+
right: 0;
85+
margin: 0 0.3em;
86+
text-align: right;
87+
color: #999;
88+
font-weight: bold;
89+
font-size: 0.875em;
90+
line-height: 2em;
91+
}
92+
.chartlist .index {
93+
display: block;
94+
position: absolute;
95+
top: 0;
96+
left: 0;
97+
height: 100%;
98+
background: #b8e4f5;
99+
text-indent: -9999px;
100+
overflow: hidden;
101+
line-height: 2em;
102+
}
103+
.chartlist li:hover {
104+
background: #efefef;
61105
}

inactive.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
require_once 'config.php';
3+
4+
$database = new db;
5+
$db = $database->connect();
6+
$sql = 'SELECT r.id, r.resource_name, r.url, r.username, r.password, r.frequency, r.last_load, r.next_load, r.num_records, r.notes, r.last_updated, r.file_exists, v.name AS vendor_name FROM records r INNER JOIN vendors v ON r.vendor_id = v.id WHERE load_records = "N" ORDER BY r.next_load ASC, vendor_name, resource_name';
7+
$query = $db->prepare($sql);
8+
$query->execute();
9+
$marc_record_loads = $query->fetchAll(PDO::FETCH_ASSOC);
10+
$db = null;
11+
12+
$html = array('title' => 'Inactive', 'results' => $marc_record_loads);
13+
template::display('html.tmpl', $html);
14+
?>

templates/_body.tmpl

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
{% spaceless %}
44
{% autoescape false %}
55

6+
{% if stats %}
67
<ul class="chartlist">
78
<li>
89
<a href="#">{{ stats.percent_complete}} up to date</a>
910
<span class="index" style="width:{{ stats.percent_complete}}">{{ stats.percent_complete}}</span>
1011
</li>
1112
</ul><br/>
12-
1313
<p style="clear:both;">{{ stats.num_up_to_date_resources|number_format }} out of {{ stats.num_resources|number_format }} resources are up to date.</p>
1414
<p><strong>Number of MARC Records</strong>: {{ stats.num_records|number_format }} (<a href="download.php">download all records</a>)</p>
15+
{% endif %}
1516

1617
<table id="resources" class="tablesorter">
1718
<thead><tr><th></th><th class="w15">583 (Vendor-Resource Name)<br/>Username :: Password</th><th class="w6">Frequency</th><th class="w6">Last load</th><th class="w6">Next load</th><th>Load records</th><th>Notes</th></tr></thead>

templates/_navigation.tmpl

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
{% else %}
88
<li><a href="{{ app_url }}/">Active</a></li>
99
{% endif %}
10+
{% if title == 'Inactive' %}
11+
<li class="active"><a href="{{ app_url }}/inactive.php">Inactive</a></li>
12+
{% else %}
13+
<li><a href="{{ app_url }}/inactive.php">Inactive</a></li>
14+
{% endif %}
1015
{% if title == 'All' %}
1116
<li class="active"><a href="{{ app_url }}/all.php">All</a></li>
1217
{% else %}

0 commit comments

Comments
 (0)