45 lines
1.0 KiB
PHP
Executable File
45 lines
1.0 KiB
PHP
Executable File
<?php
|
|
require("../config/config.php");
|
|
require(CHEMIN."inc/inc-functions.php");
|
|
require(CHEMIN."inc/inc-display-functions.php");
|
|
require(CHEMIN."inc/classe_xml.php");
|
|
$xml=new classe_xml(MODELE);
|
|
|
|
$action=array(
|
|
"titre"=>"Ajouter un item",
|
|
"action"=>"ajouter_item",
|
|
"submit"=>"Ajouter"
|
|
);
|
|
|
|
if(isset($_GET['xml'])){
|
|
$item=CHEMIN.DOSSIER_XML.$_GET['xml'];
|
|
$xml->lire_xml($item);
|
|
$action=array(
|
|
"titre"=>"Updater un item",
|
|
"action"=>"updater_item",
|
|
"submit"=>"Updater",
|
|
"delete"=>"oui");
|
|
}
|
|
$retour=$xml->traiter_formulaire(true);
|
|
|
|
//print_r($xml->messages);
|
|
|
|
if($retour=="update"){
|
|
display_mosaique_item($xml);
|
|
supprimer_cache();
|
|
}
|
|
if($retour=="insert"){
|
|
display_mosaique_item($xml);
|
|
supprimer_cache();
|
|
}
|
|
if($retour=="delete"){
|
|
// header('Location: '.URL.'index.php');
|
|
// die();
|
|
echo "delete";
|
|
supprimer_cache();
|
|
}
|
|
if($retour=="none"){
|
|
echo "<div class='px-3'>".display_buttons("",false)."</div>";
|
|
echo $xml->deployer_formulaire($action);
|
|
}
|
|
?>
|