1
I have three tables: Process, Progress and Costs: how do I display the data of the three in a View, and the tables Tempo and Custas have as a foreign key, the primary Process key?
I made a foreach for each table, but it didn’t work, keeps duplicating the data.
<div class="row">
<strong>Sentença/Acórdão:</strong>
<?php echo $processo[0]->sentenca; ?>
</div>
<br>
<div class="row">
<p><font size="3" face="helvetica"><strong>Andamentos</strong></font></p>
</div>
<div class="row">
<div class="table-responsive">
<button type="submit" class="btn btn-primary hidden-print" data-toggle="modal" data-target=".addandamento"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
<table class="table table-striped">
<?php foreach ($processo as $proc) { ?>
<tr class="row">
<td width="14%"><font color="#000000" size="2" face="tahoma"><b><?= $proc->dtandamento; ?></b></font></td>
<td width="78%"><font color="#000000" size="2" face="tahoma"><b><?= $proc->descricao; ?></b></font></td>
</tr>
<?php } ?>
</table>
</div>
</div>
<div class="row">
<div class="table-responsive">
<button type="submit" class="btn btn-primary hidden-print" data-toggle="modal" data-target=".addandamento"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
<table class="table table-striped">
<?php foreach ($processo as $proc) { ?>
<tr class="row">
<td width="14%"><font color="#000000" size="2" face="tahoma"><b><?= $proc->dtcustas; ?></b></font></td>
<td width="78%"><font color="#000000" size="2" face="tahoma"><b><?= $proc->descricao_custas; ?></b></font></td>
</tr>
<?php } ?>
</table>
</div>
</div>
How did you pass the data to view? Enter your code!
– Sr. André Baill
@Andrébaill put the view code in the question.
– Ramiro
Ok and the controller and model code?
– Sr. André Baill