/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Statut the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Statut::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<?php include_once "/class/Devise.php"; include_once "/class/Note.php"; include_once "/class/Statut.php"; include_once "/class/User.php"; include_once "/class/CategorieFrais.php"; $notes = $sessionUser->getNotes($bdd); $fraisNote = new Note(); $statut = new Statut(); $listStatut = $statut->getAll($bdd); $noteStatut = new Statut(); include_once "/views/include/accueil.php";
<?php include_once 'class/Statut.php'; include_once 'class/Role.php'; include_once 'class/Note.php'; if (isset($_GET["id"]) && (Security::isAdmin($bdd) || $secu->isManager($bdd))) { ?> <h2>Edition d'une note de frais</h2> <br/> <form class="form" action="" method="POST" name="edit"> <input class="form-control champ-form" name="name_note" type="text" value="<?php echo Note::getNameNote($bdd, $_GET['id']); ?>"> <select class = "formulaire form-control champ-form" name="statut"> <?php $reponseStatut = Statut::getAllStatut($bdd); while($donnee = $reponseStatut->fetch()) { if ($donnee['id'] == 1) { continue; } ?> <option value="<?php echo $donnee['id'];?>"><?php echo $donnee['name'];?></option> <?php } ?> </select> <input class="btn btn-primary" name="Editer" type="submit" value="Editer"> <a href="<?php echo $basePath; ?>" class="btn btn-primary">Annuler</a> <?php } elseif (isset($_GET["id"])) { ?> <h2>Modification d'une note de frais</h2> <br/> <form class="form" action="" method="POST" name="modif"> <input class="form-control champ-form" name="name_note" type="text" value="<?php echo Note::getNameNote($bdd, $_GET['id']); ?>">
<div class="titre"><?php echo trad('STATUT_REGLEMENT', 'admin'); ?> </div> <div class="statut"> <form action="<?php echo $_SERVER['PHP_SELF']; ?> " name="formchange" method="post"> <input type="hidden" name="ref" value="<?php echo $ref; ?> " /> <select name="statutch" id="statutch" onchange="formchange.submit()" class="form"> <?php $statut = new Statut(); $query = "select * from {$statut->table}"; $resul = $statut->query($query); while ($resul && ($row = $statut->fetch_object($resul))) { $statutcurdes = new Statutdesc(); $statutcurdes->charger($row->id); if ($row->id == $statutdesc->statut) { $selected = "selected"; } else { $selected = ""; } ?> <option value="<?php echo $row->id; ?> " <?php
echo trad('Nom', 'admin'); ?> & <?php echo trad('Prenom', 'admin'); ?> </li> <li style="height:25px; width:66px; border-left:1px solid #96A8B5;"><?php echo trad('Montant', 'admin'); ?> </li> <li style="height:25px; width:77px; border-left:1px solid #96A8B5; background-image: url(gfx/picto_menu_deroulant.gif); background-position:right bottom; background-repeat: no-repeat;"><?php echo trad('Statut', 'admin'); ?> <ul class="Menu"> <?php $statut = new Statut(); $query_stat = "select * from {$statut->table}"; $resul_stat = $statut->query($query_stat); while ($resul_stat && ($row_stat = $statut->fetch_object($resul_stat))) { $statutdesc = new Statutdesc(); $statutdesc->charger($row_stat->id); ?> <li style="width:84px;"><a href="commande.php?statut=<?php echo $row_stat->id; ?> " name="<?php echo $row_stat->id; ?> "><?php echo $statutdesc->titre; ?>
public function actionStatut() { $page = Statut::model()->findByPk(1); $criteria = new CDbCriteria(); $criteria->group = 'id DESC'; $criteria->limit = 3; $criteria->condition = 'region_id = 12 OR region_id = 0'; $news = News::model()->findAll($criteria); $this->render('statutAndProgramm', array('page' => $page, 'news' => $news)); }