Fix: Correction des mauvaises utilisations des fetch_objet ou on passait un paramtre jamais utilis.

This commit is contained in:
Laurent Destailleur 2004-10-23 21:02:56 +00:00
parent cc831aa97e
commit b2674f8ae1
21 changed files with 70 additions and 69 deletions

View File

@ -113,7 +113,7 @@ class ActionComm
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object();
$this->id = $id;
$this->type = $obj->libelle;

View File

@ -43,7 +43,7 @@ class CActioncomm {
{
if ($db->num_rows())
{
$obj = $db->fetch_object(0);
$obj = $db->fetch_object();
$this->id = $id;
$this->libelle = $obj->libelle;
@ -87,7 +87,7 @@ class CActioncomm {
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object();
$ga[$obj->id] = $obj->libelle;
$i++;
@ -117,7 +117,7 @@ class CActioncomm {
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object($result , 0);
$obj = $this->db->fetch_object($result);
return $obj->nom;
}
$this->db->free();

View File

@ -146,7 +146,7 @@ class ChargeSociales {
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object();
$this->id = $obj->rowid;
$this->date_ech = $obj->date_ech;
@ -186,7 +186,7 @@ class ChargeSociales {
if ($result) {
if ($this->db->num_rows()) {
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object();
return $obj->amount;
} else {
return 0;

View File

@ -147,7 +147,7 @@ class CompanyBankAccount
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object($result , 0);
$obj = $this->db->fetch_object($result);
$this->bank = $obj->bank;
$this->courant = $obj->courant;

View File

@ -343,7 +343,7 @@ class Contact
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object($result , 0);
$obj = $this->db->fetch_object();
$this->id = $obj->idp;
$this->civilite_id = $obj->civilite_id;
@ -386,7 +386,7 @@ class Contact
{
if ($this->db->num_rows())
{
$uobj = $this->db->fetch_object($result , 0);
$uobj = $this->db->fetch_object();
$this->user_id = $uobj->rowid;
}
@ -426,7 +426,7 @@ class Contact
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object($result , 0);
$obj = $this->db->fetch_object();
$this->birthday_alert = 1;
}
@ -509,7 +509,7 @@ class Contact
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object($result , 0);
$obj = $this->db->fetch_object();
$this->id = $obj->idp;

View File

@ -290,7 +290,7 @@ class Don
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object();
$this->id = $obj->rowid;
$this->date = $obj->datedon;

View File

@ -106,7 +106,7 @@ class Facture
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object();
$cdr_nbjour = $obj->nbjour;
$cdr_fdm = $obj->fdm;
}
@ -245,7 +245,7 @@ class Facture
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object();
$this->id = $rowid;
$this->datep = $obj->dp;
@ -291,7 +291,7 @@ class Facture
while ($i < $num)
{
$objp = $this->db->fetch_object($i);
$objp = $this->db->fetch_object($result);
$faclig = new FactureLigne($this->db);
$faclig->desc = stripslashes($objp->description);
$faclig->qty = $objp->qty;
@ -542,7 +542,7 @@ class Facture
$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();
@ -746,7 +746,7 @@ class Facture
$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;
@ -1024,7 +1024,7 @@ class Facture
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object($result , 0);
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
@ -1086,7 +1086,7 @@ class FactureLigne
$result = $this->db->query($sql);
if ($result)
{
$objp = $this->db->fetch_object($i);
$objp = $this->db->fetch_object($result);
$this->desc = stripslashes($objp->description);
$this->qty = $objp->qty;
$this->price = $objp->price;

View File

@ -163,7 +163,7 @@ class FactureFourn
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object();
$this->id = $rowid;
$this->datep = $obj->df;
@ -200,7 +200,7 @@ class FactureFourn
{
while ($i < $num)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object();
$this->lignes[$i][0] = stripslashes($obj->description);
$this->lignes[$i][1] = $obj->pu_ht;
$this->lignes[$i][2] = $obj->tva_taux;

View File

@ -79,7 +79,7 @@ class Form
$pays='';
while ($i < $num)
{
$obj = $this->db->fetch_object( $i);
$obj = $this->db->fetch_object();
if ($obj->code == 0) {
print '<option value="0">&nbsp;</option>';
}
@ -138,7 +138,7 @@ class Form
$pays='';
while ($i < $num)
{
$obj = $this->db->fetch_object( $i);
$obj = $this->db->fetch_object();
if ($obj->code == 0) {
print '<option value="0">&nbsp;</option>';
}
@ -194,7 +194,7 @@ class Form
$foundselected=false;
while ($i < $num)
{
$obj = $this->db->fetch_object( $i);
$obj = $this->db->fetch_object();
if ($selected > 0 && $selected == $obj->rowid)
{
$foundselected=true;
@ -275,7 +275,7 @@ class Form
{
while ($i < $num)
{
$obj = $this->db->fetch_object( $i);
$obj = $this->db->fetch_object();
if ($selected > 0 && $selected == $obj->idp)
{
print '<option value="'.$obj->idp.'" selected>'.$obj->nom.'</option>';
@ -316,7 +316,7 @@ class Form
{
while ($i < $num)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object();
if ($selected && $selected == $obj->idp)
{
@ -353,7 +353,7 @@ class Form
if ($num)
{
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object();
return $obj->libelle;
}
else
@ -389,7 +389,7 @@ class Form
{
while ($i < $num)
{
$obj = $this->db->fetch_object( $i);
$obj = $this->db->fetch_object();
if ($selected == $obj->rowid)
{
print '<option value="'.$obj->code.'" selected>';
@ -437,7 +437,7 @@ class Form
$pays='';
while ($i < $num)
{
$obj = $this->db->fetch_object( $i);
$obj = $this->db->fetch_object();
if ($obj->code == 0) {
print '<option value="0">&nbsp;</option>';
}
@ -484,7 +484,7 @@ class Form
print '<form method="post" action="'.$page.'">';
print '<input type="hidden" name="action" value="'.$action.'">';
print '<table cellspacing="0" class="border" width="100%" cellpadding="3">';
print '<table class="border" width="100%">';
print '<tr><td colspan="3">'.$title.'</td></tr>';
print '<tr><td class="valid">'.$question.'</td><td class="valid">';
@ -829,10 +829,10 @@ class Form
/*
* \brief Selection de oui/non en caractere
* \param name nom du select
* \param value valeur présélectionnée
* \param option 0 retourne yes/no, 1 retourne 1/0
* \brief Selection de oui/non en caractere (renvoi yes/no)
* \param name nom du select
* \param value valeur présélectionnée
* \param option 0 retourne yes/no, 1 retourne 1/0
*/
function selectyesno($name,$value='',$option=0)
{
@ -857,8 +857,9 @@ class Form
}
/*
* \brief Selection de oui/non en chiffre
*
* \brief Selection de oui/non en chiffre (renvoi 1/0)
* \param name nom du select
* \param value valeur présélectionnée
*/
function selectyesnonum($name,$value='')
{

View File

@ -49,7 +49,7 @@ if ($result)
while ($j < $num)
{
$obj = $db->fetch_object($j);
$obj = $db->fetch_object($result);
$boxes[$j] = "includes/boxes/".$obj->file;
$j++;
}

View File

@ -123,7 +123,7 @@ if ($result)
while ($i < $numr)
{
$objp = $db->fetch_object( $i);
$objp = $db->fetch_object($result);
define ("$objp->name", $objp->value);
$i++;
}
@ -368,6 +368,7 @@ if (defined("MAIN_MAIL_NEW_SUBJECT"))
*/
$bc[0]="class=\"impair\"";
$bc[1]="class=\"pair\"";
$yesno[0]="no";
$yesno[1]="yes";
?>

View File

@ -60,7 +60,7 @@ class Notify
$i = 0;
while ($i < $num)
{
$obj = $this->db->fetch_object( $i);
$obj = $this->db->fetch_object($result);
$sendto = $obj->firstname . " " . $obj->name . " <".$obj->email.">";

View File

@ -78,7 +78,7 @@ class Paiement
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object();
$this->id = $obj->rowid;
$this->date = $obj->dp;
@ -273,7 +273,7 @@ class Paiement
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object($result , 0);
$obj = $this->db->fetch_object();
$this->id = $obj->idp;

View File

@ -63,7 +63,7 @@ class Project {
if ($this->db->query($sql) ) {
if ($this->db->num_rows()) {
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object();
$this->id = $rowid;
$this->ref = $obj->ref;
@ -95,7 +95,7 @@ class Project {
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object();
$propales[$i] = $obj->rowid;
@ -140,7 +140,7 @@ class Project {
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object();
$projets[$obj->rowid] = $obj->title;
$i++;

View File

@ -53,7 +53,7 @@ class ProjetDon {
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object();
$projets[$obj->rowid] = $obj->libelle;
$i++;

View File

@ -313,7 +313,7 @@ class Propal
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;
@ -366,7 +366,7 @@ class Propal
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object();
$this->id = $rowid;
$this->datep = $obj->dp;
@ -417,7 +417,7 @@ class Propal
while ($i < $num)
{
$objp = $this->db->fetch_object($i);
$objp = $this->db->fetch_object();
$ligne = new PropaleLigne();
$ligne->libelle = stripslashes($objp->label);
@ -455,7 +455,7 @@ class Propal
while ($j < $num)
{
$objp = $this->db->fetch_object($i);
$objp = $this->db->fetch_object();
$ligne = new PropaleLigne();
$ligne->libelle = stripslashes($objp->description);
$ligne->desc = stripslashes($objp->description);
@ -686,7 +686,7 @@ class Propal
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object();
$ga[$obj->rowid] = $obj->ref;
$i++;
@ -720,7 +720,7 @@ class Propal
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object();
$ga[$i] = $obj->fk_commande;
$i++;
@ -799,7 +799,7 @@ class Propal
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object($result , 0);
$obj = $this->db->fetch_object();
$this->id = $obj->rowid;

View File

@ -154,7 +154,7 @@ class Service {
if ($result) {
if ($this->db->num_rows()) {
$obj = $this->db->fetch_object($result , 0);
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
$this->ref = $obj->ref;

View File

@ -227,7 +227,7 @@ class Societe {
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object();
$this->date_update = $obj->date_update;
@ -375,7 +375,7 @@ class Societe {
while ($i < $num)
{
$objp = $this->db->fetch_object($i);
$objp = $this->db->fetch_object();
$array_push($facimp, $objp->rowid);
$i++;
print $i;
@ -534,7 +534,7 @@ class Societe {
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object($result , 0);
$obj = $this->db->fetch_object($result);
return $obj->nom;
}
$this->db->free();
@ -565,7 +565,7 @@ class Societe {
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object();
$contact_email[$obj->idp] = "$obj->firstname $obj->name &lt;$obj->email&gt;";
$i++;
@ -600,7 +600,7 @@ class Societe {
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object();
$contacts[$obj->idp] = "$obj->firstname $obj->name";
$i++;
@ -633,7 +633,7 @@ class Societe {
if ($nump)
{
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object();
$contact_email = "$obj->firstname $obj->name <$obj->email>";
@ -668,7 +668,7 @@ class Societe {
while ($i < $num)
{
$objp = $this->db->fetch_object($i);
$objp = $this->db->fetch_object();
$effs[$objp->id] = $objp->libelle;
$i++;
}
@ -698,7 +698,7 @@ class Societe {
while ($i < $num)
{
$objp = $this->db->fetch_object($i);
$objp = $this->db->fetch_object();
$fj[$objp->code] = $objp->libelle;
$i++;
}

View File

@ -81,7 +81,7 @@ if ($mode == 'search')
{
if ( $db->num_rows() == 1)
{
$obj = $db->fetch_object(0);
$obj = $db->fetch_object();
$socid = $obj->idp;
}
$db->free();
@ -174,7 +174,7 @@ if ($result)
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object( $i);
$obj = $db->fetch_object();
$var=!$var;
print "<tr $bc[$var]><td>";
print "<a href=\"soc.php?socid=$obj->idp\">";

View File

@ -80,7 +80,7 @@ class Tva
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object($result);
return $obj->amount;
}
else
@ -120,7 +120,7 @@ class Tva
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object($result);
return $obj->amount;
}
else
@ -161,7 +161,7 @@ class Tva
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0);
$obj = $this->db->fetch_object($result);
return $obj->amount;
}
else

View File

@ -503,7 +503,6 @@ class User
{
if ($this->db->num_rows())
{
//$obj = $this->db->fetch_object($result , 0);
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
$this->nom = stripslashes($obj->name);
@ -546,7 +545,7 @@ class User
$this->page_param = array();
while ($i < $num)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object();
$this->page_param[$obj->param] = $obj->value;
$page_param_url .= $obj->param . "=".$obj->value."&amp;";
$i++;