<!DOCTYPE html>
<html lang="en">
<head> 
<meta charset="UTF-8"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover"> 
<title><?php echo e(env('APP_NAME')); ?> | Record</title> 

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/layui/2.5.7/css/layui.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">

<style>
body {margin:0;font-family:Inter,sans-serif;background:#f5f6fa;color:#333;}
.top {display:flex;align-items:center;position:sticky;top:0;background:#fff;padding:12px 16px;box-shadow:0 2px 6px rgba(0,0,0,0.05);z-index:100;}
.topLeft {font-size:18px;color:#1E3A8A;text-decoration:none;}
.topTit {flex:1;text-align:center;font-weight:600;font-size:16px;color:#111;}
.history-main {padding:12px;}
.record-tab {display:flex;gap:12px;margin-bottom:12px;overflow-x:auto;}
.record-tab a {flex:1;text-align:center;padding:8px 0;border-radius:8px;background:#e0e7ff;color:#1e3a8a;font-weight:500;text-decoration:none;white-space:nowrap;}
.record-tab a.active {background:#1e3a8a;color:#fff;}
.history-list {display:flex;flex-direction:column;gap:12px;}
.list-info {background:#fff;padding:12px;border-radius:12px;box-shadow:0 2px 6px rgba(0,0,0,0.05);}
.list-bot {display:flex;justify-content:space-between;align-items:center;}
.list-bot-left h3 {margin:0;font-size:14px;font-weight:600;color:#111;}
.list-bot-left h2 {margin:4px 0;font-size:14px;font-weight:600;color:#1E3A8A;}
.list-bot-left p {margin:0;font-size:12px;color:#555;}
.order-id {margin-top:4px;display:flex;align-items:center;gap:8px;font-size:12px;color:#666;}
.copy-btn {padding:4px 8px;font-size:12px;border:none;border-radius:6px;background:#1E3A8A;color:#fff;cursor:pointer;}
.list-bot-right span {padding:4px 8px;border-radius:6px;font-size:12px;color:#fff;}
.status-success {background:#10B981;}
.status-pending {background:#F59E0B;}
.status-failed {background:#DC2626;}
.dropload-down {text-align:center;color:#888;padding:12px;font-size:12px;}
</style>
</head> 

<body> 

<!-- Fixed Header -->
<div class="top"> 
  <a href="<?php echo e(route('dashboard')); ?>" class="topLeft"><i class="layui-icon layui-icon-left"></i></a> 
  <div class="topTit">Record</div> 
  <div></div>
</div> 

<!-- Main Container -->
<div class="history-main"> 
  <!-- Tabs -->
  <div class="record-tab"> 
    <a href="javascript:void(0);" class="active" data-tab="withdraw">Withdraw</a> 
    <a href="javascript:void(0);" data-tab="account">Other</a> 
    <a href="javascript:void(0);" data-tab="recharge">Recharge</a> 
  </div> 

  <!-- Withdraw Records -->
  <div class="history-list" id="withdraw">
    <?php $__currentLoopData = \App\Models\Withdrawal::where('user_id', auth()->id())->orderByDesc('id')->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <div class="list-info">
      <div class="list-bot">
        <div class="list-bot-left">
          <h3>Withdraw</h3>
          <h2>-<?php echo e(price($element->amount)); ?></h2>
          <p><?php echo e($element->created_at); ?></p>
          <div class="order-id">
            <span>Order No: <?php echo e($element->order_id); ?></span>
            <button class="copy-btn" onclick="copyText('<?php echo e($element->order_id); ?>')">Copy</button>
          </div>
        </div>
        <div class="list-bot-right">
          <span class="<?php if($element->status == 'success'): ?> status-success <?php elseif($element->status == 'pending'): ?> status-pending <?php else: ?> status-failed <?php endif; ?>">
            <?php echo e(ucfirst($element->status)); ?>

          </span>
        </div>
      </div>
    </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  </div>

  <!-- Account Records -->
  <div class="history-list" id="account" style="display:none;">
    <?php $__currentLoopData = \App\Models\UserLedger::where('user_id', auth()->id())->orderByDesc('id')->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <div class="list-info">
      <div class="list-bot">
        <div class="list-bot-left">
          <h3><?php echo e($element->remark); ?></h3>
          <h2><?php echo e($element->amount >= 0 ? '+' : '-'); ?><?php echo e(price(abs($element->amount))); ?></h2>
          <p><?php echo e($element->created_at); ?></p>
          <div class="order-id">
            <span>Order No: <?php echo e($element->id); ?></span>
            <button class="copy-btn" onclick="copyText('<?php echo e($element->id); ?>')">Copy</button>
          </div>
        </div>
      </div>
    </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  </div>

  <!-- Recharge Records -->
  <div class="history-list" id="recharge" style="display:none;">
    <?php $__currentLoopData = \App\Models\Deposit::where('user_id', auth()->id())->orderByDesc('id')->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <div class="list-info">
      <div class="list-bot">
        <div class="list-bot-left">
          <h3>Deposit</h3>
          <h2>+<?php echo e(price($element->amount)); ?></h2>
          <p><?php echo e($element->created_at); ?></p>
          <div class="order-id">
            <span>Order No: <?php echo e($element->order_id); ?></span>
            <button class="copy-btn" onclick="copyText('<?php echo e($element->order_id); ?>')">Copy</button>
          </div>
        </div>
        <div class="list-bot-right">
          <span class="<?php if($element->status == 'success'): ?> status-success <?php elseif($element->status == 'pending'): ?> status-pending <?php else: ?> status-failed <?php endif; ?>">
            <?php echo e(ucfirst($element->status)); ?>

          </span>
        </div>
      </div>
    </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  </div> 

  <!-- Footer -->
  <div class="dropload-down">
    <div class="dropload-nodata">No more records</div>
  </div>
</div> 

<script>
document.querySelectorAll('.record-tab a').forEach(tab => {
  tab.addEventListener('click', function() {
    document.querySelectorAll('.record-tab a').forEach(a => a.classList.remove('active'));
    document.querySelectorAll('.history-list').forEach(list => list.style.display = "none");
    this.classList.add('active');
    document.getElementById(this.dataset.tab).style.display = "block";
  });
});

function copyText(text) {
  navigator.clipboard.writeText(text);
  alert("Order Number Copied: " + text);
}
</script>

</body>
</html>
<?php /**PATH /home/tamim/m84.srtlabbd.top/resources/views/app/main/history.blade.php ENDPATH**/ ?>