496 |
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_import_cdr as t"; |
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_import_cdr as t"; |
497 |
$sql .= " WHERE t.fk_ligne = ".$ligne->id; |
$sql .= " WHERE t.fk_ligne = ".$ligne->id; |
498 |
|
|
499 |
if ( $db->query($sql) ) |
$resql = $db->query($sql); |
500 |
|
|
501 |
|
if ($resql) |
502 |
{ |
{ |
503 |
$num_sql = $db->num_rows(); |
$num_sql = $db->num_rows($resql); |
504 |
$i = 0; |
$i = 0; |
505 |
|
|
506 |
while ($i < $num_sql && $error == 0) |
while ($i < $num_sql && $error == 0) |
507 |
{ |
{ |
508 |
$objp = $db->fetch_object($i); |
$objp = $db->fetch_object($resql); |
509 |
|
|
510 |
$comm = new CommunicationTelephonique(); |
$comm = new CommunicationTelephonique(); |
511 |
|
|
512 |
$comm->index = $objp->idx; |
$comm->index = $objp->idx; |
513 |
$comm->fk_ligne = $facture_id; |
$comm->fk_ligne = $objp->fk_ligne; |
514 |
$comm->ligne = $objp->ligne; |
$comm->ligne = $objp->ligne; |
515 |
$comm->date = $objp->date; |
$comm->date = $objp->date; |
516 |
$comm->heure = $objp->heure; |
$comm->heure = $objp->heure; |
527 |
$i++; |
$i++; |
528 |
} |
} |
529 |
|
|
530 |
$db->free(); |
$db->free($resql); |
531 |
} |
} |
532 |
else |
else |
533 |
{ |
{ |