diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php
index 9f8691a69a6..1238fd0fe15 100644
--- a/htdocs/adherents/stats/byproperties.php
+++ b/htdocs/adherents/stats/byproperties.php
@@ -59,7 +59,7 @@ $title = $langs->trans("MembersStatisticsByProperties");
print load_fiche_titre($title, '', $memberstatic->picto);
-dol_mkdir($dir);
+//dol_mkdir($dir);
$data = array();
@@ -134,7 +134,7 @@ if ($resql) {
}
-$head = member_stats_prepare_head($adh);
+$head = member_stats_prepare_head($memberstatic);
print dol_get_fiche_head($head, 'statsbyproperties', '', -1, '');
@@ -169,7 +169,7 @@ if (!$foundmor) {
foreach ($data as $val) {
$nb = $val['nb'];
- $nbsubscriptions = $val['nbsubscriptions'];
+ $nbsubscriptions = isset($val['nbsubscriptions']) ? $val['nbsubscriptions'] : 0;
$nbactive = $val['nbactive'];
print '
';
diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php
index 6107669c967..2d1450b8ae5 100644
--- a/htdocs/adherents/stats/geo.php
+++ b/htdocs/adherents/stats/geo.php
@@ -78,7 +78,7 @@ llxHeader('', $title, '', '', 0, 0, $arrayjs);
print load_fiche_titre($title, '', $memberstatic->picto);
-dol_mkdir($dir);
+//dol_mkdir($dir);
if ($mode) {
// Define sql
@@ -87,7 +87,7 @@ if ($mode) {
$tab = 'statscountry';
$data = array();
- $sql .= "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label";
+ $sql = "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
@@ -103,7 +103,7 @@ if ($mode) {
$tab = 'statsstate';
$data = array();
- $sql .= "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, c.nom as label2"; //
+ $sql = "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, c.nom as label2"; //
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
@@ -120,7 +120,7 @@ if ($mode) {
$tab = 'statsregion'; //onglet
$data = array(); //tableau de donnée
- $sql .= "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, r.nom as label2";
+ $sql = "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, r.nom as label2";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
@@ -137,7 +137,7 @@ if ($mode) {
$tab = 'statstown';
$data = array();
- $sql .= "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label, d.town as label2";
+ $sql = "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label, d.town as label2";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
@@ -207,7 +207,7 @@ if ($mode) {
}
-$head = member_stats_prepare_head($adh);
+$head = member_stats_prepare_head($memberstatic);
print dol_get_fiche_head($head, $tab, '', -1, '');
@@ -299,7 +299,7 @@ if ($mode) {
print '';
print '';
print '| '.$label.' | ';
- if ($label2) {
+ if (isset($label2)) {
print ''.$label2.' | ';
}
print ''.$langs->trans("NbOfMembers").' ('.$langs->trans("AllTime").') | ';
@@ -308,10 +308,10 @@ if ($mode) {
print '
';
foreach ($data as $val) {
- $year = $val['year'];
+ $year = isset($val['year']) ? $val['year'] : '';;
print '';
print '| '.$val['label'].' | ';
- if ($label2) {
+ if (isset($label2)) {
print ''.$val['label2'].' | ';
}
print ''.$val['nb'].' | ';
diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php
index b092c7bcf20..11c0025dcc5 100644
--- a/htdocs/adherents/stats/index.php
+++ b/htdocs/adherents/stats/index.php
@@ -137,7 +137,7 @@ if (!$mesg) {
}
-$head = member_stats_prepare_head($adh);
+$head = member_stats_prepare_head($memberstatic);
print dol_get_fiche_head($head, 'statssubscription', '', -1, '');