Fix: Correction mauvaise utilisation de la methode fectch_object avec en paramtre un indice au lieu d'un resultset.

This commit is contained in:
Laurent Destailleur 2005-03-18 22:50:53 +00:00
parent 3315ac4c9e
commit 8eb28a675c
26 changed files with 158 additions and 138 deletions

View File

@ -257,6 +257,7 @@ if ($account > 0)
if ($result)
{
_print_lines($db, $sql, $acct);
$db->free($result);
}
@ -409,6 +410,6 @@ function _print_lines($db,$sql,$acct)
$i++;
}
$db->free();
}
?>

View File

@ -69,15 +69,16 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
print_barre_liste("Exports", $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num);
print_barre_liste($langs->trans("Exports"), $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num);
print"\n<!-- debut table -->\n";
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre("Réf","liste.php","ec.ref");
print_liste_field_titre($langs->trans("Ref"),"liste.php","ec.ref");
print '<td>Client facturé</td>';
@ -89,7 +90,7 @@ if ($result)
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]>";
@ -100,11 +101,11 @@ if ($result)
$i++;
}
print "</table>";
$db->free();
$db->free($result);
}
else
{
print $db->error() . ' ' . $sql;
dolibarr_print_error($db);
}
$db->close();

View File

@ -165,7 +165,7 @@ if ($_GET["facid"] > 0)
$result_sql = $db->query($sql);
if ($result_sql)
{
$num = $db->num_rows();
$num = $db->num_rows($result_sql);
}
@ -184,7 +184,7 @@ if ($_GET["facid"] > 0)
/*
* Prélèvement
*/
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td align="center">Date demande</td>';
@ -201,7 +201,7 @@ if ($_GET["facid"] > 0)
while ($i < $num)
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result_sql);
$var=!$var;
print "<tr $bc[$var]>";
@ -218,7 +218,7 @@ if ($_GET["facid"] > 0)
$i++;
}
$db->free();
$db->free($result_sql);
}
else
{
@ -239,12 +239,12 @@ if ($_GET["facid"] > 0)
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]>";
@ -265,7 +265,7 @@ if ($_GET["facid"] > 0)
$i++;
}
$db->free();
$db->free($result);
}
else
{

View File

@ -217,7 +217,7 @@ if ($_GET["action"] == 'create')
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
while ($i < $num)
{
@ -249,9 +249,10 @@ if ($_GET["action"] == 'create')
// $sql .= " AND f.fk_statut = 1"; // Statut=0 => non validée, Statut=2 => annulée
// $sql .= " GROUP BY f.facnumber";
//
// if ($db->query($sql))
// $result=$db->query($sql);
// if ($result)
// {
// $num = $db->num_rows();
// $num = $db->num_rows($result);
//
// if ($num > 0)
// {
@ -273,7 +274,7 @@ if ($_GET["action"] == 'create')
while ($i < $num)
{
//$objp = $db->fetch_object($i);
//$objp = $db->fetch_object($result);
$objp = $charge;
$var=!$var;

View File

@ -205,15 +205,16 @@ else
$sql .=" WHERE pf.fk_soc = s.idp AND pf.fk_product = ".$product->id;
$sql .= " ORDER BY lower(s.nom)";
if ( $db->query($sql) )
$result=$db->query($sql);
if ($result)
{
$num_fournisseur = $db->num_rows();
$num_fournisseur = $db->num_rows($result);
$i = 0;
print '<table class="noborder" width="100%">';
$var=True;
while ($i < $num_fournisseur)
{
$objp = $db->fetch_object($i);
$objp = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]>";
print '<td><a href="../fourn/fiche.php?socid='.$objp->idp.'">'.$objp->nom.'</a></td>';
@ -223,7 +224,7 @@ else
$i++;
}
print '</table>';
$db->free();
$db->free($result);
}
print '</td></tr>';
@ -309,13 +310,14 @@ else
$sql = "SELECT s.idp, s.nom, s.ville FROM ".MAIN_DB_PREFIX."societe as s WHERE s.fournisseur=1";
$sql .= " ORDER BY lower(s.nom)";
if ($db->query($sql))
$result=$db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
print '<option value="'.$obj->idp.'">'.$obj->nom . ($obj->ville?" ($obj->ville)":"");
$i++;
}
@ -468,15 +470,16 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente)
$sql .=" WHERE p.fk_soc = s.idp AND p.fk_statut = 0 AND p.fk_user_author = ".$user->id;
$sql .= " ORDER BY p.datec DESC, tms DESC";
if ( $db->query($sql) )
$result=$db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
print '<table class="noborder" width="100%">';
$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=\"../comm/propal.php?propalid=$objp->propalid\">$objp->ref</a></TD>\n";
@ -495,7 +498,7 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente)
$i++;
}
print "</table>";
$db->free();
$db->free($result);
}
print '</td>';

