From e16f85e8bfecf6e5bf434a3000395524768ff409 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 25 Mar 2003 14:13:42 +0000 Subject: [PATCH] Nouveau fichier --- htdocs/boutique/newsletter/fiche.php | 217 +++++++++++++++++++++++++ htdocs/boutique/newsletter/pre.inc.php | 53 ++++++ mysql/tables/llx_newsletter.sql | 43 +++++ 3 files changed, 313 insertions(+) create mode 100644 htdocs/boutique/newsletter/fiche.php create mode 100644 htdocs/boutique/newsletter/pre.inc.php create mode 100644 mysql/tables/llx_newsletter.sql diff --git a/htdocs/boutique/newsletter/fiche.php b/htdocs/boutique/newsletter/fiche.php new file mode 100644 index 00000000000..e303f00ac2e --- /dev/null +++ b/htdocs/boutique/newsletter/fiche.php @@ -0,0 +1,217 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + * + */ + +require("./pre.inc.php"); + +$db = new Db(); + +if ($action == 'add') { + $newsletter = new Newsletter($db); + + $newsletter->nom = $nom; + + $id = $newsletter->create($user); +} + +if ($action == 'addga') { + $newsletter = new Newsletter($db); + + $newsletter->linkga($id, $ga); +} + +if ($action == 'update' && !$cancel) +{ + $newsletter = new Newsletter($db); + + $newsletter->nom = $nom; + + $newsletter->update($id, $user); +} + +if ($HTTP_POST_VARS["action"] == 'confirm_delete' && $HTTP_POST_VARS["confirm"] == yes) +{ + $newsletter = new Newsletter($db); + $result = $newsletter->fetch($id); + $newsletter->delete(); + Header("Location: index.php"); +} + +llxHeader(); + +/* + * + * + */ +if ($action == 'create') +{ + + print "
\n"; + print ''; + + print '
Nouvelle Newsletter

'; + + print ''; + print ""; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
Emetteur nom
Emetteur email
Email de réponseSi vide, le mail de l\'émetteur est utilisé
Sujet
Cible
Texte
 
'; + print '
'; + +} +else +{ + if ($id) + { + + $newsletter = new Newsletter($db); + $result = $newsletter->fetch($id); + + if ( $result ) + { + + /* + * Confirmation de la suppression de la newsletter + * + */ + + if ($action == 'delete') + { + + print '
'; + print ''; + print ''; + + print ''; + + print '\n"; + print ''; + print '
Supprimer un éditeur
Etes-vous sur de vouloir supprimer cette newsletter ?'; + $htmls = new Form($db); + + $htmls->selectyesno("confirm","no"); + + print "
'; + print "
\n"; + } + + /* + * Edition de la fiche + * + */ + + + if ($action == 'edit') + { + print '
Edition de la fiche Newsletter : '.$newsletter->titre.'

'; + + print "
\n"; + print ''; + + print ''; + print ""; + print ''; + + + print ''; + + print ''; + + print '
Nom
 

'; + + } + + print '
Fiche Newsletter : '.$newsletter->titre.'

'; + + print ''; + print ""; + print ''; + + print '"; + + print "
Nom'.$newsletter->nom.'
Livres'; + + foreach ($livres as $key => $value) + { + print ''.$value."
\n"; + } + print "
"; + + + + } + else + { + print "Fetch failed"; + } + + + } + else + { + print "Error"; + } +} + +/* ************************************************************************** */ +/* */ +/* Barre d'action */ +/* */ +/* ************************************************************************** */ + +print '
'; +print ''; + +if ($action == 'create') +{ + print ''; +} +else +{ + print ''; +} + +print ''; +print ''; + +if(sizeof($livres)==0 && $id) +{ + print ''; +} +else +{ + print ''; +} + + +print '
--[Editer]--[Supprimer][Supprimer]

'; + + + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/boutique/newsletter/pre.inc.php b/htdocs/boutique/newsletter/pre.inc.php new file mode 100644 index 00000000000..0a20b3f507a --- /dev/null +++ b/htdocs/boutique/newsletter/pre.inc.php @@ -0,0 +1,53 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + * + */ +require("../../main.inc.php3"); +require("./newsletter.class.php"); + +function llxHeader($head = "", $urlp = "") { + global $user, $conf; + + /* + * + * + */ + top_menu($head); + + $menu = new Menu(); + + $menu->add("/boutique/client/", "Clients"); + + $menu->add("/boutique/notification/", "Notifications"); + + $menu->add_submenu("/boutique/notification/produits.php", "Produits"); + + $menu->add("/boutique/newsletter/", "Newsletter"); + + $menu->add_submenu("/boutique/newsletter/fiche.php?action=create", "Nouvelle newsletter"); + + left_menu($menu->liste); + /* + * + * + */ + +} +?> diff --git a/mysql/tables/llx_newsletter.sql b/mysql/tables/llx_newsletter.sql new file mode 100644 index 00000000000..ea07b5687b2 --- /dev/null +++ b/mysql/tables/llx_newsletter.sql @@ -0,0 +1,43 @@ +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_newsletter +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + datec datetime, + tms timestamp, + email_subject varchar(32) NOT NULL, + email_from_name varchar(255) NOT NULL, + email_from_email varchar(255) NOT NULL, + email_replyto varchar(255) NOT NULL, + email_body text, + target smallint, + sql_target text, + status smallint NOT NULL DEFAULT 0, + date_send_request datetime, -- debut de l'envoi demandé + date_send_begin datetime, -- debut de l'envoi + date_send_end datetime, -- fin de l'envoi + nbsent integer, -- nombre de mails envoyés + fk_user_author integer, + fk_user_modif integer +); +