This commit is contained in:
Rodolphe Quiedeville 2002-12-21 17:35:17 +00:00
parent 7ed5723b0f
commit 8df4a29688
12 changed files with 145 additions and 103 deletions

View File

@ -63,14 +63,7 @@ for ($i = 0 ; $i < 4 ; $i++)
{ {
$var=!$var; $var=!$var;
print "<TR $bc[$var]>"; print "<TR $bc[$var]>";
if ($somme[$i]) print '<TD><a href="liste.php?statut='.$i.'">'.$libelle[$i].'</a></TD>';
{
print '<TD><a href="liste.php?statut='.$i.'">'.$libelle[$i].'</a></TD>';
}
else
{
print '<TD>'.$libelle[$i].'</TD>';
}
print '<TD align="right">'.price($somme[$i]).'</TD>'; print '<TD align="right">'.price($somme[$i]).'</TD>';
print "</tr>"; print "</tr>";
} }

View File

@ -45,12 +45,8 @@ if ($action == 'add') {
} }
if ($sortorder == "") { if ($sortorder == "") { $sortorder="DESC"; }
$sortorder="DESC"; if ($sortfield == "") { $sortfield="d.datedon"; }
}
if ($sortfield == "") {
$sortfield="d.datedon";
}
if ($page == -1) { $page = 0 ; } if ($page == -1) { $page = 0 ; }
@ -70,7 +66,7 @@ if ($result)
$num = $db->num_rows(); $num = $db->num_rows();
$i = 0; $i = 0;
print_barre_liste("Dons", $page, $PHP_SELF); print_barre_liste("Dons", $page, $PHP_SELF, "&statut=$statut");
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">"; print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR class="liste_titre">'; print '<TR class="liste_titre">';
@ -87,7 +83,7 @@ if ($result)
$objp = $db->fetch_object( $i); $objp = $db->fetch_object( $i);
$var=!$var; $var=!$var;
print "<TR $bc[$var]>"; print "<TR $bc[$var]>";
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">$objp->nom</a></TD>\n"; print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".stripslashes($objp->nom)."</a></TD>\n";
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".strftime("%d %B %Y",$objp->datedon)."</a></td>\n"; print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".strftime("%d %B %Y",$objp->datedon)."</a></td>\n";
print "<TD>$objp->projet</TD>\n"; print "<TD>$objp->projet</TD>\n";
print '<TD align="right">'.price($objp->amount).'</TD><td>&nbsp;</td>'; print '<TD align="right">'.price($objp->amount).'</TD><td>&nbsp;</td>';
@ -99,6 +95,7 @@ if ($result)
} }
else else
{ {
print $sql;
print $db->error(); print $db->error();
} }

View File

