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;
print "<TR $bc[$var]>";
if ($somme[$i])
{
print '<TD><a href="liste.php?statut='.$i.'">'.$libelle[$i].'</a></TD>';
}
else
{
print '<TD>'.$libelle[$i].'</TD>';
}
print '<TD><a href="liste.php?statut='.$i.'">'.$libelle[$i].'</a></TD>';
print '<TD align="right">'.price($somme[$i]).'</TD>';
print "</tr>";
}

View File

@ -45,12 +45,8 @@ if ($action == 'add') {
}
if ($sortorder == "") {
$sortorder="DESC";
}
if ($sortfield == "") {
$sortfield="d.datedon";
}
if ($sortorder == "") { $sortorder="DESC"; }
if ($sortfield == "") { $sortfield="d.datedon"; }
if ($page == -1) { $page = 0 ; }
@ -70,7 +66,7 @@ if ($result)
$num = $db->num_rows();
$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 '<TR class="liste_titre">';
@ -87,7 +83,7 @@ if ($result)
$objp = $db->fetch_object( $i);
$var=!$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>$objp->projet</TD>\n";
print '<TD align="right">'.price($objp->amount).'</TD><td>&nbsp;</td>';
@ -99,6 +95,7 @@ if ($result)
}
else
{
print $sql;
print $db->error();
}

View File

@ -34,7 +34,8 @@ class Don
var $public;
var $projetid;
var $modepaiement;
var $note;
var $modepaiementid;
var $commentaire;
var $statut;
var $projet;
@ -51,7 +52,7 @@ class Don
Function Don($DB, $soc_idp="")
{
$this->db = $DB ;
$this->modepaiement = 0;
$this->modepaiementid = 0;
}
/*
*
@ -126,7 +127,7 @@ class Don
$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')";
$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);
@ -176,9 +177,9 @@ class Don
*/
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 .= " FROM llx_don as d, llx_don_projet as p";
$sql .= " WHERE p.rowid = d.fk_don_projet AND d.rowid = $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, d.note, cp.libelle";
$sql .= " FROM llx_don as d, llx_don_projet as p, c_paiement as cp";
$sql .= " WHERE p.rowid = d.fk_don_projet AND cp.id = d.fk_paiement AND d.rowid = $rowid";
if ( $this->db->query( $sql) )
{
@ -187,16 +188,18 @@ class Don
$obj = $this->db->fetch_object(0);
$this->date = $obj->datedon;
$this->nom = $obj->nom;
$this->statut = $obj->fk_statut;
$this->adresse = $obj->adresse;
$this->cp = $obj->cp;
$this->ville = $obj->ville;
$this->projet = $obj->projet;
$this->public = $obj->public;
$this->modepaiement = $obj->modepaiement;
$this->amount = $obj->amount;
$this->date = $obj->datedon;
$this->nom = stripslashes($obj->nom);
$this->statut = $obj->fk_statut;
$this->adresse = stripslashes($obj->adresse);
$this->cp = stripslashes($obj->cp);
$this->ville = stripslashes($obj->ville);
$this->projet = $obj->projet;
$this->public = $obj->public;
$this->modepaiementid = $obj->fk_paiement;
$this->modepaiement = $obj->libelle;
$this->amount = $obj->amount;
$this->commentaire = stripslashes($obj->note);
}
}
else
@ -235,10 +238,15 @@ class Don
* 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) )
{

View File

@ -60,7 +60,7 @@ function llxHeader($head = "") {
$menu->add("/fichinter/", "Fiches d'intervention");
}
if ($conf->produit->enabled )
if ($conf->produit->enabled )
{
$menu->add("/product/", "Produits");
}

View File

@ -20,15 +20,16 @@
*
*/
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="adresse" value="'.$HTTP_POST_VARS["adresse"].'">';
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="date" value="'.$HTTP_POST_VARS["date"].'">';
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="montant" value="'.$HTTP_POST_VARS["montant"].'">';
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="adresse" value="'.$HTTP_POST_VARS["adresse"].'">';
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="date" value="'.$HTTP_POST_VARS["date"].'">';
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="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 id="commentaire">
<textarea name="comment" wrap="soft" cols="40" rows="8"></textarea>
<textarea name="commentaire" wrap="soft" cols="40" rows="6"></textarea>
</tr>
<tr>

View File

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

View File

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

View File

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

View File

@ -124,6 +124,8 @@ class User {
{
if ($this->db->affected_rows())
{
$this->id = $this->db->last_insert_id();
$this->update();
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 '<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>';

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>