This commit is contained in:
Rodolphe Quiedeville 2003-02-03 11:56:05 +00:00
parent c2de6e80d2
commit e4a284c135
8 changed files with 159 additions and 111 deletions

View File

@ -1,6 +1,7 @@
<?PHP
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Jean-Louis Bergamo <jlb@j1b.org>
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.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
@ -244,7 +245,7 @@ class Adherent
}
/*
* Suppression du don
* Suppression de l'adhérent
*
*/
Function delete($rowid)

View File

@ -1,5 +1,5 @@
<?PHP
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2002-2003 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
@ -25,7 +25,7 @@ llxHeader();
$db = new Db();
function do_upload () {
function do_upload ($socid) {
global $uploadfile, $uploadfile_size;
global $local_file, $error_msg;
@ -40,18 +40,21 @@ function do_upload () {
return;
}
$upload_dir = "/tmp";
$local_file = "$upload_dir/TOTO";
$soc_dir = SOCIETE_DOCUMENT_DIR . "/" . $socid;
while ( file_exists ( '$local_file' ) )
if (! is_dir($soc_dir))
{
$seq++;
$local_file .= "$seq";
}
print "$local_file";
mkdir($soc_dir);
}
rename ( $uploadfile, $local_file );
$upload_dir = "/tmp";
$local_file = SOCIETE_DOCUMENT_DIR . "/" . $socid . "/";
move_uploaded_file ( $userfile, $local_file );
print $HTTP_POST_FILES['uploadfile']['name'];
}
@ -61,7 +64,7 @@ if ( $error_msg )
}
if ( $sendit )
{
do_upload ();
do_upload ($socid);
}
@ -71,95 +74,95 @@ if ( $sendit )
*
*
*/
if ($socid > 0) {
if ($socid > 0)
{
$societe = new Societe($db, $socid);
$sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.address,s.cp,s.ville, s.note, t.libelle as typent, e.libelle as effectif, s.siren, s.prefix_comm, s.services,s.parent, s.description FROM societe as s, c_stcomm as st, c_typent as t, c_effectif as e ";
$sql .= " WHERE s.fk_stcomm=st.id AND s.fk_typent = t.id AND s.fk_effectif = e.id";
if ($to == 'next') {
$sql .= " AND s.idp > $socid ORDER BY idp ASC LIMIT 1";
} elseif ($to == 'prev') {
$sql .= " AND s.idp < $socid ORDER BY idp DESC LIMIT 1";
} else {
$sql .= " AND s.idp = $socid";
}
$result = $db->query($sql);
if ($result) {
$objsoc = $db->fetch_object(0);
if ($result)
{
$objsoc = $db->fetch_object(0);
$dac = strftime("%Y-%m-%d %H:%M", time());
if ($errmesg)
{
print "<b>$errmesg</b><br>";
}
/*
*
*/
print "<table width=\"100%\" border=\"0\" cellspacing=\"1\">\n";
print "<tr><td><div class=\"titre\">Fiche client : $objsoc->nom</div></td>";
print "<td align=\"center\"><a href=\"index.php3?socidp=$objsoc->idp&action=add_bookmark\">[Bookmark]</a></td>";
print "<td align=\"center\"><a href=\"projet/fiche.php3?socidp=$objsoc->idp&action=create\">[Projet]</a></td>";
print "<td align=\"center\"><a href=\"addpropal.php3?socidp=$objsoc->idp&action=create\">[Propal]</a></td>";
print "<td><a href=\"socnote.php3?socid=$objsoc->idp\">Notes</a></td>";
print "<td align=\"center\">[<a href=\"../soc.php3?socid=$objsoc->idp&action=edit\">Editer</a>]</td>";
print "</tr></table>";
/*
*
*
*/
print "<table width=\"100%\" border=0><tr>\n";
print "<td valign=\"top\">";
print "<table cellspacing=\"0\" border=\"1\" width=\"100%\">";
print "<tr><td>Type</td><td> $objsoc->typent</td><td>Effectif</td><td>$objsoc->effectif</td></tr>";
print "<tr><td>Tel</td><td> $objsoc->tel&nbsp;</td><td>fax</td><td>$objsoc->fax&nbsp;</td></tr>";
print "<tr><td>Ville</td><td colspan=\"3\">".nl2br($objsoc->address)."<br>$objsoc->cp $objsoc->ville</td></tr>";
print "<tr><td>siren</td><td><a href=\"http://www.societe.com/cgi-bin/recherche?rncs=$objsoc->siren\">$objsoc->siren</a>&nbsp;</td>";
print "<td>prefix</td><td>";
if ($objsoc->prefix_comm) {
print $objsoc->prefix_comm;
} else {
print "[<a href=\"$PHP_SELF?socid=$objsoc->idp&action=attribute_prefix\">Attribuer</a>]";
}
print "</td></tr>";
print "<tr><td>Site</td><td colspan=\"3\"><a href=\"http://$objsoc->url\">$objsoc->url</a>&nbsp;</td></tr>";
print "</table>";
/*
*
*/
print "</td>\n";
print "</table>";
echo '<FORM NAME="userfile" ACTION="docsoc.php?socid='.$socid.'" ENCTYPE="multipart/form-data" METHOD="POST">';
print '<INPUT TYPE="HIDDEN" NAME="MAX_FILE_SIZE" VALUE="2000000">';
print '<input type="file" name="userfile" size="40" maxlength="80">';
print '<BR><BR>';
print '<INPUT TYPE="SUBMIT" VALUE="Upload File!" NAME="sendit">';
print '<INPUT TYPE="SUBMIT" VALUE="Cancel" NAME="cancelit"><BR>';
print '</FORM>';
$dac = strftime("%Y-%m-%d %H:%M", time());
if ($errmesg) {
print "<b>$errmesg</b><br>";
}
/*
*
*/
print "<table width=\"100%\" border=\"0\" cellspacing=\"1\">\n";
print "<tr><td><div class=\"titre\">Fiche client : $objsoc->nom</div></td>";
print "<td align=\"center\"><a href=\"index.php3?socidp=$objsoc->idp&action=add_bookmark\">[Bookmark]</a></td>";
print "<td align=\"center\"><a href=\"projet/fiche.php3?socidp=$objsoc->idp&action=create\">[Projet]</a></td>";
print "<td align=\"center\"><a href=\"addpropal.php3?socidp=$objsoc->idp&action=create\">[Propal]</a></td>";
print "<td><a href=\"socnote.php3?socid=$objsoc->idp\">Notes</a></td>";
print "<td align=\"center\">[<a href=\"../soc.php3?socid=$objsoc->idp&action=edit\">Editer</a>]</td>";
print "</tr></table>";
/*
*
*
*/
print "<table width=\"100%\" border=0><tr>\n";
print "<td valign=\"top\">";
print "<table cellspacing=\"0\" border=\"1\" width=\"100%\">";
print "<tr><td>Type</td><td> $objsoc->typent</td><td>Effectif</td><td>$objsoc->effectif</td></tr>";
print "<tr><td>Tel</td><td> $objsoc->tel&nbsp;</td><td>fax</td><td>$objsoc->fax&nbsp;</td></tr>";
print "<tr><td>Ville</td><td colspan=\"3\">".nl2br($objsoc->address)."<br>$objsoc->cp $objsoc->ville</td></tr>";
print "<tr><td>siren</td><td><a href=\"http://www.societe.com/cgi-bin/recherche?rncs=$objsoc->siren\">$objsoc->siren</a>&nbsp;</td>";
print "<td>prefix</td><td>";
if ($objsoc->prefix_comm) {
print $objsoc->prefix_comm;
} else {
print "[<a href=\"$PHP_SELF?socid=$objsoc->idp&action=attribute_prefix\">Attribuer</a>]";
else
{
print $db->error() . "<br>" . $sql;
}
print "</td></tr>";
print "<tr><td>Site</td><td colspan=\"3\"><a href=\"http://$objsoc->url\">$objsoc->url</a>&nbsp;</td></tr>";
print "</table>";
/*
*
*/
print "</td>\n";
print "</table>";
echo '<FORM NAME="userfile" ACTION="docsoc.php?socid='.$socid.'" ENCTYPE="multipart/form-data" METHOD=POST>';
?>
<INPUT TYPE="HIDDEN" NAME="MAX_FILE_SIZE" VALUE="2000000">
<input type="file" name="uploadfile" size="24" maxlength="80">
<BR><BR>
<INPUT TYPE="SUBMIT" VALUE="Upload File!" NAME="sendit">
<INPUT TYPE="SUBMIT" VALUE="Cancel" NAME="cancelit"><BR>
</FORM>
<?PHP
} else {
print $db->error() . "<br>" . $sql;
}
} else {
}
else
{
print "Erreur";
}
$db->close();

View File

@ -97,13 +97,28 @@ if ($account)
print "<b>Bank</b> - &nbsp;-";
print "<a href=\"$PHP_SELF?viewall=1&account=$account\">Voir tout</a>";
print "<form method=\"post\" action=\"$PHP_SELF?viewall=$viewall&vline=$vline&account=$account\">";
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
print "<TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">";
print '<form method="post" action="'."$PHP_SELF?viewall=$viewall&vline=$vline&account=$account".'">';
print '<input type="hidden" name="action" value="search">';
print '<TABLE border="1" width="100%" cellspacing="0" cellpadding="2">';
/*
* Formulaire de recherche
*
*/
print "<TR class=\"liste_titre\">";
print "<td>Date</td><td>Type</td><td>Description</TD>";
print "<td align=\"right\">Debit</TD>";
print "<td align=\"right\">Credit</TD>";
print '<td align="right"><input type="text" name="req_debit" size="6"></TD>';
print '<td align="right"><input type="text" name="req_credit" size="6"></TD>';
print "<td align=\"right\">-</TD>";
print "<td align=\"right\">-</td>";
print '<td align="right"><input type="submit"></td>';
print "</TR>\n";
print "</form>";
print "<form method=\"post\" action=\"$PHP_SELF?viewall=$viewall&vline=$vline&account=$account\">";
print "<TR class=\"liste_titre\">";
print "<td>Date</td><td>Type</td><td>Description</TD>";
print "<td align=\"right\">Débit</TD>";
print "<td align=\"right\">Crédit</TD>";
print "<td align=\"right\">Solde</TD>";
print "<td align=\"right\">Rel</td>";
print "<td align=\"right\">Francs</td>";
@ -151,7 +166,18 @@ if ($account)
*/
$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type";
$sql .= " FROM llx_bank as b "; if ($account) { $sql .= " WHERE fk_account=$account"; }
$sql .= " FROM llx_bank as b ";
if ($account)
{
$sql .= " WHERE fk_account=$account";
}
if ($req_debit)
{
$sql .= " AND b.amount = -".$req_debit;
}
if ($vue)
{
if ($vue == 'credit')
@ -182,7 +208,7 @@ if ($account)
if ($i > ($nbline - $viewline))
{
if (!$psol)
if (!$psol && $action !='search')
{
print "<tr $bc[$var]><td colspan=\"4\">&nbsp;</td>";
print "<td align=\"right\">".price($total)."</b></td><td>&nbsp;</td>";
@ -237,13 +263,20 @@ if ($account)
print "<td>&nbsp;</td><td align=\"right\">".price($objp->amount)."</TD>\n";
}
if ($total > 0)
if ($action !='search')
{
print "<td align=\"right\">".price($total)."</TD>\n";
if ($total > 0)
{
print '<td align="right">'.price($total)."</TD>\n";
}
else
{
print "<td align=\"right\"><b>".price($total)."</b></TD>\n";
}
}
else
{
print "<td align=\"right\"><b>".price($total)."</b></TD>\n";
print '<td align="right">-</TD>';
}
if ($objp->rappro)
@ -255,7 +288,14 @@ if ($account)
print "<td align=\"center\"><a href=\"$PHP_SELF?action=del&rowid=$objp->rowid&account=$account\">[Del]</a></td>";
}
print "<td align=\"right\"><small>".francs($objp->amount)."</small></TD>\n";
if ($action !='search')
{
print "<td align=\"right\"><small>".francs($objp->amount)."</small></TD>\n";
}
else
{
print '<td align="right">-</TD>';
}
print "</tr>";

View File

@ -53,7 +53,7 @@ $sql = "SELECT ipclient,
code_retour,
ref_commande";
$sql .= " FROM transaction_bplc";
$sql .= " FROM llx_transaction_bplc";
$result = $db->query($sql);
if ($result) {

View File

@ -360,7 +360,7 @@ class Don
}
}
/*
* Classé comme payé, le don a été recu
*
*
*/
Function set_commentaire($rowid, $commentaire='')

View File

@ -253,11 +253,15 @@ else
print stripslashes($obj->note);
print '</textarea></td></tr>';
print '<tr><td>Numéro :</td><td><input name="facnumber" type="text" value="'.$obj->facnumber.'"></td></tr>';
print '<tr><td>Libellé :</td><td><input size="30" name="libelle" type="text" value="'.stripslashes($obj->libelle).'"></td></tr>';
print '<tr><td valign="top">Numéro :</td><td valign="top">';
print $obj->facnumber .'<br>';
print '<input name="facnumber" type="text" value="'.$obj->facnumber.'"></td></tr>';
print '<tr><td valign="top">Libellé :</td><td>';
print stripslashes($obj->libelle). '<br>';
print '<input size="30" name="libelle" type="text" value="'.stripslashes($obj->libelle).'"></td></tr>';
print '<tr bgcolor="#e0e0e0"><td>Montant HT :</td>';
print '<td><input type="text" size="8" name="amount" value="'.$obj->amount.'"></td></tr>';
print '<td valign="top">'.$obj->amount.'<br><input type="text" size="8" name="amount" value="'.$obj->amount.'"></td></tr>';
print '<tr bgcolor="#e0e0e0"><td>TVA :</td>';
print '<td><select name="tva_taux">';

View File

@ -1,5 +1,5 @@
<?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$

View File

@ -1,5 +1,5 @@
-- ========================================================================
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- $Id$
-- $Source$