You are here

function merci_reservation_items in MERCI (Manage Equipment Reservations, Checkout and Inventory) 6.2

Same name and namespace in other branches
  1. 7.3 merci_migrate/merci_line_item.inc \merci_reservation_items()
  2. 7.2 includes/database.inc \merci_reservation_items()
1 call to merci_reservation_items()
merci_load in ./merci.module
Implementation of hook_load().

File

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

Code

function merci_reservation_items($node) {
  $items = db_query("SELECT m.did, m.merci_item_status, merci_placeholder_nid, pn.title AS placeholder_title, merci_item_nid, tn.title AS item_title, nt.type, nt.name FROM {merci_reservation_detail} m INNER JOIN {node} pn ON m.merci_placeholder_nid = pn.nid INNER JOIN {node_type} nt ON pn.type = nt.type LEFT JOIN {node} tn ON m.merci_item_nid = tn.nid WHERE m.vid = %d", $node->vid);
  $reservation_items = array();
  while ($item = db_fetch_array($items)) {
    $reservation_items[$item['did']] = $item;
  }
  return $reservation_items;
}