CURRENT_DATE
" );
$n = spip_num_rows($query);
echo "Nombre d'abonnés à jour : $n ";
// TOTAUX
$query = spip_query ( "
SELECT a.id
FROM `spip_auteurs_elargis` a, `spip_auteurs_elargis_abonnements` b , spip_abonnements c
WHERE
a.id = b.id_auteur_elargi
and c.id_abonnement = b.id_abonnement
and a.statut_paiement='ok'
and c.id_abonnement IN (5,6,7,8)
and b.validite > CURRENT_DATE
" );
$n = spip_num_rows($query);
echo "Nombre d'abonnés PAPIER à jour : $n ";
// Echus
$query = spip_query ( "
SELECT a.id_auteur FROM spip_auteurs_elargis a, spip_auteurs_elargis_abonnements c
WHERE
a.id = c.id_auteur_elargi
and c.validite <> '0000-00-00 00:00:00'
and c.validite < NOW()
" );
$n = spip_num_rows($query);
echo "Nombre d'abonnés échus : $n ";
// relance
/*
$validite = "DATE_ADD(CURRENT_DATE, INTERVAL 0 DAY)" ;
$query = spip_query("
SELECT a.id_auteur, c.email
FROM spip_auteurs_elargis a, spip_auteurs_elargis_abonnements b, spip_auteurs c
WHERE
a.id = b.id_auteur_elargi
and a.id_auteur = c.id_auteur
and b.validite <> '0000-00-00 00:00:00'
and b.validite < $validite
");
$n = spip_num_rows($query);
echo "Nombre d'abonnés relance : ".$n." ";
*/
// inscrits
$query = spip_query ( "SELECT COUNT(a.id) as n FROM `spip_auteurs_elargis` a WHERE 1" );
$row=spip_fetch_array($query);
echo "Nombre d'inscrits : ".$row['n']." ";
?>
'0000-00-00 00:00:00' and date > DATE_ADD(CURRENT_DATE, INTERVAL -365 DAY) group by MONTHNAME(date) order by date desc");
while ($row = spip_fetch_array($result)){
//var_dump($row);
echo "
".$row['mois'] ."/" .$row['annee'] ." | ";
}
?>
'0000-00-00 00:00:00'
and YEAR(b.date) = YEAR(CURRENT_DATE())
and MONTH(b.date) = MONTH(CURRENT_DATE())
group by b.id_abonnement");
echo "
";
echo "" ;
echo " [(#DATE|nom_mois)] [(#DATE|annee)] | ";
$query_n = spip_query ( "SELECT a.id , b.date
FROM `spip_auteurs_elargis` a, spip_auteurs_elargis_abonnements b
WHERE
a.id = b.id_auteur_elargi
and b.validite > CURRENT_DATE
and b.date > DATE_ADD(CURRENT_DATE, INTERVAL -7 DAY)
" );
$n = spip_num_rows($query_n);
echo "Nouveaux abonnés depuis 7 jours : $n | ";
echo "
" ;
while ($row = spip_fetch_array($result)){
echo "" ;
echo "".$row['libelle']." | ".$row['n']." | ";
echo "
" ;
$id_abonnement = $row['id_abonnement'];
echo "" ;
echo "Prenom | Nom | adresse | code postal | Ville | pays | date | expire | ";
echo "
" ;
$result_detail = spip_query("select a.*, b.date , b.validite from spip_auteurs_elargis a, spip_auteurs_elargis_abonnements b, spip_auteurs_elargis c
where a.id = b.id_auteur_elargi and b.id_abonnement = $id_abonnement
and c.id = b.id_auteur_elargi
and c.statut_paiement = 'ok'
and YEAR(b.date) = YEAR(CURRENT_DATE())
and MONTH(b.date) = MONTH(CURRENT_DATE())
ORDER BY b.date desc");
while ($row_detail = spip_fetch_array($result_detail)){
echo "" ;
echo "".$row_detail['prenom']." | ".$row_detail['nom_famille']." | ";
echo "".$row_detail['adresse']." | ".$row_detail['code_postal']." | ".$row_detail['ville']." | ".$row_detail['pays']." | ";
echo "".jour($row_detail['date'])."/".mois($row_detail['date'])."/".annee($row_detail['date'])." | ";
echo "".jour($row_detail['validite'])."/".mois($row_detail['validite'])."/".annee($row_detail['validite'])." | ";
echo "
" ;
}
}
echo "" ;
echo " | ";
echo "
" ;
echo "
" ;
?>