You are here

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

Same name and namespace in other branches
  1. 6.2 includes/database.inc \merci_reservation_totals()
  2. 6 merci.module \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 TODO NOT USER.

File

includes/database.inc, line 203
MERCI - Managed Equipment Reservation Checkout and Inventory

Code

function merci_reservation_totals($type, $startdate, $enddate) {
  return db_query("SELECT COUNT(nid) as total  FROM {node} WHERE type LIKE :type and status = :status AND created > :created AND created < :created2", array(
    ':status' => 0,
    ':type' => $type,
    ':created' => $startdate,
    ':created2' => $enddate,
  ))
    ->fetchField();
}