<?php $__env->startSection('title','Dashboard'); ?>

<?php $__env->startSection('content'); ?>

<main class="content">
				<div class="container-fluid p-0">

				<h1 class="h3 mb-3"><strong>Filter Enrolments</strong> By date</h1>
				<?php echo $__env->make('training.alerts.alert', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
					
					<div class="row">
						<div class="col-12">
							<div class="card">
								<div class="card-header">
									<h5 class="card-title mb-0">Filter Enrollments </h5>
								</div>
								<div class="card-body">
									<form method="GET" action="<?php echo e(url()->current()); ?>">										

										<div class="row g-3 align-items-center">
											<div class="col-auto">
												<label for="date" class="col-form-label fw-bold">Select Date:</label>
											</div>
											<div class="col-auto">
												<input type="date" id="date" name="date" 
													value="<?php echo e(request('date', now()->toDateString())); ?>"
													class="form-control">
											</div>
											<div class="col-auto">
												<button type="submit" class="btn btn-primary">
													<i class="bi bi-search"></i> Filter
												</button>
												<a href="<?php echo e(url()->current()); ?>" class="btn btn-secondary">Reset</a>
											</div>
										</div>						
									</form>
								</div>
							</div>
						</div>
					</div>
					
					<div class="card">
						<div class="card-header">
							<h5 class="card-title">Enrollments done on <b><?php echo e(\Carbon\Carbon::parse($date)->format('d D M Y')); ?> </b></h5>
							<!-- <h6 class="card-subtitle text-muted">This is data from the filtered month</h6> -->
						</div>
						<div class="card-body">
							<table id="datatables-reponsive" class="table table-striped" style="width:100%">
								<thead>
									<tr>
											<th>#</th>
											<th>Student Name</th>
											<th>Course</th>
											<th>Amount</th>
											<th>TransID</th>
											<th>Station</th>
											<th>Payment Mode</th>
											<th>Paystatus</th>
											<th>Company</th>
									</tr>
								</thead>
								<tbody>

									<?php $__empty_1 = true; $__currentLoopData = $enrollments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $enrollment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
										<tr>
											<td><?php echo e($index + 1); ?></td>
											<td><?php echo e($enrollment->name ?? '-'); ?></td>
											<td><?php echo e($enrollment->course_name); ?></td>
											<td><?php echo e(number_format($enrollment->amount, 2)); ?></td>
											<td><?php echo e($enrollment->TransID); ?></td>
											<td><?php echo e($enrollment->station); ?></td>
											<td><?php echo e(ucfirst($enrollment->paymentmode)); ?></td>
											<td>
												<?php if($enrollment->paystatus === 'paid'): ?>
													<span class="badge bg-success">Paid</span>
												<?php else: ?>
													<span class="badge bg-danger">Unpaid</span>
												<?php endif; ?>
											</td>
											<td><?php echo e($enrollment->companyname); ?></td>
										</tr>
									<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
										<tr>
											<td colspan="9" class="text-center text-muted">No enrollments found for this date.</td>
										</tr>
									<?php endif; ?>
									
								</tbody>
								
							</table>
						</div>
					</div>
					

				</div>
				
			</main>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('training.inc.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\2025 projects\xampp\htdocs\projects\untitled 3 DigitalCerts\resources\views/training/filterenrollmentstable.blade.php ENDPATH**/ ?>