<?php
require_once __DIR__ . '/../../../app/Models/JournalLine.php';
$line = new JournalLine();
$rows = $line->getByJournalId((int)$_GET['journal_id']);
foreach($rows as $r): ?>
<tr>
  <td><?= htmlspecialchars($r['account_code']) ?></td>
  <td><?= htmlspecialchars($r['line_description']) ?></td>
  <td class="debit text-right"><?= number_format($r['debit'],2) ?></td>
  <td class="credit text-right"><?= number_format($r['credit'],2) ?></td>
  <td><button class="btn btn-sm btn-danger deleteLine" data-id="<?= $r['id'] ?>"><i class="fas fa-trash"></i></button></td>
</tr>
<?php endforeach; ?>
