Fix: Correction des mauvaises utilisations des fetch_objet ou on passait un paramtre jamais utilis.
This commit is contained in:
parent
d452056877
commit
4ce75b6a78
@ -433,7 +433,7 @@ class Adherent
|
||||
{
|
||||
if ($this->db->num_rows())
|
||||
{
|
||||
$obj = $this->db->fetch_object(0);
|
||||
$obj = $this->db->fetch_object();
|
||||
$this->fetch($obj->rowid);
|
||||
}
|
||||
}
|
||||
@ -461,7 +461,7 @@ class Adherent
|
||||
if ($this->db->num_rows())
|
||||
{
|
||||
|
||||
$obj = $this->db->fetch_object(0);
|
||||
$obj = $this->db->fetch_object();
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->typeid = $obj->fk_adherent_type;
|
||||
@ -508,7 +508,6 @@ class Adherent
|
||||
if ( $this->db->query( $sql) ){
|
||||
if ($this->db->num_rows()){
|
||||
|
||||
//$obj = $this->db->fetch_object(0);
|
||||
$tab = $this->db->fetch_array();
|
||||
|
||||
foreach ($tab as $key => $value){
|
||||
@ -534,7 +533,6 @@ class Adherent
|
||||
|
||||
if ( $this->db->query( $sql) ){
|
||||
if ($this->db->num_rows()){
|
||||
//$tab = $this->db->fetch_object();
|
||||
//$array_name_options[]=$tab->Field;
|
||||
while ($tab = $this->db->fetch_object()){
|
||||
if ($tab->Field != 'optid' && $tab->Field != 'tms' && $tab->Field != 'adhid'){
|
||||
|
||||
@ -167,7 +167,7 @@ class AdherentType
|
||||
if ($this->db->num_rows())
|
||||
{
|
||||
|
||||
$obj = $this->db->fetch_object(0);
|
||||
$obj = $this->db->fetch_object();
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->libelle = $obj->libelle;
|
||||
@ -200,7 +200,7 @@ class AdherentType
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($i);
|
||||
$obj = $this->db->fetch_object();
|
||||
|
||||
$projets[$obj->rowid] = $obj->libelle;
|
||||
$i++;
|
||||
|
||||
@ -82,7 +82,7 @@ if ($result)
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
// attribut a remplacer
|
||||
$replace = array (
|
||||
ucfirst(strtolower($objp->prenom)),
|
||||
|
||||
@ -70,7 +70,7 @@ if ($result)
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
// imprime le texte specifique sur la carte
|
||||
$pdf->Add_PDF_card(sprintf("%s\n%s\n%s %s\n%s", ucfirst(strtolower($objp->prenom))." ".strtoupper($objp->nom), ucwords(strtolower($objp->adresse)), $objp->cp, strtoupper($objp->ville), ucfirst(strtolower($objp->pays))),'','');
|
||||
$i++;
|
||||
|
||||
@ -289,7 +289,7 @@ class Cotisation
|
||||
if ($this->db->num_rows())
|
||||
{
|
||||
|
||||
$obj = $this->db->fetch_object(0);
|
||||
$obj = $this->db->fetch_object();
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->date = $obj->datedon;
|
||||
|
||||
@ -62,13 +62,13 @@ if ($_POST["action"] == '2bank' && $_POST["rowid"] !=''){
|
||||
$num = $db->num_rows();
|
||||
if ($num>0)
|
||||
{
|
||||
$objp = $db->fetch_object(0);
|
||||
$objp = $db->fetch_object($result);
|
||||
$amount=$objp->cotisation;
|
||||
$acct=new Account($db,ADHERENT_BANK_ACCOUNT);
|
||||
$insertid=$acct->addline($dateop, $_POST["operation"], $_POST["label"], $amount, $_POST["num_chq"],ADHERENT_BANK_CATEGORIE);
|
||||
if ($insertid == '')
|
||||
{
|
||||
print "<p> Probleme d'insertion : ".$db->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -81,20 +81,19 @@ if ($_POST["action"] == '2bank' && $_POST["rowid"] !=''){
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<p> Probleme d'insertion $sql : ".$db->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<p> Probleme SQL : $sql : ".$db->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<p> Probleme SQL : $sql : ".$db->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -123,7 +122,7 @@ if ($result)
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$Total[strftime("%Y",$objp->dateadh)]+=price($objp->cotisation);
|
||||
$Number[strftime("%Y",$objp->dateadh)]+=1;
|
||||
$i++;
|
||||
@ -145,77 +144,64 @@ if ($result)
|
||||
|
||||
print_barre_liste("Liste des cotisations", $page, "cotisations.php", "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield");
|
||||
|
||||
print "<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n";
|
||||
print '<TR class="liste_titre">';
|
||||
print "<table class=\"noborder\">\n";
|
||||
print '<tr class="liste_titre">';
|
||||
print "<td>Annee</td>";
|
||||
print '<td align="right">Montant</TD>';
|
||||
print "<td align=\"right\">Nombre</TD>";
|
||||
print "<td align=\"right\">Moyenne</TD>\n";
|
||||
print "</TR>\n";
|
||||
print '<td align="right">Montant</td>';
|
||||
print "<td align=\"right\">Nombre</td>";
|
||||
print "<td align=\"right\">Moyenne</td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ($Total as $key=>$value){
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]><TD><A HREF=\"cotisations.php?statut=$statut&date_select=$key\">$key</A></TD><TD align=\"right\">".price($value)."</TD><TD align=\"right\">".$Number[$key]."</TD><TD align=\"right\">".price($value/$Number[$key])."</TD></TR>\n";
|
||||
print "<tr $bc[$var]><td><A HREF=\"cotisations.php?statut=$statut&date_select=$key\">$key</A></TD><TD align=\"right\">".price($value)."</TD><TD align=\"right\">".$Number[$key]."</TD><TD align=\"right\">".price($value/$Number[$key])."</TD></TR>\n";
|
||||
}
|
||||
print "</table><BR>\n";
|
||||
print "</table><br>\n";
|
||||
|
||||
print "<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print "<table class=\"border\">";
|
||||
|
||||
print '<TR class="liste_titre">';
|
||||
//print "<td>Date</td>";
|
||||
print '<TD>';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>';
|
||||
print_liste_field_titre("Date<BR>","cotisations.php","c.dateadh","&page=$page&statut=$statut");
|
||||
print "</TD>\n";
|
||||
print "</td>\n";
|
||||
|
||||
//print "<td align=\"right\">Montant</TD>";
|
||||
print '<TD>';
|
||||
print '<td>';
|
||||
print_liste_field_titre("Montant<BR>","cotisations.php","c.cotisation","&page=$page&statut=$statut");
|
||||
print "</TD>\n";
|
||||
print "</td>\n";
|
||||
|
||||
//print "<td>Prenom Nom / Société</td>";
|
||||
print '<TD>';
|
||||
// print_liste_field_titre("Prenom","cotisations.php","d.prenom","&page=$page&statut=$statut");
|
||||
print '<td>';
|
||||
print_liste_field_titre("Prenom Nom<BR>","cotisations.php","d.nom","&page=$page&statut=$statut");
|
||||
// print " / Société";
|
||||
print "</TD>\n";
|
||||
print "</td>\n";
|
||||
|
||||
if (defined("ADHERENT_BANK_USE") && ADHERENT_BANK_USE !=0){
|
||||
print '<TD>';
|
||||
print '<td>';
|
||||
// print_liste_field_titre("Bank","cotisations.php","c.fk_bank","&page=$page&statut=$statut");
|
||||
print 'Bank<BR>(Type,Numéro,Libelle)';
|
||||
print "</TD>\n";
|
||||
print 'Bank<br>(Type,Numéro,Libelle)';
|
||||
print "</td>\n";
|
||||
}
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
$total=0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".strftime("%d %B %Y",$objp->dateadh)."</a></td>\n";
|
||||
print '<TD align="right">'.price($objp->cotisation).'</TD>';
|
||||
//$Total[strftime("%Y",$objp->dateadh)]+=price($objp->cotisation);
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".strftime("%d %B %Y",$objp->dateadh)."</a></td>\n";
|
||||
print '<td align="right">'.price($objp->cotisation).'</td>';
|
||||
$total+=price($objp->cotisation);
|
||||
/*
|
||||
if ($objp->societe != ''){
|
||||
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)." /<BR>".stripslashes($objp->societe)."</a></TD>\n";
|
||||
}else{
|
||||
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)."</a></TD>\n";
|
||||
}
|
||||
*/
|
||||
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)."</a></TD>\n";
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)."</a></TD>\n";
|
||||
if (defined("ADHERENT_BANK_USE") && ADHERENT_BANK_USE !=0){
|
||||
if ($objp->bank !='' ){
|
||||
print "<TD>Deposé</TD>";
|
||||
print "<td>Deposé</td>";
|
||||
}else{
|
||||
print "<TD>";
|
||||
print "<td>";
|
||||
print "<form method=\"post\" action=\"cotisations.php\">";
|
||||
print '<input type="hidden" name="action" value="2bank">';
|
||||
print '<input type="hidden" name="rowid" value="'.$objp->crowid.'">';
|
||||
print '<select name="operation">';
|
||||
print '<option value="CHQ" SELECTED>CHQ';
|
||||
print '<option value="CHQ" selected>CHQ';
|
||||
print '<option value="CB">CB';
|
||||
print '<option value="DEP">DEP';
|
||||
print '<option value="TIP">TIP';
|
||||
@ -228,7 +214,7 @@ if ($result)
|
||||
// print "<td><input name=\"credit\" type=\"text\" size=8></td>";
|
||||
print '<input type="submit" value="Dépot">';
|
||||
print "</form>\n";
|
||||
print "</TD>\n";
|
||||
print "</td>\n";
|
||||
}
|
||||
}
|
||||
print "</tr>";
|
||||
@ -250,8 +236,7 @@ if ($result)
|
||||
}
|
||||
else
|
||||
{
|
||||
print $sql;
|
||||
print $db->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -116,7 +116,7 @@ if ($rowid)
|
||||
if ($result) {
|
||||
$num = $db->num_rows();
|
||||
if ($num) {
|
||||
$obj = $db->fetch_object( 0);
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$total = $obj->total;
|
||||
}
|
||||
|
||||
@ -650,7 +650,7 @@ if ($result)
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td>".dolibarr_print_date($objp->dateadh)."</td>\n";
|
||||
|
||||
@ -64,7 +64,7 @@ if ($result)
|
||||
print "<HR>\n";
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$htpass=crypt($objp->pass,initialiser_sel());
|
||||
print $objp->login.":".$htpass."<BR>\n";
|
||||
$i++;
|
||||
|
||||
@ -70,7 +70,7 @@ if ($result)
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$AdherentsAll[$objp->libelle]=$objp->rowid;
|
||||
if ($objp->statut == -1) { $AdherentsAValider[$objp->libelle]=$objp->somme; }
|
||||
if ($objp->statut == 1) { $Adherents[$objp->libelle]=$objp->somme; }
|
||||
@ -93,7 +93,7 @@ if ($result)
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$Cotisants[$objp->libelle]=$objp->somme;
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ if ($result)
|
||||
}
|
||||
|
||||
if ($_GET["type"]) {
|
||||
$objp = $db->fetch_object(0);
|
||||
$objp = $db->fetch_object($result);
|
||||
$titre.=" (".$objp->type.")";
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ if ($result)
|
||||
{
|
||||
if ($_GET["type"] && $i==0) { # Fetch deja fait
|
||||
} else {
|
||||
$objp = $db->fetch_object($i);
|
||||
$objp = $db->fetch_object($result);
|
||||
}
|
||||
|
||||
$adh=new Adherent($db);
|
||||
|
||||
@ -109,7 +109,7 @@ if ($result)
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td>".$objp->rowid."</td>\n";
|
||||
|
||||
@ -245,8 +245,7 @@ function form_constantes($tableau){
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
//print '<td>Note</td>';
|
||||
print "<td>Action</td>";
|
||||
print '<td>'.$langs->trans("Action").'</td>';
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
|
||||
@ -254,7 +253,7 @@ function form_constantes($tableau){
|
||||
$sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const WHERE name='$const'";
|
||||
$result = $db->query($sql);
|
||||
if ($result && ($db->num_rows() == 1)) {
|
||||
$obj = $db->fetch_object(0);
|
||||
$obj = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
print '<form action="adherent.php" method="POST">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
@ -51,7 +51,7 @@ if ( $db->query($sql) )
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
|
||||
$livre = new Livre($db);
|
||||
if ($livre->fetch($objp->rowid))
|
||||
|
||||
@ -50,7 +50,7 @@ if ( $db->query($sql) )
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
|
||||
$livre = new Livre($db);
|
||||
if ($livre->fetch($objp->rowid))
|
||||
|
||||
@ -84,7 +84,7 @@ if ($result)
|
||||
while ($i < $num)
|
||||
{
|
||||
$var = ! $var;
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object($result);
|
||||
//print "pos ".$obj->position;
|
||||
$boxes[$obj->position][$obj->box_id]=1;
|
||||
$i++;
|
||||
@ -121,7 +121,7 @@ if ($result)
|
||||
while ($i < $num)
|
||||
{
|
||||
$var = ! $var;
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
print '<form action="boxes.php" method="POST">';
|
||||
print '<tr '.$bc[$var].'><td>'.$obj->name.'</td><td>' . $obj->file . '</td>';
|
||||
@ -171,7 +171,7 @@ if ($result)
|
||||
while ($i < $num)
|
||||
{
|
||||
$var = ! $var;
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
print '<tr '.$bc[$var].'><td>'.$obj->name.'</td>';
|
||||
print '<td> </td>';
|
||||
|
||||
@ -113,7 +113,7 @@ if ($result)
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
|
||||
print '<form action="compta.php" method="POST">';
|
||||
|
||||
@ -115,7 +115,7 @@ if ($result)
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
|
||||
print '<form action="const.php" method="POST">';
|
||||
|
||||
@ -148,7 +148,7 @@ if ($_POST["actionadd"]) {
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$obj = $db->fetch_object(0);
|
||||
$obj = $db->fetch_object($result);
|
||||
$newid=($obj->newid + 1);
|
||||
|
||||
} else {
|
||||
@ -369,7 +369,7 @@ if ($_GET["id"])
|
||||
// Lignes de valeurs
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object();
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var] class=\"value\">";
|
||||
|
||||
@ -42,8 +42,8 @@ if (!$user->admin)
|
||||
$def = array();
|
||||
|
||||
// positionne la variable pour le nombre de rss externes
|
||||
$db->query("select count(*) nb from ".MAIN_DB_PREFIX."const WHERE name like 'EXTERNAL_RSS_URLRSS_%'");
|
||||
$obj = $db->fetch_object(0);
|
||||
$result=$db->query("select count(*) nb from ".MAIN_DB_PREFIX."const WHERE name like 'EXTERNAL_RSS_URLRSS_%'");
|
||||
$obj = $db->fetch_object($result);
|
||||
$nbexternalrss = $obj->nb;
|
||||
|
||||
if ($_POST["action"] == 'add')
|
||||
|
||||
@ -74,7 +74,7 @@ if ( $db->query($sql) ) {
|
||||
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<TD>$objp->languages_id</TD>\n";
|
||||
|
||||
@ -70,7 +70,7 @@ if ($result)
|
||||
$old = "";
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
|
||||
if ($old <> $obj->module)
|
||||
|
||||
@ -39,11 +39,11 @@ print_barre_liste("Liste des tables", $page, "sqltables.php");
|
||||
|
||||
$sql = "SELECT name, loaded FROM ".MAIN_DB_PREFIX."sqltables";
|
||||
|
||||
print "<table class=\noboirder\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">";
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print '<tr class="liste_titre">';
|
||||
print "<td>Nom</td>";
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td align="center">Chargée</td>';
|
||||
print '<td align="center">Action</td>';
|
||||
print '<td align="center">'.$langs->trans("Action").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if ( $db->query($sql) ) {
|
||||
@ -52,7 +52,7 @@ if ( $db->query($sql) ) {
|
||||
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td>$objp->name</td>\n";
|
||||
|
||||
@ -55,7 +55,7 @@ if ($result)
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]><td>$obj->name</td>\n";
|
||||
|
||||
@ -67,7 +67,7 @@ if ($result)
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
if ($base==1)
|
||||
|
||||
@ -44,7 +44,7 @@ if ($result)
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result , $i);
|
||||
$obj = $db->fetch_object($result);
|
||||
$row[$i][0] = $obj->rowid ;
|
||||
$row[$i][1] = $obj->fk_facture;
|
||||
$row[$i][2] = $obj->amount;
|
||||
|
||||
@ -83,7 +83,7 @@ class Auteur {
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($i);
|
||||
$obj = $this->db->fetch_object();
|
||||
|
||||
$ga[$obj->rowid] = $obj->nom;
|
||||
$i++;
|
||||
|
||||
@ -46,26 +46,26 @@ $sql .= $db->plimit( $limit ,$offset);
|
||||
if ( $db->query($sql) ) {
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print "<TR class=\"liste_titre\"><td>";
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\"><td>";
|
||||
print_liste_field_titre("Nom","index.php", "e.nom");
|
||||
print "</td>";
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<TD width='70%'><a href=\"fiche.php?id=$objp->rowid\">$objp->nom</a></TD>\n";
|
||||
print "</TR>\n";
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td width='70%'><a href=\"fiche.php?id=$objp->rowid\">$objp->nom</a></td>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</TABLE>";
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -73,34 +73,34 @@ if ($action == 'update' && !$cancel) {
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
print '<p><TABLE border="0" width="50%" cellspacing="0" cellpadding="4">';
|
||||
print "<TR class=\"liste_titre\"><td>Commandes</td>";
|
||||
print '<table class="noborder" width="50%">';
|
||||
print "<tr class=\"liste_titre\"><td>Commandes</td>";
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/boutique/commande/fiche.php?id='.$objp->orders_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Fiche"></a> ';
|
||||
|
||||
print "<a href=\"".DOL_URL_ROOT."/boutique/commande/fiche.php?id=$objp->orders_id\">".strftime("%d %B %Y",$objp->date_purchased)."</a></TD>\n";
|
||||
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</TABLE>";
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Fetch failed";
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
@ -117,14 +117,7 @@ if ($action == 'update' && !$cancel) {
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
print '<br><table width="100%" border="1" cellspacing="0" cellpadding="3">';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '</table><br>';
|
||||
|
||||
// Pas d'action
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -22,6 +22,8 @@
|
||||
|
||||
require("./pre.inc.php");
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
llxHeader();
|
||||
|
||||
if ($sortfield == "") {
|
||||
@ -47,32 +49,32 @@ if ( $db->query($sql) )
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print "<TR class=\"liste_titre\"><td>";
|
||||
print_liste_field_titre("Prénom","index.php", "c.customers_firstname");
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\"><td>";
|
||||
print_liste_field_titre($langs->trans("Firstname"),"index.php", "c.customers_firstname");
|
||||
print "</td><td>";
|
||||
print_liste_field_titre("Nom","index.php", "c.customers_lastname");
|
||||
print '</td><td>Email</td><td align="center">Newsletter</td>';
|
||||
print "</TR>\n";
|
||||
print_liste_field_titre($langs->trans("Lastname"),"index.php", "c.customers_lastname");
|
||||
print '</td><td>'.$langs->trans("EMail").'</td><td align="center">Newsletter</td>';
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print '<TD><a href="fiche.php?id='.$objp->customers_id.'">'.$objp->customers_firstname."</a></TD>\n";
|
||||
print '<TD><a href="fiche.php?id='.$objp->customers_id.'">'.$objp->customers_lastname."</a></TD>\n";
|
||||
print "<TD>$objp->customers_email_address</TD>\n";
|
||||
print "<TD align=\"center\">$objp->customers_newsletter</TD>\n";
|
||||
print "</TR>\n";
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="fiche.php?id='.$objp->customers_id.'">'.$objp->customers_firstname."</a></TD>\n";
|
||||
print '<td><a href="fiche.php?id='.$objp->customers_id.'">'.$objp->customers_lastname."</a></TD>\n";
|
||||
print "<td>$objp->customers_email_address</TD>\n";
|
||||
print "<td align=\"center\">$objp->customers_newsletter</TD>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</TABLE>";
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -55,7 +55,7 @@ if ( $db->query($sql) )
|
||||
$var=True;
|
||||
if ($num > 0)
|
||||
{
|
||||
$objp = $db->fetch_object(0);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>Somme des commandes</td>';
|
||||
@ -69,7 +69,7 @@ if ( $db->query($sql) )
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
$sql = "SELECT sum(t.value) as value";
|
||||
@ -83,7 +83,7 @@ if ( $db->query($sql) )
|
||||
$var=True;
|
||||
if ($num > 0)
|
||||
{
|
||||
$objp = $db->fetch_object(0);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>Somme des frais de port</td>';
|
||||
@ -95,7 +95,7 @@ if ( $db->query($sql) )
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
|
||||
require("./pre.inc.php");
|
||||
|
||||
$langs->load("products");
|
||||
|
||||
llxHeader();
|
||||
|
||||
/*
|
||||
@ -70,30 +72,30 @@ if ($id)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
print '<table border="0" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr class="liste_titre"><td align="left" width="40%">Produits</td>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td align="left" width="40%">'.$langs->trans("Products").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Number").'</td><td align="right">'.$langs->trans("Price").'</td><td align="right">Prix final</td>';
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td align="left" width="40%">';
|
||||
print '<a href="fiche.php?id='.$objp->rowid.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" width="16" height="16" alt="Fiche livre"></a>';
|
||||
|
||||
print '<a href="fiche.php?id='.$objp->rowid.'">'.$objp->products_name.'</a>';
|
||||
print "</td>";
|
||||
|
||||
print '<TD align="center"><a href="fiche.php?id='.$objp->rowid."\">$objp->products_quantity</a></TD>\n";
|
||||
print "<TD align=\"right\"><a href=\"fiche.php?id=$objp->rowid\">".price($objp->products_price)."</a></TD>\n";
|
||||
print "<TD align=\"right\"><a href=\"fiche.php?id=$objp->rowid\">".price($objp->final_price)."</a></TD>\n";
|
||||
print '<td align="center"><a href="fiche.php?id='.$objp->rowid."\">$objp->products_quantity</a></TD>\n";
|
||||
print "<td align=\"right\"><a href=\"fiche.php?id=$objp->rowid\">".price($objp->products_price)."</a></TD>\n";
|
||||
print "<td align=\"right\"><a href=\"fiche.php?id=$objp->rowid\">".price($objp->final_price)."</a></TD>\n";
|
||||
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</TABLE>";
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
|
||||
@ -59,7 +59,7 @@ if ( $db->query($sql) )
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
@ -76,7 +76,7 @@ if ( $db->query($sql) )
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -70,7 +70,7 @@ class Editeur {
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($i);
|
||||
$obj = $this->db->fetch_object();
|
||||
|
||||
$ga[$obj->rowid] = $obj->nom;
|
||||
$i++;
|
||||
@ -152,7 +152,7 @@ class Editeur {
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($i);
|
||||
$obj = $this->db->fetch_object();
|
||||
|
||||
$ga[$obj->rowid] = $obj->title;
|
||||
$i++;
|
||||
|
||||
@ -46,18 +46,18 @@ $sql .= $db->plimit( $limit ,$offset);
|
||||
if ( $db->query($sql) ) {
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print "<TR class=\"liste_titre\"><td>";
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\"><td>";
|
||||
print_liste_field_titre("Nom","index.php", "e.nom");
|
||||
print "</td>";
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<TD width='70%'><a href=\"fiche.php?id=$objp->rowid\">$objp->nom</a></TD>\n";
|
||||
print "</TR>\n";
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td width='70%'><a href=\"fiche.php?id=$objp->rowid\">$objp->nom</a></td>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</TABLE>";
|
||||
|
||||
@ -61,19 +61,19 @@ if ( $db->query($sql) )
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
print "<p><table class=\"noborder\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print "<TR class=\"liste_titre\"><td>";
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\"><td>";
|
||||
print_liste_field_titre($langs->trans("Ref"),"index.php", "l.ref");
|
||||
print "</td><td>";
|
||||
print_liste_field_titre("Titre","index.php", "l.title");
|
||||
print "</td>";
|
||||
print '<td colspan="3"> </td>';
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print '<td><a href="fiche.php?id='.$objp->rowid.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Fiche livre"></a> ';
|
||||
|
||||
@ -85,7 +85,7 @@ if ( $db->query($sql) )
|
||||
{
|
||||
print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_green.png" border="0"></a></td>';
|
||||
print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_red_light.png" border="0"></a></td>';
|
||||
print '<TD align="right"><a href="'.OSC_CATALOG_URL.'product_info.php?products_id='.$objp->oscid.'">Fiche en ligne</a></TD>';
|
||||
print '<td align="right"><a href="'.OSC_CATALOG_URL.'product_info.php?products_id='.$objp->oscid.'">Fiche en ligne</a></TD>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -94,15 +94,15 @@ if ( $db->query($sql) )
|
||||
print '<td> </td>';
|
||||
}
|
||||
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</TABLE>";
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -145,7 +145,7 @@ class Livre {
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($i);
|
||||
$obj = $this->db->fetch_object();
|
||||
|
||||
$ga[$obj->rowid] = $obj->nom;
|
||||
$i++;
|
||||
@ -247,7 +247,7 @@ class Livre {
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($i);
|
||||
$obj = $this->db->fetch_object();
|
||||
$pcat[$i] = $obj->categories_id;
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -60,33 +60,33 @@ if ( $db->query($sql) )
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print "<TR class=\"liste_titre\"><td>";
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\"><td>";
|
||||
print_liste_field_titre($langs->trans("Ref"),"vignettes.php", "l.ref");
|
||||
print "</td><td>";
|
||||
print_liste_field_titre("Titre","vignettes.php", "l.title");
|
||||
print "</td>";
|
||||
print '<td colspan="3"> </td>';
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
|
||||
if(! file_exists(OSC_CATALOG_DIRECTORY."images/".$objp->ref.".jpg"))
|
||||
{
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="fiche.php?id='.$objp->rowid.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Fiche livre"></a> ';
|
||||
|
||||
print "<a href=\"fiche.php?id=$objp->rowid\">$objp->ref</a></TD>\n";
|
||||
print "<TD width='70%'><a href=\"fiche.php?id=$objp->rowid\">$objp->title</a></TD>\n";
|
||||
print "<td width='70%'><a href=\"fiche.php?id=$objp->rowid\">$objp->title</a></TD>\n";
|
||||
|
||||
|
||||
if ($objp->status == 1)
|
||||
{
|
||||
print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_green.png" border="0"></a></td>';
|
||||
print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_red_light.png" border="0"></a></td>';
|
||||
print '<TD align="right"><a href="'.OSC_CATALOG_URL.'product_info.php?products_id='.$objp->oscid.'">Fiche en ligne</a></TD>';
|
||||
print '<td align="right"><a href="'.OSC_CATALOG_URL.'product_info.php?products_id='.$objp->oscid.'">Fiche en ligne</a></TD>';
|
||||
|
||||
}
|
||||
else
|
||||
@ -96,17 +96,17 @@ if ( $db->query($sql) )
|
||||
print '<td> </td>';
|
||||
}
|
||||
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
print "</TABLE>";
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -21,9 +21,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*! \file htdocs/boutique/newsletter/fiche.php
|
||||
\ingroup boutique
|
||||
\brief Fiche newsletter
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
|
||||
if ($action == 'add') {
|
||||
if ($_POST["action"] == 'add') {
|
||||
$newsletter = new Newsletter($db);
|
||||
|
||||
$newsletter->email_subject = $_POST["email_subject"];
|
||||
@ -35,13 +41,13 @@ if ($action == 'add') {
|
||||
$id = $newsletter->create($user);
|
||||
}
|
||||
|
||||
if ($action == 'addga') {
|
||||
if ($_POST["action"] == 'addga') {
|
||||
$newsletter = new Newsletter($db);
|
||||
|
||||
$newsletter->linkga($id, $ga);
|
||||
}
|
||||
|
||||
if ($action == 'update' && !$cancel)
|
||||
if ($_POST["action"] == 'update' && !$cancel)
|
||||
{
|
||||
$newsletter = new Newsletter($db);
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ if ( $db->query($sql) )
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
print "<table class=\"noborder\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">";
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\"><td>";
|
||||
print_liste_field_titre("Sujet","index.php", "email_subject");
|
||||
print "</td>";
|
||||
@ -57,7 +57,7 @@ if ( $db->query($sql) )
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
|
||||
@ -151,7 +151,7 @@ class Newsletter {
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($i);
|
||||
$obj = $this->db->fetch_object();
|
||||
|
||||
$ga[$obj->rowid] = $obj->nom;
|
||||
$i++;
|
||||
|
||||
@ -51,29 +51,29 @@ if ( $db->query($sql) )
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print "<TR class=\"liste_titre\"><td>";
|
||||
print "<table class=\noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\"><td>";
|
||||
print_liste_field_titre("Client","index.php", "c.customers_lastname");
|
||||
print "</td>";
|
||||
print "<td>Produit</td>";
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<TD width='70%'><a href=\"fiche.php?id=$objp->rowid\">$objp->customers_firstname $objp->customers_lastname</a></TD>\n";
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td width='70%'><a href=\"fiche.php?id=$objp->rowid\">$objp->customers_firstname $objp->customers_lastname</a></TD>\n";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/boutique/livre/fiche.php?oscid='.$objp->products_id.'">'.$objp->products_name."</a></td>";
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</TABLE>";
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -70,7 +70,7 @@ class Editeur {
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($i);
|
||||
$obj = $this->db->fetch_object();
|
||||
|
||||
$ga[$obj->rowid] = $obj->nom;
|
||||
$i++;
|
||||
|
||||
@ -59,7 +59,7 @@ if ( $db->query($sql) )
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
|
||||
|
||||
@ -159,7 +159,7 @@ if ( $db->query($sql) )
|
||||
print_barre_liste("Liste des actions commerciales réalisées ou à faire", $page, "index.php",'',$sortfield,$sortorder,'',$num);
|
||||
}
|
||||
$i = 0;
|
||||
print "<table class=\"noborder\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">";
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4">'.$langs->trans("Date").'</td>';
|
||||
print '<td>Avancement</td>';
|
||||
@ -168,10 +168,10 @@ if ( $db->query($sql) )
|
||||
print '<td>Contact</Td>';
|
||||
print "<td>".$langs->trans("Comments")."</td><td>".$langs->trans("Author")."</td>";
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
$var=true;
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
|
||||
$var=!$var;
|
||||
|
||||
|
||||
@ -156,16 +156,16 @@ if ( $db->query($sql) )
|
||||
print '<td align="center">Date</td>';
|
||||
print '<td align="center">Taille</td>';
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
$var=true;
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
|
||||
$var=!$var;
|
||||
|
||||
print "<TR $bc[$var]>";
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print "<td>$obj->df</TD>\n";
|
||||
print "<td>$obj->df</td>\n";
|
||||
print '<td align="center">'.$obj->cc.'</td>';
|
||||
|
||||
print '<td><a href="index.php?action=pdf&month='.$obj->month.'&year='.$obj->year.'">'.img_file_new().'</a></td>';
|
||||
|
||||
@ -153,7 +153,7 @@ class CommActionRapport {
|
||||
$y2 = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($i);
|
||||
$obj = $this->db->fetch_object();
|
||||
$y = max($pdf->GetY(), $y1, $y2) + 1;
|
||||
$pdf->SetFont('Arial','',10);
|
||||
|
||||
|
||||
@ -23,6 +23,9 @@
|
||||
require("./pre.inc.php");
|
||||
require("./propal_model_pdf.class.php");
|
||||
|
||||
$langs->load("projects");
|
||||
|
||||
|
||||
$user->getrights('propale');
|
||||
$user->getrights('fichinter');
|
||||
$user->getrights('commande');
|
||||
@ -112,7 +115,7 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
while ($i < $numdest)
|
||||
{
|
||||
$contact = $db->fetch_object( $i);
|
||||
$contact = $db->fetch_object();
|
||||
print '<option value="'.$contact->idp.'"';
|
||||
if ($contact->idp == $setcontact)
|
||||
{
|
||||
@ -159,7 +162,7 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
while ($i < $numprojet)
|
||||
{
|
||||
$projet = $db->fetch_object($i);
|
||||
$projet = $db->fetch_object();
|
||||
print "<option value=\"$projet->rowid\">$projet->title</option>";
|
||||
$i++;
|
||||
}
|
||||
@ -169,7 +172,7 @@ if ($_GET["action"] == 'create')
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error()."$sql";
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
@ -191,13 +194,13 @@ if ($_GET["action"] == 'create')
|
||||
$sql .= " ORDER BY ref DESC";
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
$opt = "<option value=\"0\" SELECTED></option>";
|
||||
$opt = "<option value=\"0\" selected></option>";
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows(); $i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$opt .= "<option value=\"$objp->rowid\">[$objp->ref] ".substr($objp->label,0,40)."</option>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -211,7 +214,7 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
print_titre("Services/Produits");
|
||||
|
||||
print '<table class="border" cellspacing="0" cellpadding="3">';
|
||||
print '<table class="border">';
|
||||
print '<tr><td>Produit</td><td>Quan.</td><td>Remise</td></tr>';
|
||||
for ($i = 1 ; $i <= PROPALE_NEW_FORM_NB_PRODUCT ; $i++)
|
||||
{
|
||||
|
||||
@ -79,7 +79,7 @@ if ( $db->query($sql) )
|
||||
{
|
||||
$sortorder="DESC";
|
||||
}
|
||||
print "<p><table class=\"noborder\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">";
|
||||
print "<p><table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print "<td> </td>";
|
||||
print "<td align=\"center\"><a href=\"index.php?sortfield=idp&sortorder=$sortorder&begin=$begin\">Id</a></td>";
|
||||
@ -94,7 +94,7 @@ if ( $db->query($sql) )
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
|
||||
$var=!$var;
|
||||
$bc1="bgcolor=\"#90c090\"";
|
||||
@ -107,24 +107,24 @@ if ( $db->query($sql) )
|
||||
{
|
||||
$bc=$bc2;
|
||||
}
|
||||
print "<TR $bc>";
|
||||
print "<TD>" . ($i + 1 + ($limit * $page)) . "</TD>";
|
||||
print "<TD align=\"center\"><b>$obj->idp</b></TD>";
|
||||
print "<TD><a href=\"index.php?socid=$obj->idp\">$obj->nom</A></TD>\n";
|
||||
print "<tr $bc>";
|
||||
print "<td>" . ($i + 1 + ($limit * $page)) . "</td>";
|
||||
print "<td align=\"center\"><b>$obj->idp</b></td>";
|
||||
print "<td><a href=\"index.php?socid=$obj->idp\">$obj->nom</A></td>\n";
|
||||
|
||||
print "<TD align=\"center\">$obj->stcomm</TD>\n";
|
||||
print "<TD>$obj->author</TD>\n";
|
||||
print "<td align=\"center\">$obj->stcomm</td>\n";
|
||||
print "<td>$obj->author</TD>\n";
|
||||
print "<td>".strftime("%d %b %Y %H:%M", $obj->dateb) ."</td>";
|
||||
print "<TD>[<a href=\"bookmark.php?action=delete&bid=$obj->bid\">Delete</A>]</TD>\n";
|
||||
print "</TR>\n";
|
||||
print "<td>[<a href=\"bookmark.php?action=delete&bid=$obj->bid\">Delete</A>]</TD>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</TABLE>";
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error();
|
||||
dolibarr_print_error()$db;
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -85,21 +85,12 @@ if ($sortfield == "")
|
||||
|
||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset);
|
||||
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
/*
|
||||
if ($num == 1)
|
||||
{
|
||||
$obj = $db->fetch_object(0);
|
||||
Header("Location: fiche.php?socid=$obj->idp");
|
||||
}
|
||||
else
|
||||
{
|
||||
llxHeader();
|
||||
}
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
|
||||
@ -149,7 +140,7 @@ if ($result)
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$var=!$var;
|
||||
|
||||
|
||||
@ -23,6 +23,8 @@
|
||||
*/
|
||||
require("./pre.inc.php");
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
$user->getrights('propale');
|
||||
$user->getrights('fichinter');
|
||||
$user->getrights('commande');
|
||||
@ -130,7 +132,7 @@ if ($result)
|
||||
|
||||
print_barre_liste("Liste des contacts $label",$page, "contact.php", "&type=$type",$sortfield,$sortorder,"",$num);
|
||||
|
||||
print "<DIV align=\"center\">";
|
||||
print "<div align=\"center\">";
|
||||
|
||||
print "| <A href=\"contact.php?type=$type&page=$pageprev&stcomm=$stcomm&sortfield=$sortfield&sortorder=$sortorder&aclasser=$aclasser&coord=$coord\">*</A>\n| ";
|
||||
for ($i = 65 ; $i < 91; $i++) {
|
||||
@ -159,45 +161,43 @@ if ($result)
|
||||
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr class="liste_titre"><td>';
|
||||
print_liste_field_titre("Nom","contact.php","lower(p.name)", $begin,"&type=$type");
|
||||
print_liste_field_titre($langs->trans("Lastname"),"contact.php","lower(p.name)", $begin,"&type=$type");
|
||||
print "</td><td>";
|
||||
print_liste_field_titre("Prénom","contact.php","lower(p.firstname)", $begin,"&type=$type");
|
||||
print_liste_field_titre($langs->trans("Firstname"),"contact.php","lower(p.firstname)", $begin,"&type=$type");
|
||||
print "</td><td>";
|
||||
print_liste_field_titre("Société","contact.php","lower(s.nom)", $begin,"&type=$type");
|
||||
print "</td><TD>email</TD>";
|
||||
print '<td>Téléphone</td>';
|
||||
print_liste_field_titre($langs->trans("Company"),"contact.php","lower(s.nom)", $begin,"&type=$type");
|
||||
print '</td><td>'.$langs->trans("Lastname").'</td>';
|
||||
print '<td>'.$langs->trans("Phone").'</td>';
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
$i = 0;
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
|
||||
$var=!$var;
|
||||
|
||||
print "<TR $bc[$var]>";
|
||||
print '<TD><a href="'.DOL_URL_ROOT.'/comm/people.php?contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.img_file();
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/people.php?contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.img_file();
|
||||
print '</a> <a href="'.DOL_URL_ROOT.'/comm/people.php?contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->name.'</a></td>';
|
||||
print "<TD>$obj->firstname</TD>";
|
||||
print "<td>$obj->firstname</TD>";
|
||||
|
||||
print '<TD><a href="contact.php?type='.$type.'&socid='.$obj->idp.'"><img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/filter.png" border="0" alt="filtrer"></a> ';
|
||||
print '<td><a href="contact.php?type='.$type.'&socid='.$obj->idp.'"><img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/filter.png" border="0" alt="filtrer"></a> ';
|
||||
print "<a href=\"".$urlfiche."?socid=$obj->idp\">$obj->nom</A></td>\n";
|
||||
|
||||
print '<td><a href="action/fiche.php?action=create&actionid=4&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->email.'</a> </td>';
|
||||
|
||||
print '<td><a href="action/fiche.php?action=create&actionid=1&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.dolibarr_print_phone($obj->phone).'</a> </td>';
|
||||
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</TABLE></p>";
|
||||
print "</table></p>";
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print_barre_liste("Liste des contacts $label",$page, "contact.php");
|
||||
|
||||
print $db->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -98,7 +98,7 @@ if ($mode == 'search') {
|
||||
|
||||
if ( $db->query($sql) ) {
|
||||
if ( $db->num_rows() == 1) {
|
||||
$obj = $db->fetch_object(0);
|
||||
$obj = $db->fetch_object();
|
||||
$socid = $obj->idp;
|
||||
}
|
||||
$db->free();
|
||||
@ -269,7 +269,7 @@ if ($_socid > 0)
|
||||
$i = 0; $now = time(); $lim = 3600 * 24 * 15 ;
|
||||
while ($i < $num && $i < 2)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td><a href=\"propal.php?propalid=$objp->propalid\">$objp->ref</a>\n";
|
||||
if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 )
|
||||
@ -307,7 +307,7 @@ if ($_socid > 0)
|
||||
$i = 0; $now = time(); $lim = 3600 * 24 * 15 ;
|
||||
while ($i < $num && $i < 2)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$objp->propalid.'">'.$objp->ref."</a>\n";
|
||||
@ -339,7 +339,7 @@ if ($_socid > 0)
|
||||
print "<td colspan=\"2\"><a href=\"../projet/index.php?socidp=$objsoc->id\">liste des projets ($num)</td></tr>";
|
||||
}
|
||||
while ($i < $num && $i < 5) {
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$tag = !$tag;
|
||||
print "<tr $bc[$tag]>";
|
||||
print '<td><a href="../projet/fiche.php?id='.$obj->rowid.'">'.$obj->title.'</a></td>';
|
||||
@ -426,7 +426,7 @@ if ($_socid > 0)
|
||||
$i = 0 ; $num = $db->num_rows(); $tag = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var = !$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
@ -486,7 +486,7 @@ if ($_socid > 0)
|
||||
while ($i < $num) {
|
||||
$var = !$var;
|
||||
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
if ($oldyear == strftime("%Y",$obj->da) )
|
||||
@ -578,7 +578,7 @@ if ($_socid > 0)
|
||||
{
|
||||
$var = !$var;
|
||||
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
if ($oldyear == strftime("%Y",$obj->da) )
|
||||
|
||||
@ -109,7 +109,7 @@ if ($conf->propal->enabled) {
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td><a href=\"propal.php?propalid=".$obj->rowid."\">".$obj->ref."</a></td></tr>";
|
||||
$i++;
|
||||
@ -144,7 +144,7 @@ if ($conf->commande->enabled)
|
||||
$var = False;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object();
|
||||
print "<tr $bc[$var]><td width=\"20%\"><a href=\"../commande/fiche.php?id=$obj->rowid\">$obj->ref</a></td>";
|
||||
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td></tr>';
|
||||
$i++;
|
||||
@ -184,7 +184,7 @@ if ( $db->query($sql) )
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var = !$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td>';
|
||||
@ -225,7 +225,7 @@ if ( $db->query($sql) )
|
||||
|
||||
while ($i < $num )
|
||||
{
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object();
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
@ -272,7 +272,7 @@ if ( $db->query($sql) )
|
||||
|
||||
while ($i < $num )
|
||||
{
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object();
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
@ -332,7 +332,7 @@ if ($conf->contrat->enabled)
|
||||
$var=false;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
print "<tr $bc[$var]><td><a href=\"../contrat/fiche.php?id=".$obj->rowid."\">".img_file()."</a> ";
|
||||
print "<a href=\"../contrat/fiche.php?id=".$obj->rowid."\">".$obj->ref."</a></td>";
|
||||
print "<td><a href=\"fiche.php?socid=$obj->idp\">$obj->nom</a></td>\n";
|
||||
@ -375,7 +375,7 @@ if ($conf->propal->enabled) {
|
||||
$var=false;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
print "<tr $bc[$var]><td width=\"15%\"><a href=\"propal.php?propalid=".$obj->propalid."\">".img_file()."</a> ";
|
||||
print "<a href=\"propal.php?propalid=".$obj->propalid."\">".$obj->ref."</a></td>";
|
||||
print "<td width=\"30%\"><a href=\"fiche.php?socid=$obj->idp\">$obj->nom</a></td>\n";
|
||||
@ -417,7 +417,7 @@ if ($conf->propal->enabled) {
|
||||
$var=False;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td width="15%">';
|
||||
print '<a href="propal.php?propalid='.$objp->propalid.'">'.img_file().'</a>';
|
||||
|
||||
@ -86,7 +86,7 @@ if ($_GET["socid"] > 0)
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$objsoc = $db->fetch_object( 0);
|
||||
$objsoc = $db->fetch_object($result);
|
||||
|
||||
/*
|
||||
*
|
||||
@ -130,7 +130,7 @@ if ($_GET["socid"] > 0)
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
print "<tr>";
|
||||
print "<td>$obj->firstname $obj->name</td>";
|
||||
print "<td>$obj->poste </td>";
|
||||
@ -171,7 +171,7 @@ if ($_GET["socid"] > 0)
|
||||
|
||||
if ( $num >0 )
|
||||
{
|
||||
$obj = $db->fetch_object( 0);
|
||||
$obj = $db->fetch_object();
|
||||
}
|
||||
|
||||
print "<form method=\"post\" action=\"people.php?socid=$socid\">";
|
||||
@ -227,7 +227,7 @@ if ($_GET["socid"] > 0)
|
||||
$i = 0 ; $num = $db->num_rows(); $tag = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
|
||||
@ -275,7 +275,7 @@ if ($_GET["propalid"])
|
||||
|
||||
if ( $result )
|
||||
{
|
||||
$obj = $db->fetch_object( 0 );
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
if ($db->num_rows())
|
||||
{
|
||||
@ -416,7 +416,7 @@ if ($_GET["propalid"])
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<td>[$objp->ref]</td>\n";
|
||||
@ -446,7 +446,7 @@ if ($_GET["propalid"])
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]><td> </td>\n";
|
||||
print '<td>'.$objp->description.'</td>';
|
||||
@ -473,15 +473,14 @@ if ($_GET["propalid"])
|
||||
{
|
||||
$sql = "SELECT p.rowid,p.label,p.ref,p.price FROM ".MAIN_DB_PREFIX."product as p WHERE p.envente=1 ORDER BY p.nbvente DESC LIMIT 20";
|
||||
// RyXéo on a ORDER BY p.ref et pas de limit
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
$opt = "<option value=\"0\" SELECTED></option>";
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$opt = "<option value=\"0\" selected></option>";
|
||||
$num = $db->num_rows(); $i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$opt .= "<option value=\"$objp->rowid\">[$objp->ref] ".substr($objp->label,0,40)."</option>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -743,12 +742,12 @@ if ($_GET["propalid"])
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
print "<TR><TD>".strftime("%d %B %Y %H:%M:%S",$objp->da)."</TD>\n";
|
||||
$objp = $db->fetch_object();
|
||||
print "<tr><td>".strftime("%d %B %Y %H:%M:%S",$objp->da)."</td>\n";
|
||||
$authoract = new User($db);
|
||||
$authoract->id = $objp->fk_user_author;
|
||||
$authoract->fetch('');
|
||||
print "<TD>$authoract->code</TD></tr>\n";
|
||||
print "<td>$authoract->code</td></tr>\n";
|
||||
print "<tr><td colspan=\"2\">$objp->note</td></tr>";
|
||||
$i++;
|
||||
}
|
||||
@ -899,11 +898,11 @@ if ($_GET["propalid"])
|
||||
|
||||
print_liste_field_titre_new ($langs->trans("Status"),"propal.php","p.fk_statut","","&socidp=$socidp&viewstatut=$viewstatut",'width="10%" align="center"',$sortfield);
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
$var=true;
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$now = time();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
@ -930,7 +929,7 @@ if ($_GET["propalid"])
|
||||
print "<td> </td>";
|
||||
}
|
||||
|
||||
print "<TD align=\"right\">";
|
||||
print "<td align=\"right\">";
|
||||
$y = strftime("%Y",$objp->dp);
|
||||
$m = strftime("%m",$objp->dp);
|
||||
|
||||
@ -940,9 +939,9 @@ if ($_GET["propalid"])
|
||||
print " <a href=\"propal.php?year=$y\">";
|
||||
print strftime("%Y",$objp->dp)."</a></TD>\n";
|
||||
|
||||
print "<TD align=\"right\">".price($objp->price)."</TD>\n";
|
||||
print "<TD align=\"center\">$objp->statut</TD>\n";
|
||||
print "</TR>\n";
|
||||
print "<td align=\"right\">".price($objp->price)."</td>\n";
|
||||
print "<td align=\"center\">$objp->statut</td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
$total = $total + $objp->price;
|
||||
$subtotal = $subtotal + $objp->price;
|
||||
|
||||
@ -49,7 +49,7 @@ class Propal_Model_Pdf {
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($i);
|
||||
$obj = $this->db->fetch_object();
|
||||
|
||||
$projets[$obj->nom] = $obj->nom;
|
||||
$i++;
|
||||
|
||||
@ -183,7 +183,7 @@ if ($socid > 0)
|
||||
$i = 0; $now = time(); $lim = 3600 * 24 * 15 ;
|
||||
while ($i < $num && $i < 2)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td><a href=\"../propal.php?propalid=$objp->propalid\">";
|
||||
print img_file();
|
||||
@ -245,7 +245,7 @@ if ($socid > 0)
|
||||
$i = 0 ; $num = $db->num_rows(); $tag = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object($result);
|
||||
$var = !$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
@ -306,7 +306,7 @@ if ($socid > 0)
|
||||
while ($i < $num) {
|
||||
$var = !$var;
|
||||
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
@ -398,12 +398,12 @@ if ($socid > 0)
|
||||
if ($num)
|
||||
{
|
||||
|
||||
print '<table width="100%" cellspacing="0" border="0" cellpadding="2">';
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre"><td><a href="action/index.php?socid='.$socid.'">Actions effectuées</a></td></tr>';
|
||||
print '<tr>';
|
||||
print '<td valign="top">';
|
||||
|
||||
print '<table width="100%" cellspacing="0" border="0" cellpadding="1">';
|
||||
print '<table width="100%" border="0">';
|
||||
|
||||
$oldyear='';
|
||||
$oldmonth='';
|
||||
@ -411,7 +411,7 @@ if ($socid > 0)
|
||||
{
|
||||
$var = !$var;
|
||||
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
if ($oldyear == strftime("%Y",$obj->da) )
|
||||
@ -430,12 +430,12 @@ if ($socid > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<TD align=\"center\">" .strftime("%b",$obj->da)."</TD>\n";
|
||||
print "<td align=\"center\">" .strftime("%b",$obj->da)."</TD>\n";
|
||||
$oldmonth = strftime("%Y%b",$obj->da);
|
||||
}
|
||||
|
||||
print "<TD>" .strftime("%d",$obj->da)."</TD>\n";
|
||||
print "<TD>" .strftime("%H:%M",$obj->da)."</TD>\n";
|
||||
print "<td>" .strftime("%d",$obj->da)."</td>\n";
|
||||
print "<td>" .strftime("%H:%M",$obj->da)."</td>\n";
|
||||
|
||||
print '<td width="10%"> </td>';
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ if ( $db->query($sql) )
|
||||
print '<td colspan="2">Prospects par statut</td></tr>';
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td><a href=\"prospects.php?page=0&stcomm=".$obj->id."\">".$obj->libelle."</a></td><td>".$obj->cc."</td></tr>";
|
||||
$i++;
|
||||
@ -113,7 +113,7 @@ if ($conf->propal->enabled)
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td><a href=\"propal.php?propalid=".$obj->rowid."\">".$obj->ref."</a></td></tr>";
|
||||
$i++;
|
||||
@ -147,7 +147,7 @@ if ( $db->query($sql) )
|
||||
$i = 0;
|
||||
while ($i < $num )
|
||||
{
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object();
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]><td>".strftime("%d %b %Y",$obj->da)."</td>";
|
||||
@ -185,7 +185,7 @@ if ( $db->query($sql) )
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td width=\"20%\"><a href=\"../propal.php?propalid=".$obj->rowid."\">";
|
||||
print img_file();
|
||||
@ -221,7 +221,7 @@ if ( $db->query($sql) )
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td width=\"12%\"><a href=\"../propal.php?propalid=".$obj->rowid."\">";
|
||||
print img_file();
|
||||
|
||||
@ -112,7 +112,7 @@ if ($result)
|
||||
|
||||
if ($num == 1 && $socname)
|
||||
{
|
||||
$obj = $db->fetch_object(0);
|
||||
$obj = $db->fetch_object($result);
|
||||
Header("Location: fiche.php?socid=$obj->idp");
|
||||
}
|
||||
else
|
||||
@ -144,9 +144,9 @@ if ($result)
|
||||
|
||||
$i = 0;
|
||||
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<TR class="liste_titre">';
|
||||
print "<TD valign=\"center\">";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print "<td valign=\"center\">";
|
||||
print_liste_field_titre("Société","prospects.php","s.nom");
|
||||
print "</td><td>";
|
||||
print_liste_field_titre("Ville","prospects.php","s.ville");
|
||||
@ -158,12 +158,12 @@ if ($result)
|
||||
print "</td><td>";
|
||||
print_liste_field_titre("Insertion","prospects.php","s.datec");
|
||||
print '</td><td colspan="4"> </td>';
|
||||
print "</TR>\n";
|
||||
$var=True;
|
||||
print "</tr>\n";
|
||||
$var=true;
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
|
||||
$var=!$var;
|
||||
|
||||
@ -171,13 +171,13 @@ if ($result)
|
||||
print '<td width="35%"><a href="fiche.php?id='.$obj->idp.'">';
|
||||
print img_file();
|
||||
print "</a> <a href=\"fiche.php?id=$obj->idp\">$obj->nom</A></td>\n";
|
||||
print "<TD>".$obj->ville." </TD>\n";
|
||||
print "<TD align=\"center\">$obj->departement</TD>\n";
|
||||
print "<td>".$obj->ville." </td>\n";
|
||||
print "<td align=\"center\">$obj->departement</td>\n";
|
||||
print "<td>".$obj->stcomm."</td>\n";
|
||||
|
||||
if ($user->societe_id == 0)
|
||||
{
|
||||
print "<TD align=\"center\"><a href=\"addpropal.php?socidp=$obj->idp&action=create\">".strftime("%d/%b/%y",$obj->datec)."</A></td>\n";
|
||||
print "<td align=\"center\"><a href=\"addpropal.php?socidp=$obj->idp&action=create\">".strftime("%d/%b/%y",$obj->datec)."</A></td>\n";
|
||||
|
||||
}
|
||||
else
|
||||
@ -200,15 +200,15 @@ if ($result)
|
||||
}
|
||||
}
|
||||
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</TABLE>";
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error() . ' ' . $sql;
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -449,7 +449,7 @@ class Commande
|
||||
{
|
||||
if ($this->db->num_rows())
|
||||
{
|
||||
$obj = $this->db->fetch_object(0);
|
||||
$obj = $this->db->fetch_object();
|
||||
$this->propale_id = $obj->fk_propale;
|
||||
}
|
||||
|
||||
@ -495,7 +495,7 @@ class Commande
|
||||
{
|
||||
$ligne = new CommandeLigne();
|
||||
|
||||
$objp = $this->db->fetch_object( $i);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$ligne->id = $objp->rowid;
|
||||
|
||||
@ -649,7 +649,7 @@ class Commande
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($i);
|
||||
$obj = $this->db->fetch_object();
|
||||
$products[$i][0] = $obj->price;
|
||||
$products[$i][1] = $obj->qty;
|
||||
$products[$i][2] = $obj->tva_tx;
|
||||
|
||||
@ -225,7 +225,7 @@ if ($_GET["action"] == 'create')
|
||||
$num = $db->num_rows();
|
||||
if ($num)
|
||||
{
|
||||
$obj = $db->fetch_object(0);
|
||||
$obj = $db->fetch_object();
|
||||
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($obj->idp);
|
||||
@ -291,13 +291,13 @@ if ($_GET["action"] == 'create')
|
||||
$sql .= " ORDER BY p.nbvente DESC LIMIT 20";
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
$opt = "<option value=\"0\" SELECTED></option>";
|
||||
$opt = "<option value=\"0\" selected></option>";
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows(); $i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$opt .= "<option value=\"$objp->rowid\">[$objp->ref] $objp->label : $objp->price</option>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -351,7 +351,7 @@ if ($_GET["action"] == 'create')
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>[$objp->ref]</td>\n";
|
||||
print '<td>'.$objp->product.'</td>';
|
||||
@ -370,7 +370,7 @@ if ($_GET["action"] == 'create')
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td> </td>\n";
|
||||
print '<td>'.$objp->product.'</td>';
|
||||
@ -558,7 +558,7 @@ else
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
print "<TR $bc[$var]>";
|
||||
if ($objp->fk_product > 0)
|
||||
{
|
||||
@ -636,7 +636,7 @@ else
|
||||
$num = $db->num_rows(); $i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$opt .= "<option value=\"$objp->rowid\">[$objp->ref] $objp->label : $objp->price</option>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -744,7 +744,7 @@ else
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="../expedition/fiche.php?id='.$objp->rowid.'">'.stripslashes($objp->ref).'</a></td>';
|
||||
@ -774,13 +774,13 @@ else
|
||||
{
|
||||
print_titre("Factures");
|
||||
$i = 0; $total = 0;
|
||||
print '<table border="1" cellspacing="0" cellpadding="4" width="100%">';
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr $bc[$var]><td>Facture</td><td>Date</td></tr>\n";
|
||||
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="../compta/facture.php?facid='.$objp->rowid.'">'.stripslashes($objp->facnumber).'</a></td>';
|
||||
|
||||
@ -67,7 +67,7 @@ if ( $db->query($sql) )
|
||||
while ($i < $num)
|
||||
{
|
||||
$var=!$var;
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object();
|
||||
print "<tr $bc[$var]><td width=\"30%\"><a href=\"fiche.php?id=$obj->rowid\">".img_file()."</a> ";
|
||||
print "<a href=\"fiche.php?id=$obj->rowid\">$obj->ref</a></td>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td></tr>';
|
||||
@ -101,7 +101,7 @@ if ( $db->query($sql) )
|
||||
while ($i < $num)
|
||||
{
|
||||
$var=!$var;
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object();
|
||||
print "<tr $bc[$var]><td width=\"30%\"><a href=\"fiche.php?id=$obj->rowid\">".img_file()."</a>";
|
||||
print " <a href=\"fiche.php?id=$obj->rowid\">$obj->ref</a></td>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td></tr>';
|
||||
@ -139,7 +139,7 @@ if ( $db->query($sql) )
|
||||
while ($i < $num)
|
||||
{
|
||||
$var=!$var;
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object();
|
||||
print "<tr $bc[$var]><td width=\"30%\"><a href=\"fiche.php?id=$obj->rowid\">".img_file()."</a> ";
|
||||
print "<a href=\"fiche.php?id=$obj->rowid\">$obj->ref</a></td>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td></tr>';
|
||||
@ -172,7 +172,7 @@ if ( $db->query($sql) )
|
||||
while ($i < $num)
|
||||
{
|
||||
$var=!$var;
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object();
|
||||
print "<tr $bc[$var]><td width=\"30%\"><a href=\"fiche.php?id=$obj->rowid\">".img_file()."</a> ";
|
||||
print "<a href=\"fiche.php?id=$obj->rowid\">$obj->ref</a></td>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td></tr>';
|
||||
|
||||
@ -108,7 +108,7 @@ if ( $db->query($sql) )
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
@ -78,7 +78,7 @@ class OscCommande {
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($i);
|
||||
$obj = $this->db->fetch_object();
|
||||
|
||||
$ga[$obj->rowid] = $obj->title;
|
||||
$i++;
|
||||
|
||||
@ -116,7 +116,7 @@ class Account
|
||||
$num = $this->db->num_rows();
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result, $i);
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$lines[$i][0] = $obj->url;
|
||||
$lines[$i][1] = $obj->url_id;
|
||||
$lines[$i][2] = $obj->label;
|
||||
@ -297,7 +297,7 @@ class Account
|
||||
{
|
||||
if ($this->db->num_rows())
|
||||
{
|
||||
$obj = $this->db->fetch_object($result , 0);
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
$this->bank = $obj->bank;
|
||||
$this->label = $obj->label;
|
||||
|
||||
@ -111,7 +111,7 @@ if ($account > 0)
|
||||
$options = "<option value=\"0\" SELECTED></option>";
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object($result);
|
||||
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n"; $i++;
|
||||
}
|
||||
$db->free();
|
||||
@ -329,7 +329,7 @@ function _print_lines($db,$sql,$acct)
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$total = $total + $objp->amount;
|
||||
$time = time();
|
||||
if ($i >= ($nbline - $viewline))
|
||||
|
||||
@ -68,7 +68,7 @@ if ($result) {
|
||||
$sep = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
print "<tr $bc[1]>";
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ if ($_GET["bid"] == 0)
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td><a href=\"budget.php?bid=$objp->rowid\">$objp->label</a></td>";
|
||||
@ -116,10 +116,10 @@ else
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td align=\"right\">".strftime("%d %B %Y",$objp->do)."</TD>\n";
|
||||
print "<td align=\"right\">".strftime("%d %B %Y",$objp->do)."</td>\n";
|
||||
|
||||
print "<td><a href=\"ligne.php?rowid=$objp->rowid\">$objp->label</a></td>";
|
||||
print "<td align=\"right\">".price(0 - $objp->amount)."</td><td> </td>";
|
||||
|
||||
@ -69,7 +69,7 @@ if ($result)
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td>$objp->rowid</td>";
|
||||
|
||||
@ -60,7 +60,7 @@ if ($result)
|
||||
$sep = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>$objp->rowid</td><td><a href=\"fiche.php?id=$objp->rowid\">$objp->label</a></td>";
|
||||
|
||||
@ -32,7 +32,7 @@ function gljPrintSelect($db, $refid) {
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
print "<OPTION VALUE=$obj->id";
|
||||
if ($refid==$obj->id) {
|
||||
print " SELECTED";
|
||||
@ -63,7 +63,7 @@ function gljCopy_Soc($idsoc, $dbfrom, $dbto) {
|
||||
$result = pg_Exec($connfrom, $sql);
|
||||
if ( $result ) {
|
||||
if (pg_NumRows($result) ) {
|
||||
$obj = pg_Fetch_Object($result, 0);
|
||||
$obj = pg_Fetch_Object($result);
|
||||
|
||||
$sql = "INSERT INTO societe (id, nom, datec, fk_effectif) ";
|
||||
$sql .= "VALUES ('$idsoc', '$obj->nom', $madate, $obj->fk_effectif)";
|
||||
@ -98,7 +98,7 @@ function gljMailLogin ($db, $address, $id, $dbname) {
|
||||
|
||||
if ($db->query($sql)) {
|
||||
if ($db->num_rows() > 0) {
|
||||
$obj = $db->fetch_object(0);
|
||||
$obj = $db->fetch_object();
|
||||
$db->free();
|
||||
|
||||
$subject = "Confirmation";
|
||||
@ -242,7 +242,7 @@ function gljCreateCompany($db, $company_name, $address, $cp, $ville, $fkpays, $p
|
||||
$sql = "SELECT idp FROM societe WHERE id= '$token';";
|
||||
if ( $db->query($sql) ) {
|
||||
if ( $db->num_rows() ) {
|
||||
$obj = $db->fetch_object(0);
|
||||
$obj = $db->fetch_object();
|
||||
return $obj->idp;
|
||||
$db->free();
|
||||
|
||||
@ -407,7 +407,7 @@ function get_ofid_by_idp ($db, $ofidp) {
|
||||
} else {
|
||||
if ($db->num_rows() > 0) {
|
||||
$row = 0;
|
||||
while($data = $db->fetch_object( $row)) {
|
||||
while($data = $db->fetch_object($result)) {
|
||||
$id = $data->id ;
|
||||
}
|
||||
return $id;
|
||||
|
||||
@ -46,7 +46,7 @@ if ($result)
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$accounts[$i] = $objp->rowid;
|
||||
|
||||
$i++;
|
||||
@ -57,7 +57,7 @@ if ($result)
|
||||
/*
|
||||
* Comptes
|
||||
*/
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="2">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>Comptes courants</td><td>Banque</td>';
|
||||
print '<td align="left">Numéro</td><td align="right">Solde</td><td align="center">Clos</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -81,7 +81,7 @@ if ($_POST["action"] == 'UPDATE')
|
||||
$var=True;
|
||||
$amount = str_replace(' ','',$_POST['amount']);
|
||||
$num = $db->num_rows();
|
||||
$objp = $db->fetch_object( 0);
|
||||
$objp = $db->fetch_object($result);
|
||||
if ($objp->rappro)
|
||||
die ("Vous ne pouvez pas modifier une écriture déjà rapprochée");
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank set label='".$_POST["label"]."' , dateo = '".$_POST["date"]."', amount='$amount' WHERE rowid = $rowid;";
|
||||
@ -115,7 +115,7 @@ if ($result)
|
||||
$options = "<option value=\"0\" SELECTED></option>";
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object($result);
|
||||
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -150,7 +150,7 @@ if ($result)
|
||||
$i = 0; $total = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$total = $total + $objp->amount;
|
||||
|
||||
$acct=new Account($db,$objp->fk_account);
|
||||
@ -269,7 +269,7 @@ if ($result)
|
||||
$i = 0; $total = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
@ -49,7 +49,7 @@ function llxHeader($head = "")
|
||||
|
||||
while ($i < $numr)
|
||||
{
|
||||
$objp = $db->fetch_object($i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$menu->add(DOL_URL_ROOT."/compta/bank/account.php?account=" . $objp->rowid, $objp->label);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/releve.php?account=" . $objp->rowid ,"Relevés");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/annuel.php?account=" . $objp->rowid ,"Rapport mensuel E/S");
|
||||
|
||||
@ -88,7 +88,7 @@ if ($result) {
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
if ($options == "") { $options = "<option value=\"0\" selected> </option>"; }
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object($result);
|
||||
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n"; $i++;
|
||||
}
|
||||
$db->free();
|
||||
@ -157,7 +157,7 @@ if ($result)
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
@ -90,7 +90,7 @@ if (! isset($_GET["num"]))
|
||||
|
||||
while ($i < min($numrows,$limit))
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
if (! $objp->numr)
|
||||
{
|
||||
@ -200,7 +200,7 @@ else
|
||||
|
||||
while ($i < $numrows)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$total = $total + $objp->amount;
|
||||
|
||||
$var=!$var;
|
||||
@ -222,23 +222,22 @@ else
|
||||
|
||||
if ($ve)
|
||||
{
|
||||
$dc = $db->clone();
|
||||
$sql = "SELECT label FROM ".MAIN_DB_PREFIX."bank_categ as ct, ".MAIN_DB_PREFIX."bank_class as cl WHERE ct.rowid=cl.fk_categ AND cl.lineid=$objp->rowid";
|
||||
$resc = $dc->query($sql);
|
||||
$resc = $db->query($sql);
|
||||
if ($resc)
|
||||
{
|
||||
$numc = $dc->num_rows();
|
||||
$numc = $db->num_rows();
|
||||
$ii = 0;
|
||||
while ($ii < $numc)
|
||||
{
|
||||
$objc = $dc->fetch_object($ii);
|
||||
$objc = $db->fetch_object($resc);
|
||||
print "<br>- <i>$objc->label</i>";
|
||||
$ii++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $dc->error();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -94,9 +94,9 @@ if ($result) {
|
||||
$var=True;
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
$options = "<option value=\"0\" SELECTED></option>";
|
||||
$options = "<option value=\"0\" selected></option>";
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object($result);
|
||||
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n"; $i++;
|
||||
}
|
||||
$db->free();
|
||||
@ -140,7 +140,7 @@ if ($result)
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$var=!$var;
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@ if ($result)
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($i);
|
||||
$objp = $db->fetch_object($result);
|
||||
print "<option value=\"$objp->rowid\">$objp->label</option>";
|
||||
$i++;
|
||||
}
|
||||
@ -128,7 +128,7 @@ if ($result)
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($i);
|
||||
$objp = $db->fetch_object($result);
|
||||
print "<option value=\"$objp->rowid\">$objp->label</option>";
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ if ( $db->query($sql) ) {
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var = !$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>'.$obj->nom.'</td><td>'.price($obj->total).'</td>';
|
||||
|
||||
@ -66,7 +66,7 @@ if ( $db->query($sql) )
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var = !$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="../sociales/index.php?filtre=s.fk_type:'.$obj->type.'">'.$obj->lib.'</a></td>';
|
||||
@ -95,7 +95,7 @@ if ( $db->query($sql) ) {
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var = !$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>Factures founisseurs</td>';
|
||||
|
||||
@ -144,7 +144,7 @@ if ($mode == 'search') {
|
||||
|
||||
if ( $db->query($sql) ) {
|
||||
if ( $db->num_rows() == 1) {
|
||||
$obj = $db->fetch_object(0);
|
||||
$obj = $db->fetch_object();
|
||||
$socid = $obj->idp;
|
||||
}
|
||||
$db->free();
|
||||
@ -224,7 +224,7 @@ if ($result)
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
|
||||
$var=!$var;
|
||||
|
||||
|
||||
@ -168,7 +168,7 @@ if ($_GET["id"] > 0)
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
print "<tr $bc[$var]>";
|
||||
if ($objp->fk_product > 0)
|
||||
{
|
||||
@ -263,7 +263,7 @@ if ($_GET["id"] > 0)
|
||||
$var=True;
|
||||
while ($i < $num_fac_asso)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<TR bgcolor=\"#e0e0e0\">";
|
||||
print "<TD><a href=\"../compta/facture.php?facid=$objp->facid\">$objp->facnumber</a>";
|
||||
|
||||
@ -66,7 +66,7 @@ if ($action == 'create') {
|
||||
if ($num > 0) {
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
@ -76,7 +76,7 @@ if ( $db->query($sql) )
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="fiche.php?id='.$objp->rowid.'">'.dolibarr_print_date($objp->dd).'</a></td>';
|
||||
|
||||
@ -187,7 +187,7 @@ if ($_GET["action"] == 'create') {
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objopt = $db->fetch_object( $i);
|
||||
$objopt = $db->fetch_object();
|
||||
print "<option value=\"$objopt->rowid\">$objopt->libelle</option>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -260,7 +260,7 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit')
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objopt = $db->fetch_object( $i);
|
||||
$objopt = $db->fetch_object();
|
||||
print "<option value=\"$objopt->rowid\">$objopt->libelle</option>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ if ($result)
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$somme[$objp->fk_statut] = $objp->somme;
|
||||
$i++;
|
||||
|
||||
@ -91,12 +91,12 @@ if ($result)
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".stripslashes($objp->prenom)."</a></TD>\n";
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".stripslashes($objp->nom)."</a></TD>\n";
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".stripslashes($objp->societe)."</a></TD>\n";
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".stripslashes($objp->prenom)."</a></td>\n";
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".stripslashes($objp->nom)."</a></td>\n";
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".stripslashes($objp->societe)."</a></td>\n";
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".strftime("%d %B %Y",$objp->datedon)."</a></td>\n";
|
||||
print "<td>$objp->projet</td>\n";
|
||||
print '<td align="right">'.price($objp->amount).'</td><td> </td>';
|
||||
|
||||
@ -48,7 +48,7 @@ if ($result)
|
||||
$total=0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$total += $objp->amount;
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -69,6 +69,7 @@ if ($_POST["action"] == 'classin')
|
||||
$facture->fetch($_POST["facid"]);
|
||||
$facture->classin($_POST["projetid"]);
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
@ -333,11 +334,11 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance')
|
||||
$sendto = $_POST["sendto"];
|
||||
$sendtoid = 0;
|
||||
}
|
||||
elseif ($_POST["destinataire"]) {
|
||||
elseif ($_POST["receiver"]) {
|
||||
// Le destinataire a été fourni via la liste déroulante
|
||||
$soc = new Societe($db, $fac->socidp);
|
||||
$sendto = $soc->contact_get_email($_POST["destinataire"]);
|
||||
$sendtoid = $_POST["destinataire"];
|
||||
$sendto = $soc->contact_get_email($_POST["receiver"]);
|
||||
$sendtoid = $_POST["receiver"];
|
||||
}
|
||||
|
||||
if (strlen($sendto))
|
||||
@ -446,7 +447,7 @@ if ($_GET["action"] == 'create')
|
||||
$num = $db->num_rows();
|
||||
if ($num)
|
||||
{
|
||||
$obj = $db->fetch_object(0);
|
||||
$obj = $db->fetch_object();
|
||||
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($obj->idp);
|
||||
@ -483,7 +484,7 @@ if ($_GET["action"] == 'create')
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($i);
|
||||
$objp = $db->fetch_object();
|
||||
$conds[$objp->rowid]=$objp->libelle;
|
||||
$i++;
|
||||
}
|
||||
@ -544,7 +545,7 @@ if ($_GET["action"] == 'create')
|
||||
$num = $db->num_rows(); $i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$opt .= "<option value=\"$objp->rowid\">[$objp->ref] $objp->label : $objp->price</option>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -601,7 +602,7 @@ if ($_GET["action"] == 'create')
|
||||
print '<option value="0" selected></option>';
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
print "<option value=\"$objp->rowid\">$objp->titre : $objp->amount</option>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -643,7 +644,7 @@ if ($_GET["action"] == 'create')
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>[$objp->ref]</td>\n";
|
||||
print '<td>'.$objp->product.'</td>';
|
||||
@ -662,7 +663,7 @@ if ($_GET["action"] == 'create')
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td> </td>\n";
|
||||
print '<td>'.$objp->product.'</td>';
|
||||
@ -705,7 +706,7 @@ if ($_GET["action"] == 'create')
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>[$objp->ref]</td>\n";
|
||||
print '<td>'.$objp->product.'</td>';
|
||||
@ -853,7 +854,7 @@ else
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$objp->rowid.'">'.img_file().'</a>';
|
||||
@ -947,7 +948,7 @@ else
|
||||
$var=True;
|
||||
while ($i < $num_lignes)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
if ($objp->fk_product > 0)
|
||||
@ -1229,7 +1230,7 @@ else
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$objp->id.'">'.$objp->id.'</a></td>';
|
||||
@ -1276,12 +1277,18 @@ else
|
||||
*/
|
||||
if ($_GET["action"] == 'presend')
|
||||
{
|
||||
print_titre("Envoyer la facture par mail");
|
||||
|
||||
$langs->load("other");
|
||||
|
||||
$replytoname = $user->fullname;
|
||||
$from_name = $replytoname;
|
||||
|
||||
$replytomail = $user->email;
|
||||
$from_mail = $replytomail;
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">\n";
|
||||
print '<input type="hidden" name="facid" value="'.$fac->id.'">';
|
||||
print '<input type="hidden" name="action" value="send">';
|
||||
@ -1289,34 +1296,42 @@ else
|
||||
print '<input type="hidden" name="replytomail" value="'.$replytomail.'">';
|
||||
print '<br>';
|
||||
|
||||
print_titre("Envoyer la facture par mail");
|
||||
print "<table cellspacing=\"0\" class=\"border\" cellpadding=\"3\" width=\"100%\">";
|
||||
print "<tr><td>Expéditeur</td><td>$from_name</td><td>$from_mail </td></tr>";
|
||||
print "<tr><td>Répondre à</td><td>$replytoname</td><td>$replytomail </td></tr>";
|
||||
print '<tr><td>Destinataire</td><td colspan=\"2\">';
|
||||
|
||||
$form = new Form($db);
|
||||
$form->select_array("destinataire",$soc->contact_email_array());
|
||||
print " ou <input size=\"30\" name=\"sendto\" value=\"$fac->email\"></td></tr>";
|
||||
// From
|
||||
print "<table class=\"border\" width=\"100%\">";
|
||||
print "<tr><td width=\"180\">".$langs->trans("MailFrom")."</td><td>$from_name".($from_mail?" <$from_mail>":"")."</td></tr>";
|
||||
print "<tr><td>".$langs->trans("MailReply")."</td><td>$replytoname".($replytomail?" <$replytomail>":"");
|
||||
print "</td></tr>";
|
||||
print "</table>";
|
||||
|
||||
// To
|
||||
print "<table class=\"border\" width=\"100%\">";
|
||||
print '<tr><td width=\"180\">'.$langs->trans("MailTo").'</td><td>';
|
||||
$form->select_array("receiver",$soc->contact_email_array());
|
||||
print " ".$langs->trans("or")." <input size=\"30\" name=\"sendto\" value=\"$fac->email\"></td></tr>";
|
||||
|
||||
print '<tr><td>Message</td><td colspan=\"2\">';
|
||||
print "<textarea rows=\"5\" cols=\"60\" name=\"message\">";
|
||||
print "Veuillez trouver ci-joint la facture $fac->ref\n\nCordialement\n\n";
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print "</table><br>\n";
|
||||
// Topic + Message
|
||||
$defaultmessage="Veuillez trouver ci-joint la facture $fac->ref\n\nCordialement\n\n";
|
||||
$form->mail_topicmessagefile(0,1,0,$defaultmessage);
|
||||
|
||||
print "<center><input class=\"flat\" type=\"submit\" value=\"".$langs->trans("Send")."\"></center></form>\n";
|
||||
print "<br><center><input class=\"flat\" type=\"submit\" value=\"".$langs->trans("Send")."\"></center>\n";
|
||||
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'prerelance')
|
||||
{
|
||||
print_titre("Envoyer une relance par mail");
|
||||
|
||||
$langs->load("other");
|
||||
|
||||
$replytoname = $user->fullname;
|
||||
$from_name = $replytoname;
|
||||
|
||||
$replytomail = $user->email;
|
||||
$from_mail = $replytomail;
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">\n";
|
||||
print '<input type="hidden" name="facid" value="'.$fac->id.'">';
|
||||
print '<input type="hidden" name="action" value="relance">';
|
||||
@ -1324,24 +1339,26 @@ else
|
||||
print '<input type="hidden" name="replytomail" value="'.$replytomail.'">';
|
||||
print '<br>';
|
||||
|
||||
print_titre("Envoyer une relance par mail");
|
||||
print "<table cellspacing=\"0\" class=\"border\" cellpadding=\"3\" width=\"100%\">";
|
||||
print "<tr><td>Expéditeur</td><td>$from_name</td><td>$from_mail </td></tr>";
|
||||
print "<tr><td>Répondre à</td><td>$replytoname</td><td>$replytomail </td></tr>";
|
||||
print '<tr><td>Destinataire</td><td colspan=\"2\">';
|
||||
// From
|
||||
print "<table class=\"border\" width=\"100%\">";
|
||||
print "<tr><td width=\"180\">".$langs->trans("MailFrom")."</td><td>$from_name".($from_mail?" <$from_mail>":"")."</td></tr>";
|
||||
print "<tr><td>".$langs->trans("MailReply")."</td><td>$replytoname".($replytomail?" <$replytomail>":"");
|
||||
print "</td></tr>";
|
||||
print "</table>";
|
||||
|
||||
// To
|
||||
print "<table class=\"border\" width=\"100%\">";
|
||||
print '<tr><td width=\"180\">'.$langs->trans("MailTo").'</td><td>';
|
||||
$form->select_array("receiver",$soc->contact_email_array());
|
||||
print " ".$langs->trans("or")." <input size=\"30\" name=\"sendto\" value=\"$fac->email\"></td></tr>";
|
||||
|
||||
$form = new Form($db);
|
||||
$form->select_array("destinataire",$soc->contact_email_array());
|
||||
print " ou <input size=\"30\" name=\"sendto\" value=\"$fac->email\"></td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans("Message").'</td><td colspan=\"2\">';
|
||||
print "<textarea rows=\"5\" cols=\"60\" name=\"message\">";
|
||||
print "Nous apportons à votre connaissance que la facture ".$fac->ref." ne semble toujours pas avoir été réglée. La voici donc, pour rappel, en pièce jointe.\n\nCordialement\n\n";
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print "</table><br>\n";
|
||||
|
||||
print "<center><input class=\"flat\" type=\"submit\" value=\"".$langs->trans("Send")."\"></center></form>\n";
|
||||
// Affiche la partie mail topic + message + file
|
||||
$defaultmessage="Nous apportons à votre connaissance que la facture ".$fac->ref." ne semble toujours pas avoir été réglée. La voici donc, pour rappel, en pièce jointe.\n\nCordialement\n\n";
|
||||
$form->mail_topicmessagefile(0,1,0,$defaultmessage);
|
||||
|
||||
print "<br><center><input class=\"flat\" type=\"submit\" value=\"".$langs->trans("Send")."\"></center>\n";
|
||||
|
||||
print "</form\n";
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1378,7 +1395,7 @@ else
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td><a href=\"propal.php?propalid=$objp->propalid\">$objp->ref</a></td>\n";
|
||||
@ -1501,7 +1518,7 @@ else
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$objp = $db->fetch_object($i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
@ -154,7 +154,7 @@ class FactureRec
|
||||
{
|
||||
if ($this->db->num_rows())
|
||||
{
|
||||
$obj = $this->db->fetch_object(0);
|
||||
$obj = $this->db->fetch_object();
|
||||
|
||||
$this->id = $rowid;
|
||||
$this->datep = $obj->dp;
|
||||
@ -199,7 +199,7 @@ class FactureRec
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $this->db->fetch_object($i);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$faclig = new FactureLigne($this->db);
|
||||
$faclig->produit_id = $objp->fk_product;
|
||||
$faclig->desc = stripslashes($objp->description);
|
||||
@ -333,7 +333,7 @@ class FactureRec
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($i);
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."product SET nbvente=nbvente+1 WHERE rowid = ".$obj->fk_product;
|
||||
$db2 = $this->db->clone();
|
||||
@ -467,7 +467,7 @@ class FactureRec
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($i);
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
$products[$i][0] = $obj->price;
|
||||
$products[$i][1] = $obj->qty;
|
||||
|
||||
@ -164,7 +164,7 @@ if ($_GET["action"] == 'create')
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
|
||||
if ($objp->fk_product > 0)
|
||||
{
|
||||
@ -435,7 +435,7 @@ else
|
||||
$var=True;
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$objp = $db->fetch_object($i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
@ -125,7 +125,7 @@ if ($mode == 'search')
|
||||
{
|
||||
if ( $db->num_rows() == 1)
|
||||
{
|
||||
$obj = $db->fetch_object(0);
|
||||
$obj = $db->fetch_object();
|
||||
$socid = $obj->idp;
|
||||
}
|
||||
$db->free();
|
||||
@ -260,7 +260,7 @@ if ($socid > 0)
|
||||
|
||||
while ($i < $num && $i < 5)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td><a href=\"../compta/facture.php?facid=$objp->facid\">$objp->facnumber</a></td>\n";
|
||||
@ -306,7 +306,7 @@ if ($socid > 0)
|
||||
}
|
||||
while ($i < $num && $i < 5)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$tag = !$tag;
|
||||
print "<tr $bc[$tag]>";
|
||||
print '<td><a href="../projet/fiche.php?id='.$obj->rowid.'">'.$obj->title.'</a></td>';
|
||||
@ -388,7 +388,7 @@ if ($socid > 0)
|
||||
$var=1;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object($result);
|
||||
$var = !$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
@ -449,7 +449,7 @@ if ($socid > 0)
|
||||
while ($i < $num) {
|
||||
$var = !$var;
|
||||
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
if ($oldyear == strftime("%Y",$obj->da) ) {
|
||||
|
||||
@ -109,7 +109,7 @@ if ($conf->facture->enabled)
|
||||
$var = True;
|
||||
while ($i < $num && $i < 20)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="92"><a href="facture.php?facid='.$obj->rowid.'">'.img_file().'</a> ';
|
||||
print '<a href="facture.php?facid='.$obj->rowid.'">'.$obj->facnumber.'</a></td>';
|
||||
@ -151,7 +151,7 @@ if ($user->societe_id == 0)
|
||||
$var = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var = !$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>'.$obj->libelle.'</td>';
|
||||
@ -191,7 +191,7 @@ if ( $db->query($sql) )
|
||||
$var = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var = !$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td>';
|
||||
@ -237,7 +237,7 @@ if ($user->comm > 0 && $conf->commercial->enabled )
|
||||
while ($i < $num)
|
||||
{
|
||||
$var=!$var;
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object();
|
||||
print "<tr $bc[$var]><td width=\"20%\"><a href=\"commande.php?id=$obj->rowid\">".img_file()."</a>";
|
||||
print " <a href=\"commande.php?id=$obj->rowid\">$obj->ref</a></td>";
|
||||
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td></tr>';
|
||||
@ -279,7 +279,7 @@ if ($conf->facture->enabled)
|
||||
$total = $totalam = 0;
|
||||
while ($i < $num && $i < 20)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="20%"><a href="facture.php?facid='.$obj->rowid.'">'.img_file().'</a>';
|
||||
print ' <a href="facture.php?facid='.$obj->rowid.'">'.$obj->facnumber.'</a></td>';
|
||||
@ -313,7 +313,7 @@ if ( $result )
|
||||
$i = 0;
|
||||
while ($i < $db->num_rows() )
|
||||
{
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object();
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]><td>".strftime("%d %b %Y",$obj->da)."</td><td><a href=\"action/fiche.php\">$obj->libelle $obj->label</a></td></tr>";
|
||||
@ -345,7 +345,7 @@ if ($user->societe_id == 0)
|
||||
$num = $db->num_rows();
|
||||
if ($num)
|
||||
{
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">Factures fournisseurs à payer</td><td align="right">Montant TTC</td></tr>';
|
||||
print "</tr>\n";
|
||||
$i = 0;
|
||||
@ -353,7 +353,7 @@ if ($user->societe_id == 0)
|
||||
$total = $totalam = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object();
|
||||
$var = !$var;
|
||||
print '<tr '.$bc[$var].'><td width="20%"><a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$obj->rowid.'">'.img_file().'</a>';
|
||||
print ' <a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$obj->rowid.'">'.$obj->facnumber.'</a></td>';
|
||||
|
||||
@ -30,7 +30,7 @@ if ( $db->query($sql) ) {
|
||||
$i = 0;
|
||||
$options = "<option value=\"0\" SELECTED></option>";
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($i);
|
||||
$obj = $db->fetch_object();
|
||||
$options .= "<option value=\"$obj->rowid\">$obj->number</option>\n"; $i++;
|
||||
}
|
||||
$db->free();
|
||||
@ -99,7 +99,7 @@ if ($action == 'create') {
|
||||
if ($num > 0) {
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
|
||||
print "<TR $bc[$var]>";
|
||||
|
||||
@ -146,7 +146,7 @@ if ($_GET["action"] == 'create')
|
||||
$num = $db->num_rows();
|
||||
if ($num)
|
||||
{
|
||||
$obj = $db->fetch_object( 0);
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$total = $obj->total;
|
||||
|
||||
@ -179,7 +179,7 @@ if ($_GET["action"] == 'create')
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objopt = $db->fetch_object( $i);
|
||||
$objopt = $db->fetch_object($result);
|
||||
print "<option value=\"$objopt->id\">$objopt->libelle</option>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -203,7 +203,7 @@ if ($_GET["action"] == 'create')
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objopt = $db->fetch_object( $i);
|
||||
$objopt = $db->fetch_object($result);
|
||||
print '<option value="'.$objopt->rowid.'"';
|
||||
if (defined("FACTURE_RIB_NUMBER") && FACTURE_RIB_NUMBER == $objopt->rowid)
|
||||
{
|
||||
@ -237,7 +237,7 @@ if ($_GET["action"] == 'create')
|
||||
{
|
||||
$i = 0;
|
||||
print '<tr><td colspan="3">';
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>Facture</td><td align="center">Date</td>';
|
||||
print '<td align="right">Montant TTC</td>';
|
||||
@ -252,7 +252,7 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
@ -363,7 +363,7 @@ if ($action == '')
|
||||
|
||||
print_barre_liste("Paiements", $page, "paiement.php","",$sortfield,$sortorder,'',$num);
|
||||
|
||||
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<TABLE border="0" width="100%">';
|
||||
print '<TR class="liste_titre">';
|
||||
print "<td>Facture</td>";
|
||||
print "<td>Date</td>";
|
||||
@ -375,7 +375,7 @@ if ($action == '')
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<TD><a href=\"facture.php?facid=$objp->facid\">$objp->facnumber</a></TD>\n";
|
||||
|
||||
@ -123,7 +123,7 @@ if ($db->query($sql))
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($i);
|
||||
$objp = $db->fetch_object();
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
@ -65,17 +65,17 @@ if ($result)
|
||||
|
||||
print_barre_liste("Paiements reçus", $page, "liste.php","",$sortfield,$sortorder,'',$num);
|
||||
|
||||
print '<table border="0" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>Date</td><td>';
|
||||
print_liste_field_titre($langs->trans("Type"),"liste.php","c.libelle","","");
|
||||
print '</td><td align="right">Montant</TD>';
|
||||
print '</td><td align="right">'.$langs->trans("Amount").'</td>';
|
||||
print "<td> </td>";
|
||||
print "</tr>\n";
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$objp = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="fiche.php?id='.$objp->rowid.'">';
|
||||
|
||||
@ -193,7 +193,7 @@ if ($_GET["action"] == 'create')
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objopt = $db->fetch_object( $i);
|
||||
$objopt = $db->fetch_object($result);
|
||||
print "<option value=\"$objopt->id\">$objopt->libelle</option>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -216,7 +216,7 @@ if ($_GET["action"] == 'create')
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objopt = $db->fetch_object( $i);
|
||||
$objopt = $db->fetch_object($result);
|
||||
print '<option value="'.$objopt->rowid.'"';
|
||||
if (defined("FACTURE_RIB_NUMBER") && FACTURE_RIB_NUMBER == $objopt->rowid)
|
||||
{
|
||||
@ -253,7 +253,7 @@ if ($_GET["action"] == 'create')
|
||||
$num = 1;
|
||||
$i = 0;
|
||||
print '<tr><td colspan="3">';
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>Charge</td><td align="center">Date échéance</td>';
|
||||
print '<td align="right">Montant TTC</td>';
|
||||
|
||||
@ -52,12 +52,10 @@ $result = $db->query($sql);
|
||||
|
||||
if ($result) {
|
||||
|
||||
|
||||
|
||||
print "<table class=\"noborder\" cellspacing=\"0\" cellpadding=\"3\">";
|
||||
print "<table class=\"noborder\">";
|
||||
print "<tr bgcolor=\"orange\">";
|
||||
print "<td>".$langs->trans("Month")."</td>";
|
||||
print "<td align=\"right\">Montant</td>";
|
||||
print "<td align=\"right\">".$langs->trans("Amount")."</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
$bc[0]="bgcolor=\"#90c090\"";
|
||||
@ -67,16 +65,16 @@ if ($result) {
|
||||
$i = 0;
|
||||
$num = $db->num_rows();
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
|
||||
print "<TR $bc[$var]>";
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print "<TD>".strftime("%Y %B",$obj->dm)."</TD>\n";
|
||||
print "<TD align=\"right\">$obj->amount</TD>\n";
|
||||
print "<td>".strftime("%Y %B",$obj->dm)."</td>\n";
|
||||
print "<td align=\"right\">$obj->amount</td>\n";
|
||||
|
||||
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
$i++;
|
||||
|
||||
@ -30,7 +30,7 @@ function pt ($db, $sql) {
|
||||
$total = 0 ;
|
||||
$month = 1 ;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$ca[$obj->dm] = $obj->sum;
|
||||
|
||||
@ -51,7 +51,7 @@ function pm ($db) {
|
||||
|
||||
$month = 1 ;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object( $i);
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$ca[$obj->dm] = $obj->amount;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user