From 72c796cdb0a573da41000a8da9694cb58f7df0c8 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 7 Jul 2003 13:43:02 +0000 Subject: [PATCH] =?UTF-8?q?Gestion=20des=20multiples=20mod=E8les=20de=20pr?= =?UTF-8?q?opositions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/propale.php | 59 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php index fe0700f7562..e0cba13f489 100644 --- a/htdocs/admin/propale.php +++ b/htdocs/admin/propale.php @@ -31,6 +31,44 @@ if (!$user->admin) $db = new Db(); +if ($action == 'set') +{ + $sql = "INSERT INTO llx_propal_model_pdf (nom) VALUES ('".$value."')"; + + if ($db->query($sql)) + { + + } +} +if ($action == 'del') +{ + $sql = "DELETE FROM llx_propal_model_pdf WHERE nom='".$value."'"; + + if ($db->query($sql)) + { + + } +} + + +$def = array(); + +$sql = "SELECT nom FROM llx_propal_model_pdf"; +if ($db->query($sql)) +{ + $i = 0; + while ($i < $db->num_rows()) + { + $array = $db->fetch_array($i); + array_push($def, $array[0]); + $i++; + } +} +else +{ + print $db->error(); +} + // positionne la variable pour le test d'affichage de l'icone $propale_addon_var_pdf = PROPALE_ADDON_PDF; @@ -59,8 +97,8 @@ print ''; print ''; print ''; print ''; -print ''; -print ''; +print ''; +print ''; print "\n"; clearstatcache(); @@ -82,6 +120,23 @@ while (($file = readdir($handle))!==false) print $obj->description; + print '
NomInfoActivé ActifDéfaut
'; + + if (in_array($name, $def)) + { + print ''; + print "\n"; + print 'désactiver'; + } + else + { + print " "; + print "\n"; + print 'activer'; + } + + + print ''; if ($propale_addon_var_pdf == "$name")