81 global $user, $langs, $conf;
82 $langs->load(
"boxes");
86 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
87 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
88 $memberstatic =
new Adherent($this->db);
91 $this->info_box_head = array(
'text' => $langs->trans(
"BoxTitleLastModifiedMembers", $max));
93 if ($user->hasRight(
'adherent',
'lire')) {
94 $sql =
"SELECT a.rowid, a.ref, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
95 $sql .=
" a.datec, a.tms as datem, a.statut as status, a.datefin as date_end_subscription,";
96 $sql .=
' a.photo, a.email, a.gender, a.morphy,';
97 $sql .=
" t.rowid as typeid, t.subscription, t.libelle as label";
98 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent as a, ".MAIN_DB_PREFIX.
"adherent_type as t";
99 $sql .=
" WHERE a.entity IN (".getEntity(
'member').
")";
100 $sql .=
" AND a.fk_adherent_type = t.rowid";
101 $sql .=
" ORDER BY a.tms DESC";
102 $sql .= $this->db->plimit($max, 0);
104 $result = $this->db->query($sql);
106 $num = $this->db->num_rows($result);
109 while ($line < $num) {
110 $objp = $this->db->fetch_object($result);
111 $datec = $this->db->jdate($objp->datec);
112 $datem = $this->db->jdate($objp->datem);
114 $memberstatic->lastname = $objp->lastname;
115 $memberstatic->firstname = $objp->firstname;
116 $memberstatic->id = $objp->rowid;
117 $memberstatic->ref = $objp->ref;
118 $memberstatic->photo = $objp->photo;
119 $memberstatic->gender = $objp->gender;
120 $memberstatic->email = $objp->email;
121 $memberstatic->morphy = $objp->morphy;
122 $memberstatic->company = $objp->company;
123 $memberstatic->statut = $objp->status;
124 $memberstatic->date_creation = $datec;
125 $memberstatic->date_modification = $datem;
126 $memberstatic->need_subscription = $objp->subscription;
127 $memberstatic->datefin = $this->db->jdate($objp->date_end_subscription);
128 if (!empty($objp->fk_soc)) {
129 $memberstatic->socid = $objp->fk_soc;
130 $memberstatic->fetch_thirdparty();
131 $memberstatic->name = $memberstatic->thirdparty->name;
133 $memberstatic->name = $objp->company;
135 $statictype->id = $objp->typeid;
136 $statictype->label = $objp->label;
137 $statictype->subscription = $objp->subscription;
139 $this->info_box_contents[$line][] = array(
140 'td' =>
'class="tdoverflowmax150 maxwidth150onsmartphone"',
141 'text' => $memberstatic->getNomUrl(-1),
145 $this->info_box_contents[$line][] = array(
146 'td' =>
'class="tdoverflowmax150 maxwidth150onsmartphone"',
147 'text' =>$memberstatic->company,
150 $this->info_box_contents[$line][] = array(
151 'td' =>
'class="tdoverflowmax150 maxwidth150onsmartphone"',
152 'text' => $statictype->getNomUrl(1, 32),
156 $this->info_box_contents[$line][] = array(
161 $this->info_box_contents[$line][] = array(
162 'td' =>
'class="right" width="18"',
163 'text' => $memberstatic->LibStatut($objp->status, $objp->subscription, $this->db->jdate($objp->date_end_subscription), 3),
170 $this->info_box_contents[$line][0] = array(
171 'td' =>
'class="center"',
172 'text'=>$langs->trans(
"NoRecordedCustomers"),
176 $this->db->free($result);
178 $this->info_box_contents[0][0] = array(
181 'text' => ($this->db->error().
' sql='.$sql),
185 $this->info_box_contents[0][0] = array(
186 'td' =>
'class="nohover opacitymedium left"',
187 'text' => $langs->trans(
"ReadPermissionNotAllowed")