Skip to content

Commit

Permalink
Merge pull request #46 from heroesoebekti/master
Browse files Browse the repository at this point in the history
Add item location filter for loan history report
  • Loading branch information
slims authored Jun 28, 2017
2 parents 5117bd6 + 8b700e8 commit 17de4af
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
16 changes: 16 additions & 0 deletions admin/modules/bibliography/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,22 @@ function getimagesizefromstring($string_data)
$sql_op->delete('biblio_attachment', "biblio_id=$itemID");
$sql_op->delete('biblio_relation', "biblio_id=$itemID");
$sql_op->delete('search_biblio', "biblio_id=$itemID");

// delete serial data
// check kardex if exist
$_sql_serial_kardex_q = sprintf('SELECT b.title, COUNT(kardex_id),s.serial_id FROM biblio AS b
LEFT JOIN `serial` AS s ON b.biblio_id=s.biblio_id
LEFT JOIN kardex AS k ON s.serial_id=k.serial_id
WHERE b.biblio_id=%d GROUP BY title', $itemID);
$serial_kardex_q = $dbs->query($_sql_serial_kardex_q);
$serial_kardex_d = $serial_kardex_q->fetch_row();
// delete kardex
if ($serial_kardex_d[1] > 1) {
$sql_op->delete('kardex', "serial_id=".$serial_kardex_d[2]);
}
//delete serial data
$sql_op->delete('serial', "biblio_id=$itemID");

// add to http query for UCS delete
$http_query .= "itemID[]=$itemID&";
}
Expand Down
24 changes: 21 additions & 3 deletions admin/modules/reporting/customs/loan_history.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,20 @@
<select name="loanStatus"><option value="ALL"><?php echo __('ALL'); ?></option><option value="0"><?php echo __('On Loan'); ?></option><option value="1"><?php echo __('Returned'); ?></option></select>
</div>
</div>
<div class="divRow">
<div class="divRowLabel"><?php echo __('Location'); ?></div>
<div class="divRowContent">
<?php
$loc_q = $dbs->query('SELECT location_id, location_name FROM mst_location');
$loc_options = array();
$loc_options[] = array('0', __('ALL'));
while ($loc_d = $loc_q->fetch_row()) {
$loc_options[] = array($loc_d[0], $loc_d[1]);
}
echo simbio_form_element::selectList('location', $loc_options);
?>
</div>
</div>
<div class="divRow">
<div class="divRowLabel"><?php echo __('Record each page'); ?></div>
<div class="divRowContent"><input type="text" name="recsEachPage" size="3" maxlength="3" value="<?php echo $num_recs_show; ?>" /> <?php echo __('Set between 20 and 200'); ?></div>
Expand Down Expand Up @@ -202,9 +216,13 @@
$membershipType = (integer)$_GET['membershipType'];
$criteria .= ' AND m.member_type_id='.$membershipType;
}




// item location
if (isset($_GET['location']) AND !empty($_GET['location'])) {
$location = $dbs->escape_string(trim($_GET['location']));
$criteria .= ' AND i.location_id=\''.$location.'\'';
}

if (isset($_GET['recsEachPage'])) {
$recsEachPage = (integer)$_GET['recsEachPage'];
$num_recs_show = ($recsEachPage >= 20 && $recsEachPage <= 200)?$recsEachPage:$num_recs_show;
Expand Down
1 change: 1 addition & 0 deletions admin/modules/system/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
} else {
echo __('This theme not customizable');
}
require SB.'/admin/'.$sysconf['admin_template']['dir'].'/notemplate_page_tpl.php';
exit();
}

Expand Down

0 comments on commit 17de4af

Please sign in to comment.