douhuan1950 2019-05-14 18:36
浏览 50

如何通过同一页面内的链接将标题和其他MySQL查询结果发送到HTML中的数据模型

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">&times;</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

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 BP神经网络控制倒立摆
    • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
    • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
    • ¥30 Unity接入微信SDK 无法开启摄像头
    • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
    • ¥20 cad图纸,chx-3六轴码垛机器人
    • ¥15 移动摄像头专网需要解vlan
    • ¥20 access多表提取相同字段数据并合并
    • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
    • ¥20 Java-Oj-桌布的计算