<?= $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('/','Painel')?></li>
				<li class="breadcrumb-item"><?=anchor('/organizacao','Organizacoes')?></li>
				<li class="breadcrumb-item active" aria-current="page">Cadastrar</li>
			</ol>
		</nav>
		<!-- # end breadcrumb -->
		<!-- > Conteudo -->
		<h2>Cadastre uma nova Unidade</h2>
		<?php
		$validation = \Config\Services::validation();
		$validation->listErrors();
		echo form_open('organizacao/cadastra','class="mt-5"');

			echo '<h3>Responsável</h3>';
			echo form_label(' ','input_responsavel');
			echo form_input('input_responsavel', set_value('input_responsavel'),'class="form-control" placeholder="Responsável"');
			// <!-- input_responsavel Error -->
			if($validation->getError('input_responsavel')) { ?>
				<div class='alert alert-danger mt-2'>
					<?= $validation->getError('input_responsavel'); ?>
				</div><?php 
			}
			echo form_label(' ','input_responsavel_cpf');
			echo form_input('input_responsavel_cpf', set_value('input_responsavel_cpf'),'class="form-control" placeholder="CPF do responsável"');
			// <!-- input_responsavel_cpf Error -->
			if($validation->getError('input_responsavel_cpf')) { ?>
				<div class='alert alert-danger mt-2'>
					<?= $validation->getError('input_responsavel_cpf'); ?>
				</div><?php 
			}
			
			echo '<h3 class="mt-5">Empresa</h3>';
			echo form_label(' ','input_nome');
			echo form_input('input_nome', set_value('input_nome'),'class="form-control" placeholder="Nome da organizacao"');
			// <!-- input_nome Error -->
			if($validation->getError('input_nome')) { ?>
				<div class='alert alert-danger mt-2'>
					<?= $validation->getError('input_nome'); ?>
				</div><?php 
			}
			echo form_label(' ','input_nome_fantasia');
			echo form_input('input_nome_fantasia', set_value('input_nome_fantasia'),'class="form-control" placeholder="Nome fantasia da organizacao"');
			// <!-- input_nome_fantasia Error -->
			if($validation->getError('input_nome_fantasia')) { ?>
				<div class='alert alert-danger mt-2'>
					<?= $validation->getError('input_nome_fantasia'); ?>
				</div><?php 
			}
			echo form_label(' ','input_aliases');
			echo form_input('input_aliases', set_value('input_aliases'),'class="form-control" placeholder="Aliases"');
			// <!-- input_aliases Error -->
			if($validation->getError('input_aliases')) { ?>
				<div class='alert alert-danger mt-2'>
					<?= $validation->getError('input_aliases'); ?>
				</div><?php 
			}
			echo form_label(' ','input_email');
			echo form_input('input_email', set_value('input_email'),'class="form-control" placeholder="E-mail de contato"');
			// <!-- input_email Error -->
			if($validation->getError('input_email')) { ?>
				<div class='alert alert-danger mt-2'>
				<?= $validation->getError('input_email'); ?>
				</div><?php 
			}
			echo form_label(' ','input_cnpj');
			echo form_input('input_cnpj', set_value('input_cnpj'),'class="form-control" placeholder="CNPJ"');
			// <!-- input_cnpj Error -->
			if($validation->getError('input_cnpj')) { ?>
				<div class='alert alert-danger mt-2'>
					<?= $validation->getError('input_cnpj'); ?>
				</div><?php 
			}
			echo form_label(' ','input_insc_municipal');
			echo form_input('input_insc_municipal', set_value('input_insc_municipal'),'class="form-control" placeholder="Inscrição Municipal"');
			// <!-- input_insc_municipal Error -->
			if($validation->getError('input_insc_municipal')) { ?>
				<div class='alert alert-danger mt-2'>
					<?= $validation->getError('input_insc_municipal'); ?>
				</div><?php 
			}

			echo '<h3 class="mt-5">Endereço</h3>';
			echo '<div class="row">';
			echo '<div class="col-md-6">';
			echo form_label(' ','input_endereco');
			echo form_input('input_endereco', set_value('input_endereco'),'class="form-control" placeholder="Endereço"');
			// <!-- input_endereco Error -->
			if($validation->getError('input_endereco')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_endereco'); ?>
				</div><?php 
			}
			echo '</div>';
			echo '<div class="col-md-3">';
			echo form_label(' ','input_endereco_numero');
			echo form_input('input_endereco_numero', set_value('input_endereco_numero' ),'class="form-control" placeholder="Número"');
			// <!-- input_endereco_numero Error -->
			if($validation->getError('input_endereco_numero')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_endereco_numero'); ?>
				</div><?php 
			}
			echo '</div>';
			echo '<div class="col-md-3">';
			echo form_label(' ','input_endereco_compl');
			echo form_input('input_endereco_compl', set_value('input_endereco_compl' ),'class="form-control" placeholder="Complemento"');
			// <!-- input_endereco_compl Error -->
			if($validation->getError('input_endereco_compl')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_endereco_compl'); ?>
				</div><?php 
			}
			echo '</div>';
			echo '<div class="col-md-6">';
			echo form_label(' ','input_bairro');
			echo form_input('input_bairro', set_value('input_bairro'),'class="form-control" placeholder="Bairro"');
			// <!-- input_bairro Error -->
			if($validation->getError('input_bairro')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_bairro'); ?>
				</div><?php 
			}
			echo '</div>';
			echo '<div class="col-md-6">';
			echo form_label(' ','input_municipio');
			echo form_input('input_municipio', set_value('input_municipio'),'class="form-control" placeholder="Município"');
			// <!-- input_municipio Error -->
			if($validation->getError('input_municipio')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_municipio'); ?>
				</div><?php 
			}
			echo '</div>';
			echo '<div class="col-md-4">';
			echo form_label(' ','input_estado_uf');
			echo form_input('input_estado_uf', set_value('input_estado_uf'),'class="form-control" placeholder="Estado (UF)"');
			// <!-- input_estado_uf Error -->
			if($validation->getError('input_estado_uf')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_estado_uf'); ?>
				</div><?php 
			}
			echo '</div>';
			echo '<div class="col-md-4">';
			echo form_label(' ','input_pais');
			echo form_input('input_pais', set_value('input_pais'),'class="form-control" placeholder="País"');
			// <!-- input_pais Error -->
			if($validation->getError('input_pais')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_pais'); ?>
				</div><?php 
			}
			echo '</div>';
			echo '<div class="col-md-4">';
			echo form_label(' ','input_cep');
			echo form_input('input_cep', set_value('input_cep'),'class="form-control" placeholder="CEP"');
			// <!-- input_cep Error -->
			if($validation->getError('input_cep')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_cep'); ?>
				</div><?php 
			}
			echo '</div>';
			echo '</div>';

			echo '<h4 class="mt-5">Email para disparo</h4>';
			echo form_label('Email para disparo: ','input_email_disparo',['class'=>'mt-3']);
			echo form_input('input_email_disparo', set_value('input_email_disparo'),'class="form-control" placeholder="Email para disparo"');
			// <!-- input_email_disparo Error -->
			if($validation->getError('input_email_disparo')) { ?>
				<div class='alert alert-danger mt-2'>
				<?= $validation->getError('input_email_disparo'); ?>
				</div><?php 
			}
			echo form_label('Senha: ','input_email_senha',['class'=>'mt-3']);
			echo form_input('input_email_senha', set_value('input_email_senha'),'class="form-control" placeholder="Senha"');
			// <!-- input_email_senha Error -->
			if($validation->getError('input_email_senha')) { ?>
				<div class='alert alert-danger mt-2'>
				<?= $validation->getError('input_email_senha'); ?>
				</div><?php 
			}
			echo form_label('protocolo: ','input_email_protocol',['class'=>'mt-3']);
			echo form_input('input_email_protocol', set_value('input_email_protocol'),'class="form-control" placeholder="protocol"');
			// <!-- input_email_protocol rror -->
			if($validation->getError('input_email_protocol')) { ?>
				<div class='alert alert-danger mt-2'>
				<?= $validation->getError('input_email_protocol'); ?>
				</div><?php 
			}
			echo form_label('smtp: ','input_smtp',['class'=>'mt-3']);
			echo form_input('input_smtp', set_value('input_smtp'),'class="form-control" placeholder="protocol"');
			// <!-- input_smtp rror -->
			if($validation->getError('input_smtp')) { ?>
				<div class='alert alert-danger mt-2'>
				<?= $validation->getError('input_smtp'); ?>
				</div><?php 
			}
			echo form_label('port: ','input_port',['class'=>'mt-3']);
			echo form_input('input_port', set_value('input_port'),'class="form-control" placeholder="protocol"');
			// <!-- input_port rror -->
			if($validation->getError('input_port')) { ?>
				<div class='alert alert-danger mt-2'>
				<?= $validation->getError('input_port'); ?>
				</div><?php 
			}

			echo '<h4 class="mt-5">BOT WHATSAPP</h4>';
			echo form_label('Url: ','input_botUrl',['class'=>'mt-3']);
			echo form_input('input_botUrl', set_value('input_botUrl'),'class="form-control" placeholder="BOT URL"');
			// <!-- input_botUrl Error -->
			if($validation->getError('input_botUrl')) { ?>
				<div class='alert alert-danger mt-2'>
				<?= $validation->getError('input_botUrl'); ?>
				</div><?php 
			}
			echo form_label('Auth: ','input_botAuth',['class'=>'mt-3']);
			echo form_input('input_botAuth', set_value('input_bothAuth'),'class="form-control" placeholder="Auth"');
			// <!-- input_botAuth Error -->
			if($validation->getError('input_botAuth')) { ?>
				<div class='alert alert-danger mt-2'>
				<?= $validation->getError('input_botAuth'); ?>
				</div><?php 
			}
			echo form_label('Hash: ','input_botHash',['class'=>'mt-3']);
			echo form_input('input_botHash', set_value('input_botHash'),'class="form-control" placeholder="Hash"');
			// <!-- input_botHash rror -->
			if($validation->getError('input_botHash')) { ?>
				<div class='alert alert-danger mt-2'>
				<?= $validation->getError('input_botHash'); ?>
				</div><?php 
			}

			// confirmar envio
			echo '<div class="d-grid mt-5">';
			echo csrf_field();
			echo form_submit('enviar','Cadastrar','class="btn btn-primary"');
			echo '</div>';

		echo form_close();
		?>
	</div>

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