<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Hospi
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$keywords = CValue::get("keywords", "%%");
$lit_id = CValue::get("lit_id");
$lit = new C**t();
$lit->load($lit_id);
$liaisons_items = $lit->loadRefsLiaisonsItems();
$items_prestations = CMbObject::massLoadFwdRef($liaisons_items, "item_prestation_id");
$items_prestations_ids = CMbArray::pluck($items_prestations, "object_id");
// Un niveau unique par prestation
$where = array();
$where["object_id"] = CSQLDataSource::prepareNotIn($items_prestations_ids);
$where["object_class"] = " = 'CPrestationJournaliere'";
$where["group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
$ljoin = array();
$ljoin["prestation_journaliere"] = "prestation_journaliere.prestation_journaliere_id = item_prestation.object_id";
$item_prestation = new CItemPrestation();
/** @var CItemPrestation[] $items_prestations */
$items_prestations = $item_prestation->seek($keywords, $where, null, null, $ljoin);
$items_by_prestation = array();
$prestations = array();
foreach ($items_prestations as $_item_prestation) {