push initial du projet par Stéphane
This commit is contained in:
45
inc/inc-ajax-form.php
Executable file
45
inc/inc-ajax-form.php
Executable file
@@ -0,0 +1,45 @@
|
||||
<?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);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user