How to use jquery-confirm in codeigniter? - javascript

I've been trying to use jquery-confirm that is provided by https://craftpip.github.io/jquery-confirm/#ajaxloading . There's no error, but once I tried to delete an, item, the jquery pops up an alert, but when I click "okay" it doesn't delete the item..I don't know where the mistake is. Thanks for the help
This is the php code:
<div class="box">
<div class="box-body">
Input Request
<br><br>
<table id="tabelrequest" class="table table-bordered table-striped">
<thead>
<tr>
<th>No.</th>
<th>Item Code</th>
<th>Description</th>
<th>Qty</th>
<th>Delete</th>
<th>Edit</th>
<th>Photo</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
foreach($allrequest as $request)
{
$delete_url = base_url().'admin/deleterequest/'.$request->id_request;
$update_url = base_url().'admin/updaterequest/'.$request->id_request;
$add_url = base_url().'admin/datafotorequest/'.$request->id_request;
?>
<tr>
<td><?php echo $no; ?></td>
<td><?php echo $request->item_code; ?></td>
<td><?php echo $request->description; ?></td>
<td><?php echo $request->qty; ?></td>
<td class="col-xs-1" style="text-align: center;"><a class="btn bg-olive btn-flat" class="delete" data-title="Are you sure you want to delete this item?" name="delete" href="<?php echo $delete_url; ?>"><i class="glyphicon glyphicon-trash"></i></a></td>
<td class="col-xs-1" style="text-align: center;"><a class="btn bg-teal btn-flat" name="update" href="<?php echo $update_url; ?>"><i class="glyphicon glyphicon-pencil"></i></a></td>
<td class="col-xs-1" style="text-align: center;"><a class="btn bg-red btn-flat" name="add" href="<?php echo $add_url; ?>"><i class="glyphicon glyphicon-camera"></i></a></td>
</tr>
<?php
$no++;
}
?>
</tbody>
</table>
</div>
</div>
And this is the jquery I took from jquery-confirms.js
<script>
$('#delete').confirm({
content: "",
});
$('#delete').confirm({
buttons: {
hey: function(){
location.href = this.$target.attr('href');
}
}
});
</script>

Instead of this
<td class="col-xs-1" style="text-align: center;">
<a class="btn bg-olive btn-flat" class="delete" data-title="Are you sure you want to delete this item?" name="delete" href="<?php echo $delete_url; ?>">
<i class="glyphicon glyphicon-trash"></i>
</a>
</td>
I'll use (onclick="return confirm()")
<td class="col-xs-1" style="text-align: center;">
<a class="btn bg-olive btn-flat" class="delete" onclick="return confirm('Are you sure you want to delete this item?');" href="<?php echo $delete_url; ?>">
<i class="glyphicon glyphicon-trash"></i>
</a>
</td>

I think you have to use like this
<div class="box">
<div class="box-body">
Input Request
<br><br>
<table id="tabelrequest" class="table table-bordered table-striped">
<thead>
<tr>
<th>No.</th>
<th>Item Code</th>
<th>Description</th>
<th>Qty</th>
<th>Delete</th>
<th>Edit</th>
<th>Photo</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
foreach($allrequest as $request)
{
$delete_url = base_url().'admin/deleterequest/'.$request->id_request;
$update_url = base_url().'admin/updaterequest/'.$request->id_request;
$add_url = base_url().'admin/datafotorequest/'.$request->id_request;
?>
<tr>
<td><?php echo $no; ?></td>
<td><?php echo $request->item_code; ?></td>
<td><?php echo $request->description; ?></td>
<td><?php echo $request->qty; ?></td>
<td class="col-xs-1" style="text-align: center;"><a class="btn bg-olive btn-flat delete" data-title="Are you sure you want to delete this item?" name="delete" href="<?php echo $delete_url; ?>"><i class="glyphicon glyphicon-trash"></i></a></td>
<td class="col-xs-1" style="text-align: center;"><a class="btn bg-teal btn-flat" name="update" href="<?php echo $update_url; ?>"><i class="glyphicon glyphicon-pencil"></i></a></td>
<td class="col-xs-1" style="text-align: center;"><a class="btn bg-red btn-flat" name="add" href="<?php echo $add_url; ?>"><i class="glyphicon glyphicon-camera"></i></a></td>
</tr>
<?php
$no++;
}
?>
</tbody>
</table>
</div>
</div>
<script>
$('.delete').confirm({
content: "",
});
$('.delete').confirm({
buttons: {
hey: function(){
location.href = this.$target.attr('href');
}
}
});
</script>

