I have a problem about to view or prompt a delete text confirmation, can I use the modal in bootstrap in prompt as a delete?
I try and it can delete but in the first "id" only not in specific id and I don't know what to do to make specific id.
here is my view:
<div class="table-responsive">
<?php if(sizeof($query) < 1) : ?>
No record in the database.
<?php else : ?>
<table class="table table-hover">
<thead>
<tr>
<th>ID</th>
<th>TITLE</th>
<th>CONTENT</th>
<th>LAST UPDATE</th>
<th>ACTIONS</th>
</tr>
</thead>
<tbody>
<?php foreach($query as $record) : ?>
<tr>
<td><?php echo $record->Id; ?></td>
<td><?php echo word_limiter($record->Title, 5); ?></td>
<td><?php echo word_limiter($record->Paragraph, 15); ?></td>
<td><?php echo $record->Lastupdate; ?></td>
<td>
<div class="btn-group btn-group-sm">
<a href="<?php echo base_url('gallery/view').'/'.$record->Id; ?>" class="btn btn-info">View</a>
<a href="#" class="btn btn-success">Edit</a>
<a href="" class="btn btn-danger" data-toggle="modal" data-target="#myModal">Delete</a>
</div>
</td>
</tr>
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Delete</h4>
</div>
<div class="modal-body">
<p>Are you sure want to delete? </p>
</div>
<div class="modal-footer">
<a href="<?php echo base_url('Mywelcomepage/deletez').'/'.$record->Id; ?>" class="btn btn-default" >Yes</a>
<button type="button" class="btn btn-default" data-dismiss="modal">No</button>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>