以模态打开远程URL

时间:2014-12-09 15:33:20

标签: php mysql twitter-bootstrap bootstrap-modal

我需要一个帮助。

我有一个应用程序 - 它从MySQL查询一些数据并将其显示在表(index.php文件)中。每一行都是一个客户记录。  我想要做的是,当我点击该行时,它会打开客户记录(customer.php文件)。

我尝试了下面的代码 - 当我点击行时,带有远程页面的模态(customer.php只闪烁,然后customer.php正常加载。我不知道为什么......有没有人知道?

<table class="table table-hover container table-responsive">
        <caption>Vyhledaní zákazníci</caption>
        <thead>
          <tr>
            <th>Jméno</th>
            <th>Příjmení</th>
            <th>Email</th>
            <th>Telefon</th>
            <th>Adresa</th>
            <th>Město</th>
            <th>Akce</th>
          </tr>
        </thead>
        <tbody>

    <?php

        while ($results = mysql_fetch_array($customers)) { ?>
          <tr class="clickableRow active" href="customer.php?customerId=<?php echo $results['id'], '&search=', Input::get('search'); ?>" data-toggle="modal" data-target="#customerModal">
            <td><?php echo $results['first_name']; ?> </td>
            <td><?php echo $results['last_name']; ?> </td>
            <td><?php echo $results['email']; ?> </td>
            <td><?php echo $results['telephone']; ?> </td>
            <td><?php echo $results['street']; ?> </td>
            <td><?php echo $results['city']; ?> </td>
            <td><a href="list.php?customerId=<?php echo $results['id'], '&search=', Input::get('search'); ?>" class="btn btn-success">Seznam zakázek</a>
              <a href="new-order.php?customerId=<?php echo $results['id'], '&search=', Input::get('search'); ?>" class="btn btn-warning">Nová zakázka</a>
          </tr>
       <?php 
     } ?>

        </tbody>
      </table>

模态:

<!-- Modal -->
<div class="modal fade" id="customerModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
             <h4 class="modal-title">Karta zákazníka</h4>

        </div>
        <div class="modal-body"><div class="te"></div></div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            <button type="button" class="btn btn-primary">Save changes</button>
        </div>
    </div>
    <!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->

0 个答案:

没有答案