<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<style>.cmp-table{margin:0}.cmp-table th{white-space:nowrap}.cmp-table td{vertical-align:middle}.cmp-number{width:56px;text-align:center;color:#64748b}.badge-cmp{border-radius:15px;padding:5px 9px;font-size:11px}.cmp-foot{display:flex;justify-content:space-between;align-items:center;padding:13px 16px;border-top:1px solid #edf0f4}.cmp-foot nav{margin-left:auto}.cmp-foot .pagination{margin:0}@media(max-width:768px){.cmp-foot{flex-direction:column;gap:10px}.cmp-foot nav{margin:auto}}</style>
<div class="table-responsive"><table class="table table-hover cmp-table"><thead><tr><th class="cmp-number">No.</th><th>No. / Tanggal</th><th>Invoice / Customer</th><th>Produk</th><th>Qty</th><th>Prioritas</th><th>Status</th><th>PIC</th><th>Biaya</th><th></th></tr></thead><tbody><?php foreach($rows as $index=>$r):?><tr><td class="cmp-number"><?=number_format($offset+$index+1,0,',','.')?></td><td><b><?=html_escape($r['complaint_no'])?></b><br><small><?=date('d/m/Y',strtotime($r['complaint_date']))?></small></td><td><?=html_escape($r['id_transaksi'])?><br><small><?=html_escape($r['customer'])?></small></td><td><?=html_escape($r['products']?:'-')?></td><td><?=number_format($r['complaint_qty'],0,',','.')?></td><td><b><?=html_escape($r['priority'])?></b></td><td><span class="badge badge-info badge-cmp"><?=html_escape($r['status'])?></span></td><td><?=html_escape($r['pic'])?></td><td>Rp <?=number_format($r['total_cost'],0,',','.')?></td><td><a class="btn btn-sm btn-outline-primary" href="<?=site_url('komplain/detail/'.$r['id'])?>">Detail</a></td></tr><?php endforeach;?><?php if(!$rows):?><tr><td colspan="10" class="text-center text-muted py-5">Belum ada data komplain sesuai filter.</td></tr><?php endif;?></tbody></table></div>
<?php if($total>0):?><div class="cmp-foot"><nav aria-label="Navigasi halaman komplain"><?=$this->ajax_pagination->create_links();?></nav></div><?php endif;?>
