Exemplo n.º 1
0
include_once $_SERVER["DOCUMENT_ROOT"] . "/admin/classes/utils.php";
require $_SERVER["DOCUMENT_ROOT"] . "/inc/inc.config.php";
require $_SERVER["DOCUMENT_ROOT"] . "/admin/classes/Tarif_categorie.php";
$debug = false;
$categorie = new Tarif_categorie();
$id = $_GET["id"];
$btn_creation_categorie = "Créer la catégorie";
// ---- Liste des categories diponibles ------- //
if (1 == 1) {
    unset($recherche);
    $liste_categorie = $categorie->getListe($recherche, $debug);
}
// -------------------------------------------- //
// ---- Chargement d'une catégorie ------------ //
if ($_GET["id"] != '') {
    $datas = $categorie->load($id);
    if (!empty($datas[0])) {
        $titre = $datas[0]["titre"];
        $btn_creation_categorie = "Modifier la catégorie";
    }
}
// -------------------------------------------- //
if (empty($liste_categorie)) {
    $message = 'Aucune catégorie enregistrée.';
} else {
    $message = '';
}
?>

<!doctype html>
<html class="no-js" lang="en">
Exemplo n.º 2
0
								<tr>
									<th class="col-md-2" style="">Titre</th>
									<th class="col-md-2" style="">Catégorie</th>
									<th class="col-md-6" style="">Description</th>
									<th class="col-md-1" style="">Photo</th>
									<th class="col-md-1" style="">Online</th>
									<th class="col-md-1" colspan="2" style="">Actions</th>
								</tr>
							</thead>
							<tbody>
							<?php 
    $i = 0;
    foreach ($liste_tarif as $value) {
        $i++;
        // ---- Chargement de la catégorie associée
        $data = $categorie->load($value["id_categorie"]);
        $classe_affichage = $i % 2 != 0 ? "info" : "";
        $description = couper_correctement($value["texte"], 50);
        if (strlen($value["texte"]) > 50) {
            $description .= " ...";
        }
        $image_ok = $value["image"] != '' ? 'check' : 'vide';
        $online = $value["online"] == '1' ? 'check' : 'vide';
        echo "<tr class='" . $classe_affichage . "'>\n";
        echo "\t<td>" . $value["titre"] . "</td>\n";
        echo "\t<td>" . $data[0]["titre"] . "</td>\n";
        echo "\t<td>" . $description . "</td>\n";
        echo "\t<td align='center'><img src='../img/" . $image_ok . ".png' width='30' ></td>\n";
        echo "\t<td align='center'><img src='../img/" . $online . ".png' width='30' ></td>\n";
        echo "\t<td><a href='./edition.php?id=" . $value["id"] . "'><img src='../img/modif.png' width='30' alt='Modifier' ></a></td>\n";
        echo "\t<td>\n";