|
|
|
ขอสอบถามการส่งค่า php ไปยัง Bootstrap Modal เพื่อนำค่า php ไปคิวรี่ข้อมูลเพื่อแสดงผลใน Modal |
|
|
|
|
|
|
|
งงกับคำถาม ไม่รู้จะตอบยังไง
|
|
|
|
|
Date :
2017-08-03 16:05:03 |
By :
Bouasavanh HararRock |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<a href="#" onclick="load_data('<?php print $u_id; ?>','<?php print $cid; ?>');" data-toggle="modal"
data-target=".bs-example-modal-table"><?php echo $row['title'];?></a>
//modal
<div class="modal fade bs-example-modal-table" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="panel">
<div class="panel-heading">
<div class="pull-left">
<h4 class="modal-title">Detail</h4>
</div>
<div class="clearfix"></div>
</div>
<div class="panel-body no-padding">
<div class="table-responsive" >
<div id="divDataview">
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
//script
<script type="text/javascript">
function load_leave_data( u_id, cid,) {
var sdata = {
u_id: u_id,
cid: cid
};
$('#divDataview').load('show.php', sdata);
}
</script>
//หน้า show.php
$u_id=$_POST['u_id'];
$cid=$_POST['cid'];
//แสดงข้อมูล select ตามเงือนไข
|
|
|
|
|
Date :
2017-08-04 09:35:10 |
By :
Pong Thep |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|