<?php echo message_box('success') ?>
<?php echo message_box('error') ?>

<div class="space-y-6">
    <form action="<?php echo base_url() ?>admin/settings/save_projects" enctype="multipart/form-data" method="post" class="space-y-6">
        <div class="rounded-2xl border border-border bg-card shadow-sm">
            <div class="flex items-center justify-between border-b border-border px-6 py-4">
                <div>
                    <h3 class="text-lg font-semibold text-foreground"><?= lang('projects') . ' ' . lang('settings') ?></h3>
                    <p class="text-sm text-muted-foreground"><?= lang('manage') . ' ' . lang('projects') ?></p>
                </div>
                <button type="submit" class="inline-flex items-center justify-center gap-2 rounded-lg bg-primary px-6 py-2.5 text-sm font-medium text-primary-foreground shadow-sm hover:bg-primary/90 transition-colors">
                    <i data-lucide="save" class="h-4 w-4"></i>
                    <?= lang('save_changes') ?>
                </button>
            </div>
            <div class="p-6 space-y-6">
                <input type="hidden" name="settings" value="<?= $load_setting ?>">

                <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                    <?= form_input_group('projects_prefix', lang('projects') . ' ' . lang('prefix'), config_item('projects_prefix'), 'text', true, ) ?>
                    <?= form_input_group('projects_start_no', lang('projects') . ' ' . lang('start_no'), config_item('projects_start_no'), 'text', true, ) ?>
                </div>

                <div class="space-y-2">
                    <?=
                    form_input_group(
                        'projects_number_format',
                        lang('projects') . ' ' . lang('number_format'),
                        empty(config_item('projects_number_format'))
                            ? '[' . config_item('projects_prefix') . ']' . '[yyyy][mm][dd][number]'
                            : config_item('projects_number_format'),
                        'text',
                        false,
                     
                    )
                    ?>
                    <p class="text-xs text-muted-foreground">ex [<?= config_item('projects_prefix') ?>] = <?= lang('projects_prefix') ?>,[yyyy] = 'Current Year (<?= date('Y') ?>)'[yy] ='Current Year (<?= date('y') ?>)',[mm] = 'Current Month(<?= date('M') ?>)',[m] = 'Current Month(<?= date('m') ?>)',[dd] = 'Current Date (<?= date('d') ?>)',[number] = 'Invoice Number (<?= sprintf('%04d', config_item('projects_start_no')) ?>)'</p>
                </div>

				<?= form_editor('projects_notes', lang('projects_notes'), config_item('projects_notes'), false); ?>

            </div>
        </div>
    </form>
</div>
