/** * Load data into info_box_contents array to show array later. * * @param int $max Maximum number of records to load * @return void */ function loadBox($max = 5) { global $user, $langs, $db, $conf; $langs->load("boxes"); $this->max = $max; include_once DOL_DOCUMENT_ROOT . "/adherents/class/adherent.class.php"; $memberstatic = new Adherent($db); $this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedMembers", $max)); if ($user->rights->societe->lire) { $sql = "SELECT a.rowid, a.nom as lastname, a.prenom as firstname, a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,"; $sql .= " t.cotisation"; $sql .= " FROM " . MAIN_DB_PREFIX . "adherent as a, " . MAIN_DB_PREFIX . "adherent_type as t"; $sql .= " WHERE a.entity = " . $conf->entity; $sql .= " AND a.fk_adherent_type = t.rowid"; $sql .= " ORDER BY a.tms DESC"; $sql .= $db->plimit($max, 0); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); $i = 0; while ($i < $num) { $objp = $db->fetch_object($result); $datec = $db->jdate($objp->datec); $datem = $db->jdate($objp->tms); $memberstatic->lastname = $objp->lastname; $memberstatic->firstname = $objp->firstname; $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => DOL_URL_ROOT . "/adherents/fiche.php?rowid=" . $objp->rowid); $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $memberstatic->getFullName($langs), 'url' => DOL_URL_ROOT . "/adherents/fiche.php?rowid=" . $objp->rowid); $this->info_box_contents[$i][2] = array('td' => 'align="right"', 'text' => dol_print_date($datem, "day")); $this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"', 'text' => $memberstatic->LibStatut($objp->status, $objp->cotisation, $db->jdate($objp->date_end_subscription), 3)); $i++; } if ($num == 0) { $this->info_box_contents[$i][0] = array('td' => 'align="center"', 'text' => $langs->trans("NoRecordedCustomers")); } } else { $this->info_box_contents[0][0] = array('td' => 'align="left"', 'maxlength' => 500, 'text' => $db->error() . ' sql=' . $sql); } } else { $this->info_box_contents[0][0] = array('align' => 'left', 'text' => $langs->trans("ReadPermissionNotAllowed")); } }
// Type print '<td nowrap="nowrap">'; $membertypestatic->id=$objp->type_id; $membertypestatic->libelle=$objp->type; print $membertypestatic->getNomUrl(1,12); print '</td>'; // Moral/Physique print "<td>".$adh->getmorphylib($objp->morphy)."</td>\n"; // EMail print "<td>".dol_print_email($objp->email,0,0,1)."</td>\n"; // Statut print '<td nowrap="nowrap">'; print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2); print "</td>"; // End of subscription date if ($datefin) { print '<td align="center" nowrap="nowrap">'; print dol_print_date($datefin,'day'); if ($datefin < ($now - $conf->adherent->cotisation->warning_delay) && $objp->statut > 0) print " ".img_warning($langs->trans("SubscriptionLate")); print '</td>'; } else { print '<td align="left" nowrap="nowrap">'; if ($objp->cotisation == 'yes') {
print "</a></td>\n"; // Login print "<td>" . $objp->login . "</td>\n"; // Type $membertypestatic->id = $objp->type_id; $membertypestatic->libelle = $objp->type; print '<td class="nowrap">'; print $membertypestatic->getNomUrl(1, 32); print '</td>'; // Moral/Physique print "<td>" . $memberstatic->getmorphylib($objp->morphy) . "</td>\n"; // EMail print "<td>" . dol_print_email($objp->email, 0, 0, 1) . "</td>\n"; // Statut print '<td class="nowrap">'; print $memberstatic->LibStatut($objp->statut, $objp->cotisation, $datefin, 2); print "</td>"; // End of subscription date if ($datefin) { print '<td align="center" class="nowrap">'; print dol_print_date($datefin, 'day'); if ($datefin < $now - $conf->adherent->cotisation->warning_delay && $objp->statut > 0) { print " " . img_warning($langs->trans("SubscriptionLate")); } print '</td>'; } else { print '<td align="left" class="nowrap">'; if ($objp->cotisation == 'yes') { print $langs->trans("SubscriptionNotReceived"); if ($objp->statut > 0) { print " " . img_warning();
$staticmember->lastname = $obj->lastname; $staticmember->firstname = $obj->firstname; if (!empty($obj->fk_soc)) { $staticmember->fk_soc = $obj->fk_soc; $staticmember->fetch_thirdparty(); $staticmember->name = $staticmember->thirdparty->name; } else { $staticmember->name = $obj->company; } $staticmember->ref = $staticmember->getFullName($langs); $statictype->id = $obj->typeid; $statictype->libelle = $obj->libelle; print '<td>' . $staticmember->getNomUrl(1, 32) . '</td>'; print '<td>' . $statictype->getNomUrl(1, 32) . '</td>'; print '<td>' . dol_print_date($db->jdate($obj->datem), 'dayhour') . '</td>'; print '<td align="right">' . $staticmember->LibStatut($obj->statut, $obj->cotisation == 'yes' ? 1 : 0, $db->jdate($obj->date_end_subscription), 5) . '</td>'; print '</tr>'; $i++; } } print "</table><br>"; } else { dol_print_error($db); } /* * Last modified subscriptions */ $max = 5; $sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; $sql .= " datefin as date_end_subscription,"; $sql .= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.cotisation";