php - Bootstrap show info based on id in modal -
i want show more info file database using modal instead adding more columns table, , instead of opening new page. here code
<table id="file" class="table table-bordered table-striped table-hover"> <?php $result = mysql_query("select * files") ?> <thead> <tr> <th>id <i class="fa fa-sort"></i></th> <th>name <i class="fa fa-sort"></i></th> <th>size <i class="fa fa-sort"></i></th> <th>delete </th> </tr> </thead> <tbody> <?php while($row = mysql_fetch_array( $result )) { ?> <tr class="record"> <td><?php echo $row['id'];?></td> <td><?php echo $row['name']; ?> </td> <td><?php echo $row['size']; ?> </td> <td><div align="center"><a href="#" id="<?php echo $row['id'] ?>" class="infobutton fa fa-times" title="info"></a></div></td> <td><div align="center"><a href="#" id="<?php echo $row['id'] ?>" class="delbutton fa fa-times" title="click delete"></a></div></td> </tr> <?php } ?> </tbody> </table> thanks in advance. if there other way place it.
you can replace following data-target , modal id php, if mean.
<!--this calls modal data-target id --> <a data-toggle="modal" data-target="#mymodal">this link calls modal</a> <!--modal content--> <div class="modal fade" id="mymodal" 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">×</button> <h4 class="modal-title" id="mymodallabel"></h4> </div> <div class="modal-body"> <!-- content goes here --> </div> <div class="modal-footer"> <center><button type="button" class="btn btn-default" data-dismiss="modal">cancel</button></center> </div> </div>
Comments
Post a Comment