You need to create ajax request
HTML
<td class="col-xs-1" style="text-align: center;"><a class="btn bg-olive btn-flat" class="delete" data-title="Are you sure you want to delete this item?" name="delete" href="#" onclick="deleteRecord('<?php echo $request->id_request;?>');"><i class="glyphicon glyphicon-trash"></i></a></td>
AJAX
function deleteRecord(id)
{
jQuery.ajax({
type: "GET",
url: '/admin/deleterequest/'+id,
async: false,
success: function (data)
{
alert('success');
}
});
}

Related

How to pass request Id value to modal?

When I click on 'edit' button modal is open
but in a hidden field no I can't receive RequestId.
Please help me how to pass dynamic requested to modal form?
This I will use in Codeigniter framework.
If it is possible to please rewrite the code I will be most helpful.
<table width="100%" class="table table-striped">
<thead class="thead-dark">
<tr>
<th scope="col" align="left">#</th>
<th scope="col">Request Id</th>
<th scope="col">Agent Id</th>
<th scope="col">Type</th>
<th scope="col">Value</th>
<th scope="col">Comment</th>
<th scope="col"> Request Date & Time</th>
<th scope="col">Status</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody>
<?php
$sn=1;
foreach ($result as $row) {
//print_r($row);die();
?>
<tr>
<td align="left"><?php echo $sn ?></td>
<td><?php echo $row['rid'];?></td>
<td><?php echo $row['aid'];?></td>
<td><?php echo $row['type'];?></td>
<td><?php echo $row['value'];?></td>
<td><?php echo $row['comment'];?></td>
<td><?php echo $row['request_time'];?></td>
<td><button class="btn btn-danger btn-sm">Open</button></td>
<td>
<a data-toggle="modal" href="<?php base_url()?>#myModal" class="btn btn-warning btn-sm">Edit</a>
</td>
</tr>
<?php $sn++;}?>
</tbody>
</table>
If I am right, you wanted to display a modal after clicks on the edit button.
Edit
I hope $row['rid'] is your unique ID and here is a html modal code
<div class="modal" id="detail_modal_pop" style="overflow: scroll;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header" >
<button type="button" class="close close_c_modal" >×</button>
<h4 class="modal-title c_modal">Details</h4>
</div>
<div class="modal-body">
<h6 id="load_wait" class="text-center">Please wait...</h6>
<div id="detail_modal_pop_result" style="display:none;"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default close_c_modal" >Close</button>
</div>
</div>
</div>
</div>
To display a modal on clicks on edit button, use below script
<script>
function get_modal_details(rid)
{
$('#detail_modal_pop').fadeIn(200);
$("#detail_modal_pop_result").hide();
$("#load_wait").show();
jQuery.ajax({
url: "<?php echo base_url() ?>some_controller/controller_method",
data: { rid: rid },
type: "POST",
success:function(data){
$("#load_wait").hide();
$("#detail_modal_pop_result").show();
$("#detail_modal_pop_result").html(data);
},
error:function (){}
});
}
$(".close_c_modal").on("click", function()
{
$('#detail_modal_pop').fadeOut(200);
$("#detail_modal_pop_result").hide(300);
$('#detail_modal_pop_result').html('');
$("#load_wait").show(300);
});
</script>
And here is the PHP code
<?php
//"Some_controller.php" Controller
public function controller_method()
{
if(isset($_POST['rid']))
{
$rid = (int)$_POST['rid'];
// $get_info = $this->Model->get_info($rid);
// Write modal content here...
}
}
?>
Hope this will help you.
You could add
data-request-id="<?php echo $row['rid']?>"
to the buttons that open the modals, and than use jquery/javascript to fetch the data with ajax
var requestId = $('.modalBtn').attr("data-request-id");
The is a sample to pass the ID to modal by using HTML data-attributes & jQuery.
<table width="100%" class="table table-striped">
<thead class="thead-dark">
<tr>
<th scope="col" align="left">#</th>
<th scope="col">Request Id</th>
<th scope="col">Agent Id</th>
<th scope="col">Type</th>
<th scope="col">Value</th>
<th scope="col">Comment</th>
<th scope="col"> Request Date & Time</th>
<th scope="col">Status</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody>
<?php
$sn=1;
foreach ($result as $row) {
//print_r($row);die();
?>
<tr>
<td align="left"><?php echo $sn ?></td>
<td><?php echo $row['rid'];?></td>
<td><?php echo $row['aid'];?></td>
<td><?php echo $row['type'];?></td>
<td><?php echo $row['value'];?></td>
<td><?php echo $row['comment'];?></td>
<td><?php echo $row['request_time'];?></td>
<td><button class="btn btn-danger btn-sm">Open</button></td>
<td>
Edit
</td>
</tr>
<?php
$sn++;
}?>
</tbody>
</table>
<script>
$('#myModal').on('show.bs.modal', function (e) {
var $btn = e.relatedTarget,
rId = $btn.data('id');
// "rId" would be the value from the html data-attribute.
console.log(rId);
});
</script>
<table width="100%" class="table table-striped">
<thead class="thead-dark">
<tr>
<th scope="col" align="left">#</th>
<th scope="col">Request Id</th>
<th scope="col">Agent Id</th>
<th scope="col">Type</th>
<th scope="col">Value</th>
<th scope="col">Comment</th>
<th scope="col"> Request Date & Time</th>
<th scope="col">Status</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody>
<?php
$sn=1;
foreach ($result as $row) {
//print_r($row);die();
?>
<tr>
<td align="left"><?php echo $sn ?></td>
<td><?php echo $row['rid'];?></td>
<td><?php echo $row['aid'];?></td>
<td><?php echo $row['type'];?></td>
<td><?php echo $row['value'];?></td>
<td><?php echo $row['comment'];?></td>
<td><?php echo $row['request_time'];?></td>
<td><button class="btn btn-danger btn-sm">Open</button></td>
<td>
<a onclick="load_item('<?php echo $row['rid'];?>');" class="btn btn-warning btn-sm">Edit</a>
</td>
</tr>
<?php $sn++;}?>
</tbody>
</table>
Javascript Code You had to insert
function load_item(rid){
/**
Write your ajax/javascript code here
*/
$("#myModal").modal("show");
}
Remove data-toggle="modal" from <a> tag and make onclick edit based on ID
<td>
<a id="edit-form" href="#" class="btn btn-warning btn-sm">Edit</a>
</td>
JS
$('#edit-form').click(function() {
$('#hidden_field_id').val(your-value);
$('#myModal').modal('show');
});

