EVOLUTION-NINJA
Edit File: completed_bidding_list.php
<?php $this->load->view('includes/iadmin_header');?> <!DOCTYPE html> <html> <head> <title>Completed Bidding List</title> </head> <body> <div class="row justify-content-center mt-4"> <div class="col-lg-12 bidd"> <div class="card"> <!-- Wrap the table in a card --> <div class="card-body"> <button type="button" style="float:right;margin-right: 1%;" onclick="doit('xlsx')"; class="btn btn-primary btn-sm">Export</button> <h2 class="card-title">Completed Bidding List</h2> <div class="table-responsive"> <table id="biddingTable" class="table prio_table dataTable no-footer" style="width:95%;margin-left:20px;"> <thead> <tr> <th>#</th> <th>Event Name</th> <th>Company Name</th> <th>Date</th> <th>Time</th> <th>Action</th> </tr> </thead> <tbody> <?php foreach ($completed_bid as $index => $bid): ?> <tr> <td><?php echo $index + 1; ?></td> <td><?php echo $bid->bidding_title; ?></td> <td><?php echo isset($bid->company_name) ? $bid->company_name : ''; ?></td> <td><?php echo isset($bid->final_bidding_date) ? $bid->final_bidding_date : ''; ?></td> <td><?php echo $bid->bidding_time; ?></td> <td><a href="<?php echo base_url('/vendor-item-description'); ?>/<?php echo $bid->bidding_session_id; ?>" class="btn btn-success btn-xs" role="button">View</a> </tr> <?php endforeach; ?> </tbody> </table> </body> </html> <script type="text/javascript"> var datatable; var tbody = $('#table_body'); datatable = $('.table').DataTable({}); jQuery(document).ready(function($) { $('.ul_menu li.dropdown').hover(function() { $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn(500); }, function() { $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(500); }); }); </script> <style type="text/css"> .ul_menu li { list-style: none; } .table-responsive { overflow-x: hidden !important; } .prio_table > thead > tr > th { background: #abf3ad !important; border-bottom: 1px solid #61b79c !important; border-top: 1px solid #61b79c !important; color: #000; } .prio_table > tbody > tr > td { background: #f0fffc; color: #000; } @media only screen and (min-width: 320px) and (max-width: 640px) { .table-responsive { overflow-x: auto !important; } } @media only screen and (min-width: 641px) and (max-width: 991px) { .table-responsive { overflow-x: auto !important; } } @media only screen and (min-width: 992px) and (max-width: 1258px) { .table-responsive { overflow-x: auto !important; } } .export-btn { float: right; margin-right: 1%; } /* ---------------- */ .bidd{ background-color: white; margin: 10px 29px; width: 97%; border-radius: 20px; } .card-title{ border-bottom: 1px solid black; } </style> <script type="text/javascript" src="<?php echo base_url('assets/js/shim.min.js');?>"></script> <script type="text/javascript" src="<?php echo base_url('assets/js/xlsx.full.min.js');?>"></script> <script type="text/javascript" src="<?php echo base_url('assets/js/Blob.js');?>"></script> <script type="text/javascript" src="<?php echo base_url('assets/js/FileSaver.js');?>"></script> <script> function doit(type, fn, dl) { var elt = document.getElementById('biddingTable'); // Update ID to match your table ID var wb = XLSX.utils.table_to_book(elt, {sheet:"Sheet JS"}); return dl ? XLSX.write(wb, {bookType:type, bookSST:true, type: 'base64'}) : XLSX.writeFile(wb, fn || ('CompletedBidding.' + (type || 'xlsx'))); } </script>