I am trying to get list of queried results on a table inside a model. When a user clicks the month on a table, the details of sales for that month should show on the appeared model.
I have designed the first table which runs fine, but the problem is that when the month is click, the details for that month does not populate.
The first table which runs fine is...
<table class="table table-striped table-bordered">
<thead>
<th>Month</th><th>Duration</th><th>Target</th><th>Target Amount</th><th>Target Achieved</th><th>Target Deficit</th><th>Status</th>
</thead>
<tbody>
<!--{foreach $monthtags1 as $monthtags1x}-->
<tr>
<td><a data-toggle="modal" id="month_click" href="#myModal"><!--{$monthtags1x->month}--></td>
<td><!--{$monthtags1x->duration}--></td>
<td><!--{$monthtags1x->type}--></td>
<td>₦<!--{$monthtags1x->target_amount}--></td>
<td>₦<!--{$monthtags1x->target_achieved}--></td>
<td>₦<!--{$monthtags1x->target_deficit}--></td>
<td><!--{$monthtags1x->status}--></td>
</tr>
<!--{/foreach}-->
</tbody>
</table>
And the following for the modal
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Month Name</h4>
</div>
<div class="modal-body">
<table class="table table-striped table-bordered">
<thead>
<th>Target</th><th>Client Name</th><th>Amount</th><th>Date</th>
</thead>
<tbody>
<!--{foreach $remits as $remitt}-->
<tr>
<td><!--{$remitt->type}--></td><td><!--{$remitt->client_name}--></td>
<td>₦<!--{$remitt->amount}--></td><td><!--{$remitt->date_created|date_format:"%A, %B %e, %Y"}--></td>
</tr>
<!--{/foreach}-->
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
The first table displays the monthly sales, however, I want the second to show the details on the month sale with the month name as the title