You are here

function merci_reservation_totals in MERCI (Manage Equipment Reservations, Checkout and Inventory) 6

Same name and namespace in other branches
  1. 6.2 includes/database.inc \merci_reservation_totals()
  2. 7.2 includes/database.inc \merci_reservation_totals()

Returns totals for reporting.

Parameters

$type: The bucket or resrouce node type.

$startdate: TRUE to restrict to published items, FALSE otherwise.

Return value

Total reservation number for that type betweent the start and end dates

File

./merci.module, line 2787
MERCI - Managed Equipment Reservation Checkout and Inventory

Code

function merci_reservation_totals($type, $startdate, $enddate) {
  $result = db_query("SELECT COUNT(nid) as total  FROM {node} WHERE type LIKE '%s' and status = 0 AND created > %d AND created < %d", $type, $startdate, $enddate);
  $reservationnode = db_fetch_object($result);
  return $reservationnode->total;
}