Bootstrap dataTable not working with database in Codeigniter

I am new in bootstrap and codeigniter, I don't know why dataTable not working with codeigniter.
I've tried to use it just in Bootstrap. It's working fine (pagination, data entry, sorting, and searching). But when I use it in Codeigniter with same code in my View file, it seems like datatable is not working. It does load the data, but the features (pagination, data entry, sorting, and searching) is not showing.
anybody can help me? thanks a bunches !
my old file using Bootstrap only
<table id="myTable" class="table table-hover">
<thead>
<tr>
<th>No</th>
<th>Nama</th>
<th>NPM</th>
<th>Kelas</th>
<th>MP</th>
<th>PK</th>
<th>Pesan</th>
</tr>
</thead>
<tbodys>
<?php $no=0 ; $sql=m ysqli_query($con, "SELECT * FROM form"); while($row=m ysqli_fetch_array($sql)){ $no++; ?>
<tr>
<td>
<?php echo $no ?>
</td>
<td>
<?php echo $row[ 'Nama'] ?>
</td>
<td>
<?php echo $row[ 'NPM'] ?>
</td>
<td>
<?php echo $row[ 'Kelas'] ?>
</td>
<td>
<?php echo $row[ 'MP'] ?>
</td>
<td>
<?php echo $row[ 'PK'] ?>
</td>
<td>
<?php echo $row[ 'Pesan'] ?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<script>
$(document).ready(function() {
$('#myTable').DataTable();
});
</script>
here is my View file in Codeigniter + Bootstrap
<script type="text/javascript">
jQuery(function($) {
var oTable1 =
$('#dynamic-table')
.dataTable({
bAutoWidth: false,
"aoColumns": [{
"bSortable": false
},
null, null, null, null, null, null, null, {
"bSortable": false
}
],
"aaSorting": [],
});
</script>
<table id="dynamic-table" method="post" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>No</th>
<th>Nama Lengkap</th>
<th>Tanggal Mulai</th>
<th>Tanggal Akhir</th>
<th>Alasan</th>
<th>File</th>
<th>Nopeg</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php foreach ($hasil->result() as $row) { ?>
<tr>
<td>
<?php echo $row->no ?></td>
<td>
<?php echo $row->nama ?></td>
<td>
<?php echo $row->tglm ?></td>
<td>
<?php echo $row->tgla ?></td>
<td>
<?php echo $row->alasan ?></td>
<td>
<a class="thumbnail" href="<?php echo base_url().'uploads/'.$row->file ?>">
<img src="<?php echo base_url().'uploads/'.$row->file ?>" width="50" height="50">
</a>
</td>
<td>
<?php echo $row->nopeg; ?></td>
<td>
<button type="button" class="btn btn-pink btn-sm">Terima</button>
<button type="button" class="btn btn-info btn-sm">Tolak</button>
</td>
</tr>
<?php } ?>
</tbody>
</table>
the dataTable include in its template, before I display data from database, it working. But when I display data from database, it just a normal table
Put javascript code after end of table tag,
<table id="dynamic-table" method="post" class="table table-striped table- bordered table-hover">
<thead>
<tr>
<th>No</th>
<th>Nama Lengkap</th>
<th>Tanggal Mulai</th>
<th>Tanggal Akhir</th>
<th>Alasan</th>
<th>File</th>
<th>Nopeg</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php foreach ($hasil->result() as $row) { ?>
<tr>
<td>
<?php echo $row->no ?></td>
<td>
<?php echo $row->nama ?></td>
<td>
<?php echo $row->tglm ?></td>
<td>
<?php echo $row->tgla ?></td>
<td>
<?php echo $row->alasan ?></td>
<td>
<a class="thumbnail" href="<?php echo base_url().'uploads/'.$row->file ?>">
<img src="<?php echo base_url().'uploads/'.$row->file ?>" width="50" height="50">
</a>
</td>
<td>
<?php echo $row->nopeg; ?></td>
<td>
<button type="button" class="btn btn-pink btn-sm">Terima</button>
<button type="button" class="btn btn-info btn-sm">Tolak</button>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<script type="text/javascript">
jQuery(function($) {
var oTable1 =
$('#dynamic-table')
.dataTable({
bAutoWidth: false,
"aoColumns": [{
"bSortable": false
},
null, null, null, null, null, null, null, {
"bSortable": false
}
],
"aaSorting": [],
});
</script>
Try like this :)

How to retrieve dynamic records based on ID in bootstrap modals

There are two tables PFI and PFI_details. PFI table stores client_id, pfi_id and PFI_details table stores the PFI details like pfi_id, description, quantity, rate and amount.
I want to display the PFI_details data along side PFI data. I am using Bootstrap Tables to display my data. See tables below:
PFI records
PFI_details records:
First Record
Second Record
NOTE: See the title in the modal PFI Details for PFI_ID
My Controller:
$this->data['pfis'] = $this->pfis_model->getPFI();
$this->data['pfi_details'] = $this->pfis_model->getPFIDetails();
My View:
<?php if (isset($pfis)) : ?>
<table class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead>
<tr>
<th>Client</th>
<th>PFI ID</th>
<!-- <th>PFI DOC</th> -->
<th>Managed By</th>
<th>PFI Details</th>
<th>PFI Export</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($pfis as $pfi) : ?>
<tr>
<td><?php echo $pfi->client_name; ?></td>
<td><?php echo $pfi->pfi_id; ?></td>
<!-- <td><?php //echo $pfi->pfi_upload; ?></td> -->
<td><?php if ($pfi->managed_by === '2') {echo 'Admin';}?></td>
<td>
<button class="btn btn-primary btn-sm modal-toggler" data-id="<?php echo $pfi_id = $pfi->pfi_id;?>" data-toggle="modal" data-target="#viewPFIDetailsModal">View Details</button>
<!-- Modal -->
<div class="modal fade" id="viewPFIDetailsModal" 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">PFI Details for <span id="pfi"></span></h4>
</div>
<div class="modal-body">
<div class="table-responsive" style="overflow:scroll;">
<table class="table table-striped">
<tr>
<th>PFI ID</th>
<th>Description</th>
<th style="text-align:center;">Quantity</th>
<th style="text-align:center;">Rate</th>
<th style="text-align:center;">Amount</th>
</tr>
<?php if (isset($pfi_details)):?>
<?php foreach ($pfi_details as $pd) :?>
<?php if ($pfi_id == $pd->pfi_id):?>
<tr>
<td><?php echo $pd->pfi_id;?></td>
<td><?php echo $pd->description;?></td>
<td style="text-align:center;"><?php echo number_format($pd->quantity);?></td>
<td style="text-align:right;"><?php echo number_format($pd->rate);?></td>
<td style="text-align:right;"><?php echo number_format($pd->amount);?></td>
</tr>
<?php endif;?>
<?php endforeach;?>
<?php endif;?>
</table>
</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 -->
</div>
<!-- /.modal -->
</td>
<td><i class="fa fa-print fa-fw"></i> Print</td>
<td>
<!-- Edit -->
<i class="fa fa-times fa-fw"></i> Delete
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
My JavaScript:
$(".modal-toggler").click(function(){
var pfi_id = $(this).attr("data-id");
$('#pfi').text(pfi_id);
});
How do I go about fixing this?
Any help is appreciated.

unable to auto refresh two tables in HTML

I would like to ask, why I can't able to refresh two html tables? only 1? is there something wrong with the Javascript code? I already tried to declare 2 variables and tried to create to script for each and still no luck and I tried to change the variables name to unique one but still no luck. My full code below:
<!-- SALES.HTML -->
<div class="col-sm-5 shadow">
<p>
<h3><center>Hyukies</center></h3>
<center>Catbalogan, City</center>
<center><span class="glyphicon glyphicon-time"></span> <?php include('time.php'); ?></center> <br />
<div id="transactions_left">
<?php include_once('salestable.php')?>
</div>
</p>
<div class="row">
<div class="col-sm-12"><b>
<p>
<?php include_once('sales_count.php')?>
<script>
var table = $("#salestableid");
var refresh = function() {
table.load("salestable.php", function() {
setTimeout(refresh, 1);
});
};
refresh();
var table1 = $("#sales_countid");
var refresh1 = function() {
table.load("sales_count.php", function() {
setTimeout(refresh1, 1);
});
};
refresh1();
</script>
<button type="button" class="btn btn-danger btn-md" data-toggle='modal' data-target='#cancel'>Cancel</a>
<button type="button" class="btn btn-warning btn-md" data-toggle='modal' data-target='#hold'>Hold</button>
<button type="button" class="btn btn-success btn-md pull-right" data-toggle='modal' data-target='#payment' >Payment</button>
<br /><br />
<center>Thank you and have a Nice day!</center>
</p>
</div>
</div>
</div>
<!-- End of Page SALES.HTML -->
<!-- SALESTABLE.PHP -->
<?php require_once("../includes/db_connection.php"); ?>
<table class="table table-hover" id='salestableid'>
<thead>
<tr class= "default" style="background-color: #e18728">
<th><font color = "white">Action</font></th>
<th width="200"><font color = "white">Product</th>
<th><font color = "white">Quantity</th>
<th width="75"><font color = "white">Price</th>
<th width ="90"><font color = "white">Total</th>
</tr>
</thead>
<tbody>
<tr>
<?php
$user_query = mysqli_query($connection, "SELECT saleslog.itemid, saleslog.qty, saleslog.date, saleslog.total, saleslog.id, items.`name`, items.description, items.retailprice FROM saleslog LEFT JOIN items ON items.id = saleslog.itemid")or die(mysqli_error());
while($row = mysqli_fetch_array($user_query)){
$id = $row['id'];
?>
<tr>
<td></td>
<td><?php echo $row['name']; ?></td>
<td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<?php echo $row['qty']; ?></td>
<td>&nbsp<?php echo number_format($row['retailprice'],2); ?></td>
<?php
$total = $row['qty'] * $row['retailprice'];
?>
<td><?php echo number_format($total,2); ?></td>
</tr>
<?php } ?>
</tr>
</tbody>
</table>
<!-- End of Page SALESTABLE.PHP -->
<!--SALES_COUNT.PHP -->
<?php require_once("../includes/db_connection.php"); ?>
<?php
$count_client= mysqli_query($connection, "SELECT * FROM saleslog");
$count = mysqli_num_rows($count_client);
?>
<?php
$totalsales= mysqli_query($connection, "SELECT SUM(total) AS totalpritems FROM saleslog");
while($totalperitems = mysqli_fetch_array($totalsales)){
$total_sales = $totalperitems['totalpritems'];
}
?>
<table class='table' style="border-style: dotted" id="sales_countid">
<tr class='' style="border-style: dotted">
<td width="50" >Total Items: </td>
<td width="50"align="right"><?php echo $count; ?></td>
<td width="50" >Total: </td>
<td width="50"align="right" >P <?php echo number_format($total_sales,2); ?></td>
</tr>
<tr class='' style="border-style: dotted">
<td width="50">Discount: </td>
<td width="50"align="right">0.00 </td>
<td width="50">Tax: </td>
<td width="50"align="right">0.00 </td>
</tr>
<tr style="border-style: dotted">
<td width>Total Payable: </td>
<td align="right">P <?php echo number_format($total_sales,2); ?></td>
<td></td>
<td></td>
</tr>
</table>
<!--End of Page SALES_COUNT.PHP -->
In your refresh code for table1, you refresh table instead.
table1.load(...) instead of table.load(...) in the code below.
var table1 = $("#sales_countid");
var refresh1 = function() {
table.load("sales_count.php", function() {
setTimeout(refresh1, 1);
});
};

Fatal error: Call to a member function fetch_assoc() on a non-object in /home/u161146050/public_html/application/views/test1.php on line 49

I have a problem about this thing...I have been doing this in XAMPP and nothing goes wrong..but whenever I upload it to the hosting it always display this.
Fatal error: Call to a member function fetch_assoc() on a non-object in /home/u161146050/public_html/application/views/test1.php on line 49.
I don't know why it appears in line 49, but during I was doing it in localhost it doesn't appear.
<table class="table table-condensed table-hover">
<tr>
<td class="warning" id="bold">Book Id</td>
<td class="danger" id="bold">Book Title</td>
<td class="warning" id="bold">Author</td>
<td class="danger" id="bold">Status</td>
<td class="warning" id="bold">Borrower</td>
<td class="danger" id="bold">options</td>
</tr>
<?php
include('inc/config.php');
$sql = "SELECT * FROM books";
$result = $link->query($sql);
while($row = $result->fetch_assoc()) {
?>
<tr>
<td class="warning"><?php echo $row['bookNumber']?></td>
<td class="danger"><?php echo $row['title']?></td>
<td class="warning"><?php echo $row['author']?></td>
<td class="danger"><?php echo $row['status']?></td>
<td class="warning"><?php echo $row['borrower']?></td>
<td class="danger"><form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"><div class="btn-toolbar" role="toolbar" aria-label="...">
<div class="btn-group" role="group" aria-label="...">
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-bookmark" aria-hidden="true"></span></button></a>
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></button></a>
</div>
</div>
</form>
</td>
</tr>
<?php }
?>
Any help would be appreciated.
$result=mysqli_query($con,$sql);
while($row=mysqli_fetch_assoc($result);{

Categories