bug fix
This commit is contained in:
parent
4c0f17c8d8
commit
bb91523500
@ -151,25 +151,33 @@ class Contrat
|
|||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
$num = $this->db->num_rows();
|
$num = $this->db->num_rows();
|
||||||
$i = 0;
|
|
||||||
|
|
||||||
while ($i < $num)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
$objp = $this->db->fetch_object($i);
|
$i = 0;
|
||||||
$contrats[$i] = $objp->rowid;
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->db->free();
|
while ($i < $num)
|
||||||
|
|
||||||
while (list($key, $value) = each ($contrats))
|
|
||||||
{
|
|
||||||
$sql = "INSERT INTO llx_contrat (fk_product, fk_facture, fk_soc, fk_user_author)";
|
|
||||||
$sql .= " VALUES ($value, $factureid, $socid, $user->id)";
|
|
||||||
if (! $this->db->query($sql))
|
|
||||||
{
|
{
|
||||||
print $this->db->error();
|
$objp = $this->db->fetch_object($i);
|
||||||
|
$contrats[$i] = $objp->rowid;
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->db->free();
|
||||||
|
|
||||||
|
while (list($key, $value) = each ($contrats))
|
||||||
|
{
|
||||||
|
$sql = "INSERT INTO llx_contrat (fk_product, fk_facture, fk_soc, fk_user_author)";
|
||||||
|
$sql .= " VALUES ($value, $factureid, $socid, $user->id)";
|
||||||
|
if (! $this->db->query($sql))
|
||||||
|
{
|
||||||
|
print $this->db->error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->db->free();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user