@ -34,7 +34,8 @@ class Don
var $public; var $public;
var $projetid; var $projetid;
var $modepaiement; var $modepaiement;
var $note; var $modepaiementid;
var $commentaire;
var $statut; var $statut;
var $projet; var $projet;
@ -51,7 +52,7 @@ class Don
Function Don($DB, $soc_idp="") Function Don($DB, $soc_idp="")
{ {
$this->db = $DB ; $this->db = $DB ;
$this->modepaiement = 0; $this->modepaiementid = 0;
} }
/* /*
* *
@ -126,7 +127,7 @@ class Don
$this->date = $this->db->idate($this->date); $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 = "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')"; $sql .= " VALUES (now(), $this->amount, $this->modepaiementid,'$this->nom','$this->adresse', '$this->cp','$this->ville','$this->pays',$this->public, $this->projetid, '$this->commentaire', $userid, '$this->date')";
$result = $this->db->query($sql); $result = $this->db->query($sql);
@ -176,9 +177,9 @@ class Don
*/ */
Function fetch($rowid) Function fetch($rowid)
{ {
$sql = "SELECT d.rowid, ".$this->db->pdate("d.datedon")." as datedon, d.nom, d.amount, p.libelle as projet, d.fk_statut, d.adresse, d.cp, d.ville, d.public, d.amount, d.fk_paiement"; $sql = "SELECT d.rowid, ".$this->db->pdate("d.datedon")." as datedon, d.nom, d.amount, p.libelle as projet, d.fk_statut, d.adresse, d.cp, d.ville, d.public, d.amount, d.fk_paiement, d.note, cp.libelle";
$sql .= " FROM llx_don as d, llx_don_projet as p"; $sql .= " FROM llx_don as d, llx_don_projet as p, c_paiement as cp";
$sql .= " WHERE p.rowid = d.fk_don_projet AND d.rowid = $rowid"; $sql .= " WHERE p.rowid = d.fk_don_projet AND cp.id = d.fk_paiement AND d.rowid = $rowid";
if ( $this->db->query( $sql) ) if ( $this->db->query( $sql) )
{ {
@ -187,16 +188,18 @@ class Don
$obj = $this->db->fetch_object(0); $obj = $this->db->fetch_object(0);
$this->date = $obj->datedon; $this->date = $obj->datedon;
$this->nom = $obj->nom; $this->nom = stripslashes($obj->nom);
$this->statut = $obj->fk_statut; $this->statut = $obj->fk_statut;
$this->adresse = $obj->adresse; $this->adresse = stripslashes($obj->adresse);
$this->cp = $obj->cp; $this->cp = stripslashes($obj->cp);
$this->ville = $obj->ville; $this->ville = stripslashes($obj->ville);
$this->projet = $obj->projet; $this->projet = $obj->projet;
$this->public = $obj->public; $this->public = $obj->public;
$this->modepaiement = $obj->modepaiement; $this->modepaiementid = $obj->fk_paiement;
$this->amount = $obj->amount; $this->modepaiement = $obj->libelle;
$this->amount = $obj->amount;
$this->commentaire = stripslashes($obj->note);
} }
} }
else else
@ -235,10 +238,15 @@ class Don
* Classé comme payé, le don a été recu * Classé comme payé, le don a été recu
* *
*/ */
Function set_paye($rowid) Function set_paye($rowid, $modepaiement='')
{ {
$sql = "UPDATE llx_don SET fk_statut = 2";
$sql = "UPDATE llx_don SET fk_statut = 2 WHERE rowid = $rowid AND fk_statut = 1;"; if ($modepaiement)
{
$sql .= ", fk_paiement=$modepaiement";
}
$sql .= " WHERE rowid = $rowid AND fk_statut = 1;";
if ( $this->db->query( $sql) ) if ( $this->db->query( $sql) )
{ {

View File

@ -20,15 +20,16 @@
* *
*/ */
print '<input type="hidden" name="projetid" value="'.$HTTP_POST_VARS["projetid"].'">'; print '<input type="hidden" name="projetid" value="'.$HTTP_POST_VARS["projetid"].'">';
print '<input type="hidden" name="nom" value="'.$HTTP_POST_VARS["nom"].'">'; print '<input type="hidden" name="nom" value="'.$HTTP_POST_VARS["nom"].'">';
print '<input type="hidden" name="adresse" value="'.$HTTP_POST_VARS["adresse"].'">'; print '<input type="hidden" name="adresse" value="'.$HTTP_POST_VARS["adresse"].'">';
print '<input type="hidden" name="cp" value="'.$HTTP_POST_VARS["cp"].'">'; print '<input type="hidden" name="cp" value="'.$HTTP_POST_VARS["cp"].'">';
print '<input type="hidden" name="ville" value="'.$HTTP_POST_VARS["ville"].'">'; print '<input type="hidden" name="ville" value="'.$HTTP_POST_VARS["ville"].'">';
print '<input type="hidden" name="date" value="'.$HTTP_POST_VARS["date"].'">'; print '<input type="hidden" name="date" value="'.$HTTP_POST_VARS["date"].'">';
print '<input type="hidden" name="public" value="'.$HTTP_POST_VARS["public"].'">'; print '<input type="hidden" name="public" value="'.$HTTP_POST_VARS["public"].'">';
print '<input type="hidden" name="email" value="'.$HTTP_POST_VARS["email"].'">'; print '<input type="hidden" name="email" value="'.$HTTP_POST_VARS["email"].'">';
print '<input type="hidden" name="montant" value="'.$HTTP_POST_VARS["montant"].'">'; print '<input type="hidden" name="montant" value="'.$HTTP_POST_VARS["montant"].'">';
print '<input type="hidden" name="commentaire" value="'.$HTTP_POST_VARS["commentaire"].'">';
?> ?>

View File

@ -66,7 +66,7 @@
</tr> </tr>
<tr id="commentaire"> <tr id="commentaire">
<textarea name="comment" wrap="soft" cols="40" rows="8"></textarea> <textarea name="commentaire" wrap="soft" cols="40" rows="6"></textarea>
</tr> </tr>
<tr> <tr>

View File

@ -24,69 +24,77 @@ require("../../don.class.php");
require("../../lib/mysql.lib.php3"); require("../../lib/mysql.lib.php3");
require("../../conf/conf.class.php3"); require("../../conf/conf.class.php3");
if ($HTTP_POST_VARS["action"] == 'add') $conf = new Conf();
if ($conf->don->enabled)
{ {
$conf = new Conf(); if ($HTTP_POST_VARS["action"] == 'add')
$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())
{ {
require("valid.php");
} $db = new Db();
else $don = new Don($db);
{
require("erreur.php"); $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"];
$don->commentaire = $HTTP_POST_VARS["commentaire"];
} if ($don->check())
elseif ($HTTP_POST_VARS["action"] == 'valid')
{
$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);
if ($return)
{ {
require("merci.php"); require("valid.php");
}
else
{
require("erreur.php");
}
}
elseif ($HTTP_POST_VARS["action"] == 'valid')
{
$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"];
$don->commentaire = $HTTP_POST_VARS["commentaire"];
if ($don->check())
{
$return = $don->create(0);
if ($return)
{
require("merci.php");
}
}
else
{
require("erreur.php");
} }
} }
else else
{ {
require("erreur.php"); require("don.php");
} }
} }
else else
{ {
require("don.php"); print "Cette fonctionnalité n'est pas activé sur ce site";
} }

View File

@ -38,31 +38,31 @@
<tr id="nom"> <tr id="nom">
<script language="php"> <script language="php">
print $don->nom; print stripslashes($don->nom);
</script> </script>
</tr> </tr>
<tr id="adresse"> <tr id="adresse">
<script language="php"> <script language="php">
print $don->adresse; print stripslashes($don->adresse);
</script> </script>
</tr> </tr>
<tr id="cp"> <tr id="cp">
<script language="php"> <script language="php">
print $don->cp; print stripslashes($don->cp);
</script> </script>
</tr> </tr>
<tr id="ville"> <tr id="ville">
<script language="php"> <script language="php">
print $don->ville; print stripslashes($don->ville);
</script> </script>
</tr> </tr>
<tr id="email"> <tr id="email">
<script language="php"> <script language="php">
print $don->email; print stripslashes($don->email);
</script> </script>
</tr> </tr>
@ -74,7 +74,7 @@
<tr id="commentaire"> <tr id="commentaire">
<script language="php"> <script language="php">
nl2br(print $don->note); nl2br(print stripslashes($don->commentaire));
</script> </script>
</tr> </tr>

View File

@ -44,12 +44,14 @@ if ($result)
$user = new User($db); $user = new User($db);
$user->login = "admin"; $user->login = "admin";
$user->admin = 1;
$user->create(); $user->create();
$user->id = 1; $user->id = 1;
$user->password("admin"); $user->password("admin");
print "Compte admin/admin créé";
} }
} }
} }

