-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsopac-user-history-list.tpl.php
65 lines (59 loc) · 2.16 KB
/
sopac-user-history-list.tpl.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
<?php
print $required_hidden_fields;
//print_r($form['sort_by']);
$uri_arr = explode( '?', request_uri() );
$uri = $uri_arr[0];
$get_sort = $form['sort_by']['#value'];
$search_str = $form['search_str'] ? $form['search_str'] : NULL;
$sort_title = $uri . '?sort=' . (($get_sort == 'title_up') ? 'title_down' : 'title_up');
$sort_author = $uri . '?sort=' . (($get_sort == 'author_up') ? 'author_down' : 'author_up');
$sort_date = $uri . '?sort=date_up';
if ($search_str) {
$sort_title .= '&search=' . $search_str;
$sort_author .= '&search=' . $search_str;
$sort_date .= '&search=' . $search_str;
}
?>
<span style="float:right">Sort by: <a href="<? print $sort_title ?>">Title</a> | <a href="<? print $sort_author ?>">Author</a> | <a href="<? print $sort_date ?>">Checkout Date</a></span>
<table cellspacing="0" class="sticky-enabled sticky-table" id="patroninfo">
<thead class="tableHeader-processed">
<tr>
<th style="width:10%">Delete</th>
<th style="width:90%">Item</th>
</tr>
</thead>
<form>
<tbody>
<?php
$zebra = 'even';
foreach ($form['history'] as $hist_id => $hist_item) {
if (is_numeric($hist_id)) {
$zebra = $zebra == 'odd' ? 'even' : 'odd';
$codate = $hist_item['codate']['#value'];
$date_arr = date_parse($codate);
$codate_fmt = $date_arr['month'] . '-' . $date_arr['day'] . '-' . $date_arr['year'];
?>
<tr class="<?php print $zebra ?>">
<td><?php print drupal_render($form['history'][$hist_id]['delete']) ?></td>
<td>
<strong><?php print $hist_item['title_link']['#value'] ?></strong><br />
<?php if ($hist_item['author']['#value']) { print '<em>' . $hist_item['author']['#value'] . '</em><br />'; } ?>
This item was checked out on <strong><?php print $codate_fmt ?></strong>
</td>
</tr>
<?php
}
}
print drupal_render($form['form_token']);
print drupal_render($form['form_id']);
print drupal_render($form['form_build_id']);
?>
<tr class="profile_button">
<td></td>
<td>
<?php print drupal_render($form['submit']) . ' ' . drupal_render($form['deleteall']) ?>
</td>
</tr>
</tbody>
</form>
</table>