<?php echo form_open(base_url('admin/invoice/cloned_invoice/' . $invoice_info->invoices_id), array('class' => 'space-y-4', 'enctype' => 'multipart/form-data', 'data-parsley-validate' => '', 'role' => 'form')); ?>

<?php
$selected_client_label = '';
if (!empty($invoice_info->client_id)) {
	$selected_client = $this->db->select('name')->where('client_id', $invoice_info->client_id)->get('tbl_client')->row();
	if (!empty($selected_client->name)) {
		$selected_client_label = $selected_client->name;
	}
}
echo form_lookup_group(
	'client_id',
	lang('select') . ' ' . lang('client'),
	!empty($invoice_info->client_id) ? $invoice_info->client_id : '',
	$selected_client_label,
	true,
	array('id' => 'client_id_lookup'),
	'md:col-span-8 mb-3',
	array(
		'type' => 'client',
		'min_length' => 0,
		'placeholder' => lang('search') . ' ' . lang('client'),
	),
	''
);
?>

<?=
form_datepicker(
	'invoice_date',
	lang('invoice_date'),
	!empty($invoice_info->invoice_date) ? $invoice_info->invoice_date : date('Y-m-d'),
	false,
	array('id' => 'invoice_date', 'data-format' => config_item('date_picker_format')),
	'',
	'',
	''
);
?>

<?=
form_datepicker(
	'due_date',
	lang('due_date'),
	!empty($invoice_info->due_date) ? $invoice_info->due_date : display_date(date('Y-m-d', strtotime("+" . config_item('invoices_due_after') . " days"))),
	false,
	array('id' => 'due_date', 'data-format' => config_item('date_picker_format')),
	'',
	'',
	''
);
?>

<div class="flex items-center justify-end gap-2 pt-4 ">
	<button type="button" class="inline-flex items-center rounded-lg border border-slate-200 bg-white px-4 py-2 text-sm font-semibold text-slate-700 hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700" data-dismiss="modal">
		<?= lang('close') ?>
	</button>
	<button type="submit" class="inline-flex items-center rounded-lg bg-slate-900 px-4 py-2 text-sm font-semibold text-white hover:bg-slate-800 dark:bg-slate-100 dark:text-slate-900 dark:hover:bg-white">
		<?= lang('clone') ?>
	</button>
</div>
<?php echo form_close(); ?>