View File

@ -87,7 +87,7 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
print_barre_liste("Comptes généraux", $page, "liste.php", "", $sortfield, $sortorder, '', $num);
@ -111,7 +111,7 @@ if ($result)
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]>";
@ -126,11 +126,11 @@ if ($result)
$i++;
}
print "</table>";
$db->free();
$db->free($result);
}
else
{
print $db->error() . ' ' . $sql;
dolibarr_print_error($db);
}
$db->close();

View File

@ -65,7 +65,7 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
$urladd= "&amp;statut=".$_GET["statut"];
@ -93,7 +93,7 @@ if ($result)
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]><td>";
@ -109,7 +109,7 @@ if ($result)
$i++;
}
print "</table>";
$db->free();
$db->free($result);
}
else
{

View File

@ -117,7 +117,7 @@ $result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
$urladd = "&amp;id=".$_GET["id"];
@ -137,7 +137,7 @@ if ($result)
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
print "<tr $bc[$var]><td>";
@ -188,11 +188,11 @@ if ($result)
}
print "</table>";
$db->free();
$db->free($result);
}
else
{
print $db->error() . ' ' . $sql;
dolibarr_print_error($db);
}
$db->close();

View File

@ -97,7 +97,7 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
print_barre_liste("Prélèvements rejetés", $page, "rejets.php", $urladd, $sortfield, $sortorder, '', $num);
@ -116,7 +116,7 @@ if ($result)
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
print "<tr $bc[$var]><td>";
@ -147,11 +147,11 @@ if ($result)
}
print "</table>";
$db->free();
$db->free($result);
}
else
{
print $db->error() . ' ' . $sql;
dolibarr_print_error($db);
}
$db->close();

View File

@ -106,7 +106,7 @@ $sql .= " ORDER BY pl.amount DESC";
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
print_barre_liste("Lignes de prélèvement rejetées", $page, "fiche-rejet.php", $urladd, $sortfield, $sortorder, '', $num);
@ -121,7 +121,7 @@ if ($result)
while ($i < $num)
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
print "<tr $bc[$var]><td>";
print '<img border="0" src="./statut'.$obj->statut.'.png"></a>&nbsp;';
@ -140,11 +140,11 @@ if ($result)
}
print "</table>";
$db->free();
$db->free($result);
}
else
{
print $db->error() . ' ' . $sql;
dolibarr_print_error($db);
}
$db->close();

View File

@ -56,7 +56,7 @@ $sql .= " ORDER BY datec DESC LIMIT 5";
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
$var=True;
@ -68,7 +68,7 @@ if ($result)
while ($i < $num)
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]><td>";
@ -85,7 +85,7 @@ if ($result)
$i++;
}
print "</table>";
$db->free();
$db->free($result);
}
else
{

View File

@ -212,7 +212,7 @@ if ($_GET["id"])
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
$urladd = "&amp;id=".$_GET["id"];
@ -230,7 +230,7 @@ if ($_GET["id"])
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
print "<tr $bc[$var]><td>";
@ -253,11 +253,11 @@ if ($_GET["id"])
print "</table>";
$db->free();
$db->free($result);
}
else
{
print $db->error() . ' ' . $sql;
dolibarr_print_error($db);
}
$db->close();

View File

@ -118,7 +118,7 @@ $result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
$urladd = "&amp;id=".$_GET["id"];
@ -138,7 +138,7 @@ if ($result)
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
print "<tr $bc[$var]><td>";
@ -183,11 +183,11 @@ if ($result)
}
print "</table>";
$db->free();
$db->free($result);
}
else
{
print $db->error() . ' ' . $sql;
dolibarr_print_error($db);
}
$db->close();

View File

@ -72,7 +72,7 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
$urladd = "&amp;statut=".$_GET["statut"];
@ -106,7 +106,7 @@ if ($result)
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]><td>";
@ -128,11 +128,11 @@ if ($result)
$i++;
}
print "</table>";
$db->free();
$db->free($result);
}
else
{
print $db->error() . ' ' . $sql;
dolibarr_print_error($db);
}
$db->close();

View File

@ -77,7 +77,7 @@ $result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
$urladd = "&amp;socid=".$_GET["socid"];
@ -111,7 +111,7 @@ if ($result)
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
print "<tr $bc[$var]><td>";
@ -146,11 +146,11 @@ if ($result)
}
print "</table>";
$db->free();
$db->free($result);
}
else
{
print $db->error() . ' ' . $sql;
dolibarr_print_error($db);
}
$db->close();

View File

