72 global $user, $langs, $conf;
73 $langs->load(
"boxes");
77 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
78 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
79 $memberstatic =
new Adherent($this->db);
82 $this->info_box_head = array(
'text' => $langs->trans(
"BoxTitleLastModifiedMembers", $max));
84 if ($user->hasRight(
'adherent',
'lire')) {
85 $sql =
"SELECT a.rowid, a.ref, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
86 $sql .=
" a.datec, a.tms as datem, a.statut as status, a.datefin as date_end_subscription,";
87 $sql .=
' a.photo, a.email, a.gender, a.morphy,';
88 $sql .=
" t.rowid as typeid, t.subscription, t.libelle as label";
89 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as a, ".MAIN_DB_PREFIX.
"adherent_type as t";
90 $sql .=
" WHERE a.entity IN (".getEntity(
'member').
")";
91 $sql .=
" AND a.fk_adherent_type = t.rowid";
92 $sql .=
" ORDER BY a.tms DESC";
93 $sql .= $this->db->plimit($max, 0);
95 $result = $this->db->query($sql);
97 $num = $this->db->num_rows($result);
100 while ($line < $num) {
101 $objp = $this->db->fetch_object($result);
102 $datec = $this->db->jdate($objp->datec);
103 $datem = $this->db->jdate($objp->datem);
105 $memberstatic->lastname = $objp->lastname;
106 $memberstatic->firstname = $objp->firstname;
107 $memberstatic->id = $objp->rowid;
108 $memberstatic->ref = $objp->ref;
109 $memberstatic->photo = $objp->photo;
110 $memberstatic->gender = $objp->gender;
111 $memberstatic->email = $objp->email;
112 $memberstatic->morphy = $objp->morphy;
113 $memberstatic->company = $objp->company;
114 $memberstatic->status = $objp->status;
115 $memberstatic->date_creation = $datec;
116 $memberstatic->date_modification = $datem;
117 $memberstatic->need_subscription = $objp->subscription;
118 $memberstatic->datefin = $this->db->jdate($objp->date_end_subscription);
119 if (!empty($objp->fk_soc)) {
120 $memberstatic->socid = $objp->fk_soc;
121 $memberstatic->fetch_thirdparty();
122 $memberstatic->name = $memberstatic->thirdparty->name;
124 $memberstatic->name = $objp->company;
126 $statictype->id = $objp->typeid;
127 $statictype->label = $objp->label;
128 $statictype->subscription = $objp->subscription;
130 $this->info_box_contents[$line][] = array(
131 'td' =>
'class="tdoverflowmax150 maxwidth150onsmartphone"',
132 'text' => $memberstatic->getNomUrl(-1),
136 $this->info_box_contents[$line][] = array(
137 'td' =>
'class="tdoverflowmax150 maxwidth150onsmartphone"',
138 'text' => $memberstatic->company,
141 $this->info_box_contents[$line][] = array(
142 'td' =>
'class="tdoverflowmax150 maxwidth150onsmartphone"',
143 'text' => $statictype->getNomUrl(1, 32),
147 $this->info_box_contents[$line][] = array(
152 $this->info_box_contents[$line][] = array(
153 'td' =>
'class="right" width="18"',
154 'text' => $memberstatic->LibStatut($objp->status, $objp->subscription, $this->db->jdate($objp->date_end_subscription), 3),
161 $this->info_box_contents[$line][0] = array(
162 'td' =>
'class="center"',
163 'text' => $langs->trans(
"NoRecordedCustomers"),
167 $this->db->free($result);
169 $this->info_box_contents[0][0] = array(
172 'text' => ($this->db->error().
' sql='.$sql),
176 $this->info_box_contents[0][0] = array(
177 'td' =>
'class="nohover left"',
178 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"ReadPermissionNotAllowed").
'</span>'