function merci_get_reservation_count in MERCI (Manage Equipment Reservations, Checkout and Inventory) 6.2
Same name and namespace in other branches
- 7.2 includes/database.inc \merci_get_reservation_count()
merci_get_reservation_count($content_type[string]) returns total number of checked out items for content type. @ $content_type resource to be counted
2 calls to merci_get_reservation_count()
- MerciUserTestCase::testMerciCheckedOutCase in tests/
merci_user.test - theme_merci_current_inventory in theme/
theme.inc - returns the number of items currently checked out for each content type TODO: change this to a views view.
File
- includes/
database.inc, line 116 - MERCI - Managed Equipment Reservation Checkout and Inventory
Code
function merci_get_reservation_count($content_type) {
return db_result(db_query("SELECT COUNT(n.nid) as total FROM {node} n\n JOIN {merci_reservation_detail} mrin ON mrin.vid = n.vid\n JOIN {node} ctn ON mrin.merci_item_nid = ctn.nid\n WHERE ctn.type = '%s' and mrin.merci_item_status = %d", $content_type, MERCI_ITEM_STATUS_CHECKED_OUT));
}