@ -91,7 +91,7 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
print_barre_liste("Prélèvements rejetés", $page, "rejets.php", $urladd, $sortfield, $sortorder, '', $num);
@ -109,7 +109,7 @@ if ($result)
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
print "<tr $bc[$var]><td>";
print '<img border="0" src="./statut'.$obj->statut.'.png"></a>&nbsp;';
@ -126,11 +126,11 @@ if ($result)
}
print "</table>";
$db->free();
$db->free($result);
}
else
{
print $db->error() . ' ' . $sql;
dolibarr_print_error($db);
}
$db->close();

View File

@ -89,13 +89,15 @@ if ($modecompta != 'CREANCES-DETTES') {
$sql .= " AND f.paye = 1";
}
$sql .= " GROUP BY dm DESC";
if ($db->query($sql))
$result=$db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
while ($i < $num)
{
$row = $db->fetch_object($i);
$row = $db->fetch_object($result);
$encaiss[$row->dm] = $row->amount_ht;
$encaiss_ttc[$row->dm] = $row->amount_ttc;
$i++;
@ -104,6 +106,7 @@ if ($db->query($sql))
else {
dolibarr_print_error($db);
}
$db->free($result);
/*
* Frais, factures fournisseurs.
@ -123,13 +126,14 @@ if ($modecompta != 'CREANCES-DETTES') {
}
$sql .= " GROUP BY dm DESC";
if ($db->query($sql))
$result=$db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
while ($i < $num)
{
$row = $db->fetch_object($i);
$row = $db->fetch_object($result);
$decaiss[$row->dm] = $row->amount_ht;
$decaiss_ttc[$row->dm] = $row->amount_ttc;
$i++;
@ -138,7 +142,7 @@ if ($db->query($sql))
else {
dolibarr_print_error($db);
}
$db->free($result);
/*
* Tableau

View File

@ -99,7 +99,7 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
$langs->load("orders");
@ -131,7 +131,7 @@ if ($result)
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]>";
@ -154,7 +154,7 @@ if ($result)
$i++;
}
print "</table>";
$db->free();
$db->free($result);
}
else
{

View File

@ -129,26 +129,29 @@ class Album {
$sql .= " WHERE g.rowid = l.fk_groupart AND l.fk_album = ".$this->id;
$sql .= " ORDER BY g.nom";
if ($this->db->query($sql) )
$result=$this->db->query($sql);
if ($result)
{
$nump = $this->db->num_rows();
$nump = $this->db->num_rows($result);
if ($nump)
{
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object($result);
$ga[$obj->rowid] = $obj->nom;
$i++;
}
$this->db->free($result);
}
return $ga;
}
else
{
print $this->db->error();
print $this->db->error();
return -1;
}
}
/*

View File

@ -159,33 +159,33 @@ class Categorie {
$sql .= " WHERE c.categories_id = cd.categories_id AND cd.language_id = ".OSC_LANGUAGE_ID;
$sql .= " AND c.parent_id = " . $this->id;
$sql .= " ORDER BY cd.categories_name";
if ($this->db->query($sql) )
$result=$this->db->query($sql);
if ($result)
{
$nump = $this->db->num_rows();
$nump = $this->db->num_rows($result);
if ($nump)
{
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object($result);
$ga[$obj->categories_id] = $obj->categories_name;
$i++;
}
$this->db->free($result);
}
return $ga;
}
else
{
print $this->db->error();
return -1;
}
}
/*
*
*
*
*/
/*
*
*

View File

@ -94,7 +94,7 @@ class Concert {
$result = $this->db->query($sql) ;
if ( $result ) {
$result = $this->db->fetch_array();
$result = $this->db->fetch_array($result);
$this->id = $result["rowid"];
$this->date = $result["dc"];
@ -103,18 +103,12 @@ class Concert {
$this->groupartid = $result["fk_groupart"];
$this->lieuid = $result["fk_lieu_concert"];
}
$this->db->free();
$this->db->free($result);
return $result;
return $this->id;
}
/*
*
*
*/
/*
*
*
@ -127,16 +121,17 @@ class Concert {
$sql .= " WHERE g.rowid = l.fk_groupart AND l.fk_album = ".$this->id;
$sql .= " ORDER BY g.nom";
if ($this->db->query($sql) )
$result=$this->db->query($sql);
if ($result)
{
$nump = $this->db->num_rows();
$nump = $this->db->num_rows($result);
if ($nump)
{
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object($result);
$ga[$obj->rowid] = $obj->nom;
$i++;
@ -147,6 +142,7 @@ class Concert {
else
{
print $this->db->error();
return -1;
}
}

View File

@ -128,16 +128,18 @@ class LieuConcert {
$sql = "SELECT rowid, nom, ville, description FROM ".MAIN_DB_PREFIX."lieu_concert";
$sql .= " ORDER BY ville, nom";
if ($this->db->query($sql) )
$result=$this->db->query($sql);
if ($result)
{
$nump = $this->db->num_rows();
$nump = $this->db->num_rows($result);
if ($nump)
{
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object($result);
$ga[$obj->rowid] = $obj->ville . " - " .$obj->nom;
$i++;
@ -148,6 +150,7 @@ class LieuConcert {
else
{
print $this->db->error();
return -1;
}
}

View File

@ -530,13 +530,14 @@ else
$sql = "SELECT s.idp, s.nom, s.ville FROM ".MAIN_DB_PREFIX."societe as s WHERE s.fournisseur=1";
$sql .= " ORDER BY lower(s.nom)";
if ($db->query($sql))
$result=$db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($i);
$obj = $db->fetch_object($result);
print '<option value="'.$obj->idp.'">'.$obj->nom . ($obj->ville?" ($obj->ville)":"");
$i++;
}

View File

@ -117,16 +117,17 @@ class Groupart {
$sql .= " WHERE a.rowid = l.fk_album AND l.fk_groupart = ".$this->id;
$sql .= " ORDER BY a.title";
if ($this->db->query($sql) )
$result=$this->db->query($sql);
if ($result)
{
$nump = $this->db->num_rows();
$nump = $this->db->num_rows($result);
if ($nump)
{
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object($result);
$ga[$obj->rowid] = $obj->title;
$i++;
@ -137,6 +138,7 @@ class Groupart {
else
{
print $this->db->error();
return -1;
}
}
/*
@ -165,16 +167,17 @@ class Groupart {
$sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."groupart ORDER BY nom";
if ($this->db->query($sql) )
$result=$this->db->query($sql);
if ($result)
{
$nump = $this->db->num_rows();
$nump = $this->db->num_rows($result);
if ($nump)
{
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object($result);
$ga[$obj->rowid] = $obj->nom;
$i++;
@ -185,6 +188,7 @@ class Groupart {
else
{
print $this->db->error();
return -1;
}
}

View File

@ -97,13 +97,13 @@ $result = $db->query($sql) ;
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
if ($num == 1 && (isset($sall) or isset($snom) or isset($sref)))
{
$objp = $db->fetch_object($i);
$objp = $db->fetch_object($result);
Header("Location: fiche.php?id=$objp->rowid");
}
@ -143,7 +143,7 @@ if ($result)
$var=True;
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\">$objp->ref</a></TD>\n";
@ -152,14 +152,14 @@ if ($result)
print "</TR>\n";
$i++;
}
$db->free();
$db->free($result);
print "</table>";
}
else
{
print $db->error() . "<br>" .$sql;
dolibarr_print_error($db);
}

View File

@ -141,21 +141,22 @@ class Project {
$propales = array();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."propal WHERE fk_projet=$this->id;";
if ($this->db->query($sql) )
$result=$this->db->query($sql);
if ($result)
{
$nump = $this->db->num_rows();
$nump = $this->db->num_rows($result);
if ($nump)
{
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object($result);
$propales[$i] = $obj->rowid;
$i++;
}
$this->db->free();
$this->db->free($result);
/*
* Retourne un tableau contenant la liste des propales associees
*/
@ -164,7 +165,7 @@ class Project {
}
else
{
print $this->db->error() . '<br>' .$sql;
dolibarr_print_error($this->db);
}
}
/*
@ -177,21 +178,22 @@ class Project {
$factures = array();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture WHERE fk_projet=$this->id;";
if ($this->db->query($sql) )
$result=$this->db->query($sql);
if ($result)
{
$nump = $this->db->num_rows();
$nump = $this->db->num_rows($result);
if ($nump)
{
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object($result);
$factures[$i] = $obj->rowid;
$i++;
}
$this->db->free();
$this->db->free($result);
/*
* Retourne un tableau contenant la liste des factures associees
*/
@ -200,7 +202,7 @@ class Project {
}
else
{
print $this->db->error() . '<br>' .$sql;
dolibarr_print_error($this->db);
}
}
/**
@ -213,21 +215,22 @@ class Project {
$commandes = array();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande WHERE fk_projet=$this->id;";
if ($this->db->query($sql) )
$result=$this->db->query($sql);
if ($result)
{
$nump = $this->db->num_rows();
$nump = $this->db->num_rows($result);
if ($nump)
{
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$obj = $this->db->fetch_object($result);
$commandes[$i] = $obj->rowid;
$i++;
}
$this->db->free();
$this->db->free($result);
/*
* Retourne un tableau contenant la liste des commandes associees
*/
@ -236,7 +239,7 @@ class Project {
}
else
{
print $this->db->error() . '<br>' .$sql;
dolibarr_print_error($this->db);
}
}