<?php
$created = can_action('129', 'created');
$edited = can_action('129', 'edited');

$state_options = array(
	'open' => lang('open'),
	'won' => lang('won'),
	'abandoned' => lang('abandoned'),
	'suspended' => lang('suspended'),
	'lost' => lang('lost'),
);

if (!empty($created) || !empty($edited)) {
?>
	<div class="space-y-6">
		<?= message_box('success'); ?>
		<?= message_box('error'); ?>

		<form method="post" id="state_reason" action="<?= base_url() ?>admin/opportunities/update_state_reason" data-parsley-validate novalidate class="space-y-6">
			<div >

				<div class="grid grid-cols-1 gap-4">
					<?= form_select_group('opportunities_state', lang('opportunities_state'), $state_options, 'open', true); ?>
					<?= form_input_group('opportunities_state_reason', lang('reason'), '', 'text', true, array('placeholder' => lang('opportunities_state_reason'))); ?>
				</div>
			</div>

			<div class="flex items-center justify-end gap-2">
				<button type="submit" class="btn btn-sm btn-primary"><?= lang('save') ?></button>
				<button type="button" class="btn btn-sm btn-default" data-dismiss="modal"><?= lang('close') ?></button>
			</div>
		</form>
	</div>
<?php } ?>
