23 require
'../../main.inc.php';
24 require_once DOL_DOCUMENT_ROOT.
'/core/lib/hrm.lib.php';
25 require_once DOL_DOCUMENT_ROOT.
'/hrm/class/establishment.class.php';
28 $langs->loadLangs(array(
'admin',
'hrm'));
47 $form =
new Form($db);
50 llxHeader(
'', $langs->trans(
"Establishments"));
52 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
53 $sortorder =
GETPOST(
"sortorder",
'alpha');
54 $sortfield =
GETPOST(
"sortfield",
'alpha');
55 if (!$sortorder) $sortorder =
"DESC";
56 if (!$sortfield) $sortfield =
"e.rowid";
58 if (empty($page) || $page == -1) {
62 $offset = $limit * $page;
63 $pageprev = $page - 1;
64 $pagenext = $page + 1;
65 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
68 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
75 $sql =
"SELECT e.rowid, e.label, e.address, e.zip, e.town, e.status";
76 $sql .=
" FROM ".MAIN_DB_PREFIX.
"establishment as e";
77 $sql .=
" WHERE e.entity IN (".getEntity(
'establishment').
')';
78 $sql .= $db->order($sortfield, $sortorder);
79 $sql .= $db->plimit($limit + 1, $offset);
81 $result = $db->query($sql);
84 $num = $db->num_rows($result);
88 print '<table class="noborder centpercent">';
89 print '<tr class="liste_titre">';
102 while ($i < min($num, $limit))
104 $obj = $db->fetch_object($result);
106 $establishmentstatic->id = $obj->rowid;
107 $establishmentstatic->ref = $obj->ref;
108 $establishmentstatic->label = $obj->label;
109 $establishmentstatic->status = $obj->status;
112 print '<tr class="oddeven">';
113 print '<td>'.$establishmentstatic->getNomUrl(1).
'</td>';
114 print '<td>'.$obj->label.
'</td>';
115 print '<td class="left">'.$obj->address.
'</td>';
116 print '<td class="left">'.$obj->zip.
'</td>';
117 print '<td class="left">'.$obj->town.
'</td>';
118 print '<td class="right">';
119 print $establishmentstatic->getLibStatut(5);
126 print '<tr class="oddeven"><td colspan="7" class="opacitymedium">'.$langs->trans(
"None").
'</td></tr>';
137 print '<div class="tabsAction">';
138 print '<a class="butAction" href="'.DOL_URL_ROOT.
'/hrm/establishment/card.php?action=create">'.$langs->trans(
"NewEstablishment").
'</a>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
hrm_admin_prepare_head()
Return array head with list of tabs to view object informations.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
Class to manage establishments.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.