本文整理汇总了PHP中Note::getNotesByUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Note::getNotesByUser方法的具体用法?PHP Note::getNotesByUser怎么用?PHP Note::getNotesByUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Note
的用法示例。
在下文中一共展示了Note::getNotesByUser方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCoutOfUser
public static function getCoutOfUser($bdd)
{
$allUser = User::getAllUser($bdd);
$couts = [];
foreach ($allUser as $user) {
$userNotes = Note::getNotesByUser($bdd, $user['id']);
$uDevise = Devise::getDeviseById($bdd, $user['devise_id']);
$totalNote = 0;
foreach ($userNotes as $note) {
$totalNote += Note::getMontantTotal($bdd, $note['id'], $uDevise->getTaux());
}
$couts[] = ["username" => $user['login'], "total" => $totalNote];
}
usort($couts, function ($a, $b) {
if ($a['total'] == $b['total']) {
return 0;
}
return $a['total'] < $b['total'] ? 1 : -1;
});
return array_slice($couts, 0, 10);
}
示例2: getNotes
public function getNotes($bdd)
{
$note = new Note();
return $note->getNotesByUser($bdd, $this->id);
}
示例3: foreach
//Statistiques
//Statistiques
case "statistique":
include_once '/views/admin/statistique.php';
break;
//Gestion des notes
//Gestion des notes
case "note":
//on retourne la liste des notes en fonction du role de l'utilisateur
if ($secu->isAdmin($bdd)) {
$notes = Note::getAllNotes($bdd);
} else {
$listUser = User::getUsersByManagerId($bdd, $sessionUser->getId());
$notes = [];
foreach ($listUser as $user) {
$listNote = Note::getNotesByUser($bdd, $user["id"]);
$notes = array_merge($notes, $listNote);
}
}
$fraisNote = new Note();
$statut = new Statut();
$listStatut = $statut->getAll($bdd);
$noteStatut = new Statut();
include_once '/views/admin/note.php';
break;
//par defaut on a les statistiques
//par defaut on a les statistiques
default:
include_once '/views/admin/index.php';
break;
}
示例4: if
<input class = "formulaire formulairePrixTTC form-control champ-form" type="text" name="montant" placeholder="HT" value="<?php if(isset($_POST[$montan]) && !empty($_POST[$montan])){echo filter_input(INPUT_POST, $montan); } ?>"/>
<select class = "formulaire formulairePrix form-control champ-form" name="devise_id">
<?php
$reponseDevise = Devise::getAllDevise($bdd);
while($donnee = $reponseDevise->fetch())
{ ?>
<option value="<?php echo $donnee['id'];?>" <?php if($sessionUser->getDevise() == $donnee['id']){echo "selected='selected'"; } ?>><?php echo $donnee['name'];?></option>
<?php
} ?>
</select>
</div>
<select class = "formulaire deroulantFrais form-control champ-form deroulantId" name="note_id">
<?php
$uid = $sessionUser->getId();
foreach ( (Note::getNotesByUser($bdd, $uid)) as $donnee ) {
if ( 1 != $donnee['statut_id'] )
{ continue; } ?>
<option value="<?php echo $donnee['id'];?>" <?php if(isset($_POST[$noteid]) && !empty($_POST[$noteid]) && filter_input(INPUT_POST, $noteid) == $donnee['id'])
{echo "selected.='selected'";} ?>><?php echo $donnee['name'];?></option>
<?php } ?>
</select>
<select class = "formulaire deroulantFrais form-control champ-form deroulantId" name="categorie_id">
<?php
$reponseCategorie = CategorieFrais::getAllCategorie($bdd);
while($donnee = $reponseCategorie->fetch())
{
?>
<option value ="<?php echo $donnee['id'];?>" <?php if(isset($_POST[$categori]) && !empty($_POST[$categori]) && filter_input(INPUT_POST, $categori) == $donnee['id']){echo "selected='selected'"; } ?>><?php echo $donnee['name'];?></option>
<?php