<?= $this->extend('admin/template/template') ?>

<?= $this->section('content') ?>
<section>
<div class="container-fluid">
<div class="row justify-content-center">

	<div class="col-md-6 shadow rounded-bottom p-5">
        <!-- > Breadcrumb -->
		<nav style="--bs-breadcrumb-divider: url(&#34;data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M2.5 0L1 1.5 3.5 4 1 6.5 2.5 8l4-4-4-4z' fill='%236c757d'/%3E%3C/svg%3E&#34;);" aria-label="breadcrumb">
			<ol class="breadcrumb">
				<li class="breadcrumb-item"><?=anchor('/cliente/painel/'.$id_cliente,'Voltar')?></li>
			</ol>
		</nav>
		<!-- # end breadcrumb -->
		<!-- > Conteudo -->
		<h2>Novo Detalhe</h2>
		<?php
		
		$validation = \Config\Services::validation();

		echo form_open('clienteDetalhe/cadastra/'.$id_cliente);
			// input name
			echo form_label('<br>','input_atributo');
			echo form_input('input_atributo', set_value('input_atributo'),'class="form-control" placeholder="Atributo*"');
			// <!-- name Error -->
			if($validation->getError('input_atributo')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_atributo'); ?>
				</div><?php 
			}
			// input descrição
			echo form_label('<br>','input_descricao');
			echo form_textarea('input_descricao', set_value('input_descricao'),'class="form-control" placeholder="Informação*"');
			// <!-- name Error -->
			if($validation->getError('input_descricao')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_descricao'); ?>
				</div><?php 
			}
			// input publico
			$input_publico = [
				'name'    => 'input_publico',
				'id'      => 'input_publico',
				'value'   => '0',
				'checked' => true,
				'class'   => 'form-check-input mt-3 me-2',
			];
			echo form_checkbox($input_publico);
			echo form_label('Público','input_publico',['class'=>'form-check-label mt-3']);
			// <!-- name Error -->
			if($validation->getError('input_publico')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_publico'); ?>
				</div><?php 
			}
			// confirmar envio
			echo csrf_field();
			echo form_hidden('id_cliente',$id_cliente);
			echo form_submit('enviar','Cadastrar Detalhe','class="btn btn-primary w-100 mt-3"');
			echo '<p class="mt-3 small">* Campos necessários</p>';
		echo form_close();
		?>
	</div>

</div>
</div>
</section>
<?= $this->endSection() ?>