llxHeader('', $pagetitle, ''); $form = new Form($db); $object = new Building($db); if ($id > 0) { $object->fk_place = $id; if ($object->fetch_place() > 0) { $head = placePrepareHead($object->place); dol_fiche_head($head, 'buildings', $langs->trans("PlaceSingular"), 0, 'place@place'); $ret = $object->place->printInfoTable(); print '</div>'; $filter = array('t.fk_place' => $id); } $param .= '&id=' . $id; } // Load object list $ret = $object->fetch_all($sortorder, $sortfield, $limit, $offset); if ($ret == -1) { dol_print_error($db, $object->error); exit; } print_fiche_titre($pagetitle, '', 'building_32.png@place'); if (!$ret) { print '<div class="warning">' . $langs->trans('NoPlaceInDatabase') . '</div>'; } else { print '<table class="noborder" width="100%">' . "\n"; print '<tr class="liste_titre">'; print_liste_field_titre($langs->trans('BuildingFormLabel_ref'), $_SERVER['PHP_SELF'], 't.ref', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans('Description'), $_SERVER['PHP_SELF'], 't.description', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans('Edit')); print '</tr>'; foreach ($object->lines as $building) {