c'est bon j'ai pu trouver les nombre de pdf,
voici une class que j'ai codé, il permet de savoir
le nombre total de ressource et d'activité
<?php
class Module {
private $bdd_mdl = NULL;
private $nom_module;
private $nb_depot = NULL;
private $id_deja = NULL;
public function __construct() {
// $this->bdd_mdl = new PDO('mysql:host=localhost;dbname=mdl', 'root', 'test');
$query = "SELECT DISTINCT module FROM mdl_log";
$qb = $this->bdd_mdl->query($query);
while ($data = $qb->fetch(pdo::FETCH_OBJ)) {
echo $data->module . " ,";
}
}
public function getNomModule() {
return $this->nom_module;
}
public function statAction($module, $action, $cohorte) {
$this->nb_depot = NULL; //remettre le compteur à zero
$this->id_deja = array();
foreach ($cohorte as $C) {
$query = "SELECT count(action) as nb FROM mdl_log
WHERE module='$module'
AND action='$action'
AND userid ='$C' ";
$qb = $this->bdd_mdl->query($query);
$data = $qb->fetch();
//echo $data['nb'];
if ($data['nb'] > 0) {//si on a déja déposer on ajouter 1
$this->id_deja[] = $C;
$this->nb_depot = $this->nb_depot + 1;
}
}
return $this->nb_depot;
}
public function getIdDeja()
{
return $this->id_deja;
}
public function newAction($module, $action) {
echo "<br/>";
$query = "SELECT count(action) as nb FROM mdl_log
WHERE module='$module'
AND action='$action' ";
$qb = $this->bdd_mdl->query($query);
$data = $qb->fetch();
return $data['nb'];
}
}
?>
voici comment je les appelle, il suffit de connaître le nom du module et
le nom de l'action
<?php
$mimetype->action('folder', 'add', 'creation dossier');
$mimetype->action('label', 'add', 'etiquettes');
$mimetype->nbAllFile(); //tous le fichiers déposé
$mimetype->action('page', 'add', 'pages');
$mimetype->action('url', 'add', 'url externe');
?>
<h3>activite</h3>
<hr/>
<?php
$mimetype->action('chat', 'add', 'chats ajouter');
$mimetype->action('assign', 'add', 'devoir ajouer ');
$mimetype->action('forum', 'add', 'forum ajouter ');
$mimetype->action('lesson', 'add', 'leçon ajouter ');
$mimetype->action('choice', 'add', 'sondage ajouter ');
$mimetype->action('quiz', 'add', 'test ajouter ');
?>
<h1>format de fichier déposé</h1>
<hr>
<?php
$mimetype->getMineType('application/pdf', 'PDF');
$mimetype->getDoc();
$mimetype->getMineType('application/vnd.ms-powerpoint', 'PPS OU PPT');
$mimetype->getMineType('video/x-flv', 'FLV + MPG');
$mimetype->getMineType('application/x-shockwave-flash', 'FLASH SWF');
$mimetype->getMineType('video/quicktime', 'QUICK- TIME ');
$mimetype->getMineType('video/mp4', 'VIDEO MP4');
$mimetype->getMineType('video/x-ms-wm', 'AVI');
$mimetype->getMineType('video/x-ms-wmv', 'VMW');
$mimetype->getMineType('audio/mp3', 'MP3');
$mimetype->getMineType('application/vnd.ms-powerpoint', 'PPS OU PPT');
$mimetype->getUrl();
$mimetype->getImg();
?>