*** empty log message ***

This commit is contained in:
Rodolphe Quiedeville 2002-12-20 18:07:49 +00:00
parent 3d98e04b75
commit 2c1b302951
8 changed files with 447 additions and 13 deletions

View File

@ -38,6 +38,7 @@ class Don
var $statut;
var $projet;
var $errorstr;
/*
* Statut du don
* 0 : promesse non validée
@ -50,6 +51,66 @@ class Don
Function Don($DB, $soc_idp="")
{
$this->db = $DB ;
$this->modepaiement = 0;
}
/*
*
*
*
*/
Function print_error_list()
{
$num = sizeof($this->errorstr);
for ($i = 0 ; $i < $num ; $i++)
{
print "<li>" . $this->errorstr[$i];
}
}
Function check()
{
$err = 0;
if (strlen(trim($this->nom)) == 0)
{
$error_string[$err] = "Le nom saisi est invalide";
$err++;
}
if (strlen(trim($this->adresse)) == 0)
{
$error_string[$err] = "L'adresse saisie est invalide";
$err++;
}
if (strlen(trim($this->cp)) == 0)
{
$error_string[$err] = "Le code postal saisi est invalide";
$err++;
}
if (strlen(trim($this->ville)) == 0)
{
$error_string[$err] = "La ville saisie est invalide";
$err++;
}
if ($this->amount == 0)
{
$error_string[$err] = "Le montant du don est invalide";
$err++;
}
if ($err)
{
$this->errorstr = $error_string;
return 0;
}
else
{
return 1;
}
}
/*
*
@ -62,6 +123,8 @@ class Don
* Insertion dans la base
*/
$this->date = $this->db->idate($this->date);
$sql = "INSERT INTO llx_don (datec, amount, fk_paiement, nom, adresse, cp, ville, pays, public, fk_don_projet, note, fk_user_author, datedon)";
$sql .= " VALUES (now(), $this->amount, $this->modepaiement,'$this->nom','$this->adresse', '$this->cp','$this->ville','$this->pays',$this->public, $this->projetid, '$this->note', $userid, '$this->date')";
@ -84,8 +147,9 @@ class Don
*
*/
Function delete($rowid)
{
{
$sql = "DELETE FROM llx_don WHERE rowid = $rowid AND fk_statut = 0;";
if ( $this->db->query( $sql) )

View File

@ -0,0 +1,59 @@
# Authors: Loic Dachary <loic@gnu.org> and Jaime Villate <villate@gnu.org>
#
# XML/XSLT processor (validator)
# -------------------------
#
# sablotron (sabcmd)
# apt-get install sablotron
#
# libxslt + libxml2 (xsltproc)
# http://www.xmlsoft.org/
#
# XML validator
# -------------
# apt-get install rxp
# or
# ftp://ftp.cogsci.ed.ac.uk/pub/richard/rxp-1.2.3.tar.gz
#
XSLTPROC = sabcmd
XSLTOPTS = \
'$$fsfeurope=$(FSFEUROPE)' \
'$$fsf=$(FSF)' \
'$$gnu=$(GNU)'
ENPAGES = $(shell find * -regex '.*\.en\.xhtml' -print | sed "s/xhtml$$/html/")
FRPAGES = $(shell find * -regex '.*\.fr\.xhtml' -print | sed "s/xhtml$$/html/")
RSYNC=/usr/bin/rsync
ROPT=-av
RSSH=-e ssh
all:
$(XSLTPROC) eucd.xsl don.xhtml > don.php
$(XSLTPROC) eucd.xsl erreur.xhtml > erreur.php
$(XSLTPROC) eucd.xsl merci.xhtml > merci.php
$(ENPAGES) $(FRPAGES): %.html: %.xhtml fsfe-fr.xsl navigation.en.xsl navigation.fr.xsl
@echo "Building $@ ..."; \
path=$< ; \
base=`expr $$path : '\(.*\).xhtml'` ; \
filebase=`basename $$base` ; \
dir=`dirname $$path` ; \
root=`dirname $$path | perl -pe 'chop; s:([^/]+):..:g if($$_ ne ".")'` ; \
$(XSLTPROC) fsfe-fr.xsl $$path $(XSLTOPTS) \
'$$fsffrance='$$root '$$filebase='$$filebase '$$path='$$path | \
perl -MFile::Copy -p -e '$$| = 1; copy("'$$dir'/$$1", \*STDOUT) if(/\#include virtual=\"(.*?)\"/); s/\$$//g if(/\$$''Date:/);' \
> $$base.html-temp && \
( cat $$base.html-temp | \
perl -p -e '$$| = 1; s/\$$//g if(/\$$''Date:/); s/mode: xml \*\*\*/mode: html \*\*\*/' > $$base.html \
) ; \
rm -f $$base.html-temp
# remove html files for which an xhtml version exists (exclude fr/)
clean:
rm -f $(NEWS) $(ENPAGES) $(FRPAGES)

View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<html lang="fr">
<head>
</head>
<body>
<div class="main">
<p>
<h1>Ce formulaire n'est pas encore actif, merci de ne pas l'utiliser</h1>
</p>
<form action="index.php" method="post">
<table id="formulaire">
<input type="hidden" name="action" value="add" />
<tr id="date">
<script language="php">
$a = setlocale("LC_TIME", "FRENCH");
print strftime("%d %B %Y", time());
</script>
</tr>
<tr id="projet">
</tr>
<tr id="public">
<select name="public">
<option value="1">oui</option>
<option value="0">non</option>
</select>
</tr>
<tr id="nom">
<input type="text" name="nom" size="40" />
</tr>
<tr id="adresse">
<input type="text" name="adresse" size="40" />
</tr>
<tr>
<td class="titre">CP Ville</td>
<td class="valeur">
<input type="text" name="cp" size="8" />
<input type="text" name="ville" size="40" />
</td>
</tr>
<tr id="email">
<input type="text" name="email" size="40" />
</tr>
<tr>
<td class="titre">
Montant
</td>
<td class="valeur">
<input type="text" name="montant" size="10" /> euros
</td>
</tr>
<tr id="commentaire">
<textarea name="comment" wrap="soft" cols="40" rows="8"></textarea>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Valider" />
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->

View File

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<html lang="fr">
<head>
</head>
<body>
<div class="main">
<p>
<h1>Erreur</h1>
</p>
<p>
Nous avons détecté les erreurs suivantes :
<ol>
<script language="php">
$don->print_error_list();
</script>
</ol>
</p>
<p>
<b>Pour corriger ces erreurs utilisez la touche 'Back' de votre navigateur.</b>
</p>
<form action="index.php" method="post">
<table id="formulaire">
<tr id="date">
<script language="php">
$a = setlocale("LC_TIME", "FRENCH");
print strftime("%d %B %Y", time());
</script>
</tr>
<tr id="projet">
</tr>
<tr id="public">
</tr>
<tr id="nom">
<script language="php">
print $don->nom;
</script>
</tr>
<tr id="adresse">
<script language="php">
print "$don->adresse";
</script>
</tr>
<tr id="ville">
<script language="php">
print "$don->cp $don->ville";
</script>
</tr>
<tr id="email">
<script language="php">
print $don->email;
</script>
</tr>
<tr id="montant">
<script language="php">
print $don->amount;
</script>
</tr>
</table>
</form>
</div>
</body>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->

View File

@ -9,7 +9,7 @@
<table border="1" cellpadding="5" cellspacing="10" class="main">
<tr>
<td colspan="2">
<span>Dons FSF France</span>
<span><a href="http://eucd.info/">EUCD.INFO</a> - Au <a href="donations.fr.php">secours</a> de la copie privée</span>
</td>
</tr>
@ -27,9 +27,15 @@
<a href="http://eucd.info/who.fr.php">Qui</a><br />
<br />
<br />
<a href="donations.fr.php">Dons</a><br />
<script language="php">
//require("/var/www/www.eucd.info/htdocs/thermometer.php");
//print moneyMeter($totaal_ontvangen+$post_donaties+$post_sponsoring, $totaal_pending, $post_intent);
</script>
</td>
<td>
<td>
<xsl:apply-templates select="@*|node()"/>
</td>
</tr>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE xsl:stylesheet [<!ENTITY nbsp "&#160;">]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"
encoding="ISO-8859-1"
doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/REC-html40/loose.dtd"
indent="yes"
/>
<xsl:param name="fsffrance">http://france.fsfeurope.org</xsl:param>
<xsl:param name="fsfeurope">http://www.fsfeurope.org</xsl:param>
<xsl:param name="fsf">http://www.fsf.org</xsl:param>
<xsl:param name="gnu">http://www.gnu.org</xsl:param>
<xsl:param name="filebase">nofile.html</xsl:param>
<xsl:param name="path">nofile.html</xsl:param>
<xsl:template match="/">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/html/body">
<body>
<xsl:comment>
DO NOT MODIFY THIS DOCUMENT. IT WAS GENERATED BY XSLT PROCESSING
AND YOUR MODIFICATIONS WILL BE LOST. THE SOURCE OF THE DOCUMENT
IS IN THE .xhtml FILE USE make all TO REGENERATE
</xsl:comment>
<xsl:apply-templates select="node()"/>
</body>
</xsl:template>
<xsl:template match="/html/head">
<head>
<link rel="stylesheet" type="text/css" href="http://eucd.info/eucd.css" />
<meta name="author" content="FSF France"></meta>
<meta name="keywords" content="logiciel libre projet eucd"></meta>
<meta name="description" content="Dons à la FSF France."></meta>
<title>Dons FSF France - Fond de secours EUCD.INFO</title>
<xsl:apply-templates select="@*|node()"/>
</head>
</xsl:template>
<xsl:include href="eucd-nav.fr.xsl" />
<xsl:template match="@*|node()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->
</xsl:stylesheet>

View File

@ -0,0 +1,64 @@
<?PHP
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* 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("../../don.class.php");
require("../../lib/mysql.lib.php3");
require("../../conf/conf.class.php3");
if ($HTTP_POST_VARS["action"] == 'add')
{
$conf = new Conf();
$db = new Db();
$don = new Don($db);
$don->projetid = $HTTP_POST_VARS["projetid"];
$don->date = time();
$don->nom = $HTTP_POST_VARS["nom"];
$don->adresse = $HTTP_POST_VARS["adresse"];
$don->cp = $HTTP_POST_VARS["cp"];
$don->ville = $HTTP_POST_VARS["ville"];
$don->public = $HTTP_POST_VARS["public"];
$don->email = $HTTP_POST_VARS["email"];
$don->amount = $HTTP_POST_VARS["montant"];
if ($don->check())
{
$return = $don->create(0);
require("merci.php");
}
else
{
require("erreur.php");
}
}
else
{
require("don.php");
}
?>

View File

@ -58,19 +58,14 @@
<tr id="montant">
<script language="php">
print $don->amount;
print number_format($don->amount, 2, '.', ' ');
</script>
</tr>
<tr>
<td valign="top">
Commentaire
</td>
<td>
<script language="php">
nl2br(print $don->note);
</script>
</td>
<tr id="commentaire">
<script language="php">
nl2br(print $don->note);
</script>
</tr>
</table>