Lines 278-293
sub GetAllIssues {
Link Here
|
278 |
'SELECT *, issues.timestamp as issuestimestamp, issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp |
278 |
'SELECT *, issues.timestamp as issuestimestamp, issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp |
279 |
FROM issues |
279 |
FROM issues |
280 |
LEFT JOIN items on items.itemnumber=issues.itemnumber |
280 |
LEFT JOIN items on items.itemnumber=issues.itemnumber |
|
|
281 |
LEFT JOIN borrowers on borrowers.borrowernumber=issues.issuer |
281 |
LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber |
282 |
LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber |
282 |
LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber |
283 |
LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber |
283 |
WHERE borrowernumber=? |
284 |
WHERE issues.borrowernumber=? |
284 |
UNION ALL |
285 |
UNION ALL |
285 |
SELECT *, old_issues.timestamp as issuestimestamp, old_issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp |
286 |
SELECT *, old_issues.timestamp as issuestimestamp, old_issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp |
286 |
FROM old_issues |
287 |
FROM old_issues |
287 |
LEFT JOIN items on items.itemnumber=old_issues.itemnumber |
288 |
LEFT JOIN items on items.itemnumber=old_issues.itemnumber |
|
|
289 |
LEFT JOIN borrowers on borrowers.borrowernumber=old_issues.issuer |
288 |
LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber |
290 |
LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber |
289 |
LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber |
291 |
LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber |
290 |
WHERE borrowernumber=? AND old_issues.itemnumber IS NOT NULL |
292 |
WHERE old_issues.borrowernumber=? AND old_issues.itemnumber IS NOT NULL |
291 |
order by ' . $order; |
293 |
order by ' . $order; |
292 |
if ($limit) { |
294 |
if ($limit) { |
293 |
$query .= " limit $limit"; |
295 |
$query .= " limit $limit"; |