+require('connect.db.inc.php');
+require('plmailer.php');
+
+$res = XDB::query("SELECT count(r.stamp), UNIX_TIMESTAMP(MIN(r.stamp)),
+ sum(r.stamp < NOW() - $M_PERIOD), sum(r.stamp < NOW() - $R_PERIOD)
+ FROM requests AS r");
+list($nb, $age, $nbold, $nbveryold) = $res->fetchOneRow();
+
+$age = (time() - intval($age)) / 86400;
+$head = "";
+if ($age > 15) {
+ $head = "[Autodestruction du serveur] ";
+} elseif ($age > 7) {
+ $head = "[Armageddon imminent] ";
+} elseif ($age > 5) {
+ $head = "[Guerre nucléaire] ";
+} elseif ($age > 3) {
+ $head = "[ET Téléphone maison] ";
+} elseif ($age > 1) {
+ $head = "[Réveil !] ";
+} elseif (!empty($nbveryold)) {
+ $head = "[Urgent] ";
+}