Javascript 尝试打开具有特定用户ID的模式

Javascript 尝试打开具有特定用户ID的模式,javascript,php,html,jquery,css,Javascript,Php,Html,Jquery,Css,我已经和一些员工做了一张表,我正在使用modals来添加新的/详细信息/编辑/删除 我不知道如何打开特定用户的详细信息模式。。。[使用引导5] 这是按钮: <td method="MODAL"><button type="button" class="btn btn-sm btn-block btn-info" data-id="<?php echo $employee['e_id']; ?>&q

我已经和一些员工做了一张表,我正在使用modals来添加新的/详细信息/编辑/删除

我不知道如何打开特定用户的详细信息模式。。。[使用引导5]

这是按钮:

<td method="MODAL"><button type="button" class="btn btn-sm btn-block btn-info" data-id="<?php echo $employee['e_id']; ?>" data-toggle="modal" data-target="#designerDetails">Details</button></td>

名称
电子邮件地址
电话号码

您可以通过以下方式完成。但是,如果您有大量数据,这种方法不适合,您可能必须使用aJax来加载数据

<td><button type="button" class="btn btn-sm btn-block btn-info " data-id="<?php echo $employee['e_id']; ?>" data-name="<?php echo $employee['e_name']; ?>" data-email="<?php echo $employee['e_email']; ?>" data-phone="<?php echo $employee['e_phone']; ?>" 
>Details</button></td>

这将不起作用..或者使用jquery设置tds的值..或者使用ajax填充modal..例如:将
id
传递到后端并获取相关数据。这里唯一的问题是,我是后端的初学者,我知道要做的唯一正确的事情就是使用php创建登录/注册页面,并将它们存储到mysql中,仅此而已。。。所以我想我会继续重定向到具有唯一用户id的新页面,以显示详细信息或编辑它们,直到我学会一些高级技术。
<td><button type="button" class="btn btn-sm btn-block btn-info " data-id="<?php echo $employee['e_id']; ?>" data-name="<?php echo $employee['e_name']; ?>" data-email="<?php echo $employee['e_email']; ?>" data-phone="<?php echo $employee['e_phone']; ?>" 
>Details</button></td>
<div class="modal fade" id="designerDetails" tabindex="-1" aria-labelledby="designerDetails" aria-hidden="true">
<div class="modal-dialog">
  <div class="modal-content">
    <div class="modal-header">
      <h5 class="modal-title" id="exampleModalLabel">Designer details</h5>
      <button type="button" class="btn-close" data-dismiss="modal" aria-label="Close"></button>
    </div>
    <div class="modal-body">
         <table class="table">
             <tr>
                 <th>ID</th>
                 <td id="e_id"></td>
             </tr>
             <tr>
                 <th>Name</th>
                 <td id="e_name"></td>
             </tr>
             <tr>
                 <th>Email adress</th>
                 <td id="e_email"></td>
             </tr>
             <tr>
                 <th>Phone number</th>
                 <td id="e_phone"></td>
             </tr>
         </table>
    </div>
  </div>
</div>
$(document).on('click','.designerDetails', function(event) { 
    $('#e_id').html($(this).data('id'));
    $('#e_name').html($(this).data('name'));
    $('#e_email').html($(this).data('email'));
    $('#e_phone').html($(this).data('phone'));
    $('#designerDetails').modal('show');
});