<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>

<?= message_box('success'); ?>
<?= message_box('error'); ?>

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

	<?php if (!empty($created) || !empty($edited)) { ?>
		<form method="post" id="lead_statuss" action="<?= base_url() ?>admin/supplier/saved_supplier/inline" class="space-y-4" data-parsley-validate="" novalidate="">
			<div class="grid gap-4 md:grid-cols-2">
				<?= form_input_group('name', lang('name'), !empty($supplier_info) ? $supplier_info->name : '', 'text', true); ?>
				<?= form_input_group('mobile', lang('mobile'), !empty($supplier_info) ? $supplier_info->mobile : '', 'text', true, array('data-parsley-type' => 'number')); ?>
				<?= form_input_group('phone', lang('phone'), !empty($supplier_info) ? $supplier_info->phone : '', 'text', false, array('data-parsley-type' => 'number')); ?>
				<?= form_input_group('email', lang('email'), !empty($supplier_info) ? $supplier_info->email : '', 'email', true); ?>
			</div>

			<?= form_textarea_group('address', lang('address'), !empty($supplier_info) ? $supplier_info->address : '', 3, false); ?>
			<?= form_input_group('vat', lang('company_vat'), !empty($supplier_info->vat) ? $supplier_info->vat : '', 'text', false); ?>

			<?php
			$permissionL = null;
			if (!empty($supplier_info->permission)) {
				$permissionL = $supplier_info->permission;
			}
			?>
			<?= form_permission_modern($permission_user, $permissionL, lang('assined_to')); ?>

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