Correction de l'affichage
This commit is contained in:
parent
8aba0f373f
commit
4b92b19d92
|
@ -231,5 +231,42 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////
|
||||||
|
// _ _
|
||||||
|
// __| | __ _| |_ ___ ___
|
||||||
|
// / _` |/ _` | __/ _ \/ __|
|
||||||
|
// | (_| | (_| | || __/\__ \
|
||||||
|
// \__,_|\__,_|\__\___||___/
|
||||||
|
//
|
||||||
|
////////////////////////////////////
|
||||||
|
// 1) Convertis une date en en francais explicite
|
||||||
|
public static function frDate($date){
|
||||||
|
/* [1] On definit les traductions
|
||||||
|
=========================================================*/
|
||||||
|
// Jours de la semaine
|
||||||
|
$days = array("Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche");
|
||||||
|
// Mois de l'annee
|
||||||
|
$months = array("Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre");
|
||||||
|
|
||||||
|
/* [2] On recupere le timestamp et les indices
|
||||||
|
=========================================================*/
|
||||||
|
$time = strtotime($date); // timestamp
|
||||||
|
$daynum = intval( date('N', $time)-1 ); // jour dans la semaine
|
||||||
|
$monthnum = intval( date('n', $time)-1 ); // numero du mois dans l'annee
|
||||||
|
|
||||||
|
|
||||||
|
/* [3] On recupere les infos independemment
|
||||||
|
=========================================================*/
|
||||||
|
$result = array(
|
||||||
|
$days[$daynum], // nom de jour
|
||||||
|
date('j', $time), // jour du mois
|
||||||
|
$months[$monthnum], // nom du mois
|
||||||
|
date('Y', $time), // annee
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
return implode(" ", $result);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
$request = Database::getPDO()->query("SELECT id_token as id, name, token, creation, expires
|
$request = Database::getPDO()->query("SELECT id_token as id, name, token, creation, expires
|
||||||
FROM api_token
|
FROM api_token
|
||||||
|
WHERE CURDATE() BETWEEN creation AND expires
|
||||||
ORDER BY creation ASC");
|
ORDER BY creation ASC");
|
||||||
|
|
||||||
/* [2] On recupere et retourne les donnees
|
/* [2] On recupere et retourne les donnees
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
use \manager\ModuleRequest;
|
use \manager\ModuleRequest;
|
||||||
use \manager\ManagerError;
|
use \manager\ManagerError;
|
||||||
use \manager\ResourceDispatcher;
|
use \manager\ResourceDispatcher;
|
||||||
|
use \manager\Database;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,9 +41,9 @@ $tokens = $req_tokens->answer();
|
||||||
echo "<div><span data-prefix='Type'>token</span></div>";
|
echo "<div><span data-prefix='Type'>token</span></div>";
|
||||||
echo "<div>";
|
echo "<div>";
|
||||||
echo "<span>".$token['name']."</span>";
|
echo "<span>".$token['name']."</span>";
|
||||||
echo "<span data-prefix='Creation'>date de création</span>";
|
echo "<span data-prefix='Creation'>".Database::frDate($token['creation'])."</span>";
|
||||||
echo "<span data-prefix='Expiration'>date d'expiration</span>";
|
echo "<span data-prefix='Expiration'>".Database::frDate($token['expires'])."</span>";
|
||||||
echo "<span data-prefix='Token'>90:31:ec:16:02:99:90:df:72:5f:02:f1:ad:d5:76:c7</span>";
|
echo "<span data-prefix='Token'>".$token['token']."</span>";
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
echo "<button>Supprimer</button>";
|
echo "<button>Supprimer</button>";
|
||||||
echo "</li>";
|
echo "</li>";
|
||||||
|
|
Loading…
Reference in New Issue