function api_post() {\r
$exploitantManager = new PdoExploitantManager();\r
$produitManager = new PdoProduitManager();\r
+ $historiqueManager = new PdoHistoriqueManager();\r
\r
+ // OPERATION DE CREATION/UPDATE UNIQUEMENT VIA INTERFACE WEBADMIN :\r
+ // -> Pour le moment AW a accès à la db directement, donc pas besoin de WS\r
+\r
+ /*\r
switch ($_GET['action']) {\r
case 'create_exploitant' :\r
- $exploitant = new Exploitant(null, $_POST['nom'], $_POST['reference'], $_POST['produits']);\r
+ $exploitant = new Exploitant(\r
+ null, // l'ID en base est auto-généré, donc laissé vide ici\r
+ $_POST['nom'], \r
+ $_POST['reference'], \r
+ $_POST['produits']\r
+ );\r
$exploitantManager -> createExploitant($exploitant);\r
break;\r
\r
case 'update_exploitant' :\r
- $exploitant = new Exploitant($_POST['id'], $_POST['nom'], $_POST['reference'], $_POST['produits']);\r
+ $exploitant = new Exploitant(\r
+ $_POST['id'], \r
+ $_POST['nom'], \r
+ $_POST['reference'], \r
+ $_POST['produits']\r
+ );\r
$exploitantManager -> updateExploitant($exploitant);\r
break;\r
\r
case 'add_produit' :\r
- $produit = new Produit(null, $_POST['fqdn'], $_POST['nom'], $_POST['version']);\r
+ $produit = new Produit(\r
+ null, // l'ID en base est auto-généré, donc laissé vide ici\r
+ $_POST['nom'], \r
+ $_POST['exploitant'], \r
+ $_POST['reference'], \r
+ $_POST['version'],\r
+ $_POST['historique']\r
+ );\r
$produitManager -> addProduit($produit);\r
break;\r
\r
case 'update_produit' :\r
- $produit = new Produit($_POST['id'], $_POST['fqdn'], $_POST['nom'], $_POST['version']);\r
+ $produit = new Produit(\r
+ $_POST['id'], \r
+ $_POST['nom'], \r
+ $_POST['exploitant'], \r
+ $_POST['reference'], \r
+ $_POST['version'],\r
+ $_POST['historique']\r
+ );\r
$produitManager -> updateProduit($produit);\r
break;\r
+\r
+ case 'create_historique' :\r
+ $historique = new Historique(\r
+ null, // l'ID en base est auto-généré, donc laissé vide ici\r
+ $_POST['installation']\r
+ );\r
+ $historiqueManager -> createHistorique($historique);\r
+ break;\r
+\r
+ case 'update_exploitant' :\r
+ $historique = new Historique(\r
+ $_POST['id'],\r
+ $_POST['installation']\r
+ );\r
+ $historiqueManager -> updateHistorique($historique);\r
+ break;\r
}\r
+ */\r
}\r
\r
?>
\ No newline at end of file