<?php
$edited = can_action('205', 'edited');
$deleted = can_action('205', 'deleted');
?>

<div class="space-y-6">
	<?= message_box('success'); ?>
	<?= message_box('error'); ?>

	<div class="rounded-2xl border border-border bg-card shadow-sm">
		<div class="px-6 py-4 border-b border-border flex flex-col gap-1 md:flex-row md:items-center md:justify-between">
			<div>
				<h2 class="text-lg font-semibold text-foreground"><?= lang('program_rule') . ' ' . lang('setting') ?></h2>
				<p class="text-sm text-muted-foreground"><?= lang('settings') ?></p>
			</div>
			<div class="flex items-center gap-2">
				<?= btn_modal(
					'admin/settings/new_program',
					lang('new') . ' ' . lang('program'),
					lang('new') . ' ' . lang('program'),
					'lg',
					'plus',
					array('class' => 'inline-flex items-center gap-2 rounded-lg bg-slate-900 px-3 py-2 text-xs font-semibold text-white hover:bg-slate-800')
				) ?>
			</div>
		</div>

		<div class="p-6 space-y-4">
				<table class="w-full text-left text-sm DataTables" id="DataTables" width="100%">
					<thead class="text-xs uppercase text-muted-foreground">
						<tr>
							<?php if (!empty($deleted)) : ?>
								<th class="w-10"><input type="checkbox" id="select_all"></th>
							<?php endif; ?>

							<th class="px-4 py-3"><?= lang('program_name') ?></th>
							<th class="px-4 py-3"><?= lang('client_name') ?></th>
							<th class="px-4 py-3"><?= lang('award_name') ?></th>
							<th class="px-4 py-3"><?= lang('start_date') ?></th>
							<th class="px-4 py-3"><?= lang('end_date') ?></th>
							<th class="px-4 py-3"><?= lang('status') ?></th>

							<?php if (!empty($edited) || !empty($deleted)) { ?>
								<th class="col-options no-sort px-4 py-3 text-right"><?= lang('action') ?></th>
							<?php } ?>
						</tr>
					</thead>
					<tbody>
					</tbody>
				</table>
		</div>

	</div>
</div>

<script type="text/javascript">
	$(document).ready(function () {
		list = base_url + "admin/settings/awardprogramlist";
	});
</script>
