From b63b51117f77e19a47e198b4bde3ba2eaa59494e Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 3 Aug 2005 15:22:36 +0000 Subject: [PATCH] Ajout gestion des notifications --- htdocs/compta/prelevement/config.php | 97 ++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/htdocs/compta/prelevement/config.php b/htdocs/compta/prelevement/config.php index 1ba91418952..ea44e78199e 100644 --- a/htdocs/compta/prelevement/config.php +++ b/htdocs/compta/prelevement/config.php @@ -42,6 +42,22 @@ if ($_GET["action"] == "set" && $user->admin) Header("Location: config.php"); } +if ($_GET["action"] == "addnotif") +{ + $bon = new BonPrelevement($db); + $bon->AddNotification($_POST["user"],$_POST["action"]); + + Header("Location: config.php"); +} + +if ($_GET["action"] == "deletenotif") +{ + $bon = new BonPrelevement($db); + $bon->DeleteNotificationById($_GET["notif"]); + + Header("Location: config.php"); +} + /* * * @@ -135,6 +151,87 @@ print ''; print ''; print ''; +print '
'; + +/* + * Notifications + * + */ + +print '
'; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +print ''; + +print ''; + +print ''; + + +$sql = "SELECT u.name, u.firstname, pn.action, pn.rowid"; +$sql .= " FROM ".MAIN_DB_PREFIX."user as u"; +$sql .= " , ".MAIN_DB_PREFIX."prelevement_notifications as pn"; +$sql .= " WHERE u.rowid = pn.fk_user"; + +$resql = $db->query($sql); +if ($resql) +{ + $num = $db->num_rows($resql); + $i = 0; + $var = True; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + + $var=!$var; + print ""; + + print ''; + print ''; + print ''; + $i++; + } + $db->free($resql); +} + + + +print '
NomValeurAction
'; +print ''; +print ''; +print '
'.stripslashes($obj->firstname)." ".stripslashes($obj->name).''.$obj->action.''.img_delete().'
'; +print '
'; + + $db->close(); llxFooter();