View File

@ -124,6 +124,8 @@ class User {
{ {
if ($this->db->affected_rows()) if ($this->db->affected_rows())
{ {
$this->id = $this->db->last_insert_id();
$this->update();
return 1; return 1;
} }
} }

View File

@ -191,7 +191,7 @@ else
print '<td><input size="10" maxlength="8" type="text" name="login" value="'.$fuser->login.'"></td></tr>'; print '<td><input size="10" maxlength="8" type="text" name="login" value="'.$fuser->login.'"></td></tr>';
print '<tr><td valign="top">Email</td>'; print '<tr><td valign="top">Email</td>';
print '<td><input size="12" type="text" name="email" value="'.$fuser->email.'"></td></tr>'; print '<td><input size="30" type="text" name="email" value="'.$fuser->email.'"></td></tr>';
print '<tr><td valign="top">Description</td><td>'; print '<tr><td valign="top">Description</td><td>';

31
httpd.public.conf.dist Normal file
View File

@ -0,0 +1,31 @@
#
#
# Sample httpd.public.conf for dolibarr
#
# $Id$
# $Source$
#
<VirtualHost public-doli.lafrere.lan>
ServerAdmin webmaster.fr@lolix.org
DocumentRoot /spare/home/www/dolibarr/dolibarr/htdocs
ServerName public-doli.lafrere.lan
ErrorLog /spare/home/www/dolibarr/logs/error.log
CustomLog /spare/home/www/dolibarr/logs/access.log combined
ErrorDocument 401 /public/error-401.html
<Location />
Options Indexes FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
</Location>
<Location /public/>
Options Indexes FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
</Location>
</VirtualHost>