예제 #1
0
파일: edition.php 프로젝트: xav335/fournil
<?
	include_once '../../inc/inc.config.php';
	include_once '../inc-auth-granted.php';
	include_once '../classes/utils.php';
	require '../classes/Categorie.php';
	require '../classes/Produit.php';
	
	$debug = false;
	$categorie = new Categorie();
	$produit = new Produit();
	
	// ---- Modification ---------------------------- //
	if ( !empty( $_GET ) ) {
		$action = 'modif';
		$result = $produit->load( $_GET[ "id" ] );

		if ( !empty( $result ) ) {
			$titre_page = 	'Catégorie "'. $result[ 0 ][ "nom" ] . '"';
			$id =			$_GET[ "id" ];
			$id_categorie = $result[ 0 ][ "id_categorie" ];
			$nom = 			$result[ 0 ][ "nom" ];
			$description = 	$result[ 0 ][ "description" ];
			$image[ 1 ] = 	$result[ 0 ][ "image" ];
			$tag = 			$result[ 0 ][ "tag" ];
			$online = 		( $result[ 0 ][ "online" ]=='1' ) ? "checked" : "";
			
			if( empty( $image[ 1 ] ) || !isset( $image[ 1 ] ) ) {
				$img[ 1 ] = "/img/favicon.png";
				$imgval[ 1 ] = "/img/favicon.png";
			} 
			else {
예제 #2
0
<?php

include_once $_SERVER["DOCUMENT_ROOT"] . "/admin/classes/utils.php";
require $_SERVER["DOCUMENT_ROOT"] . "/inc/inc.config.php";
require $_SERVER["DOCUMENT_ROOT"] . "/admin/classes/Categorie.php";
require $_SERVER["DOCUMENT_ROOT"] . "/admin/classes/Produit.php";
require $_SERVER["DOCUMENT_ROOT"] . "/admin/classes/Produit_image.php";
session_start();
$debug = false;
$produit = new Produit();
$produit_image = new Produit_image();
$result = $produit->load($_GET["id"], $debug);
//print_pre( $result );
// ---- VERIFICATIONS PREALABLES --------------------------------- //
if (1 == 1) {
    // ---- Le produit DOIT être en ligne pour être affiché ici!
    if ($result[0]["online"] == "non") {
        if ($debug) {
            echo "1 - Produit OFFLINE!<br>";
        }
        if (!$debug) {
            header("Location: /amenagements.php");
        }
        exit;
    }
}
// --------------------------------------------------------------- //
// ---- Informations à afficher ---------------------------------- //
if (1 == 1) {
    // ---- Données de l'annonce ------------- //
    $nom = $result[0]["nom"];