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



<?= $this->section('content') ?>
<section>
<div class="container-fluid">
<div class="row justify-content-center">
	<div class="col-md-8 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('/evupt','Evupt')?></li>
				<li class="breadcrumb-item active" aria-current="page">Cadastrar</li>
			</ol>
		</nav>
		<!-- # end breadcrumb -->
		<!-- > Conteudo -->
		<h2>Novo Disparador</h2>
		<?php
		$validation = \Config\Services::validation();
		$validation->listErrors();
		echo form_open('evupt/cadastra');
			echo form_label('Nome: ','input_nome',['class'=>'mt-3']);
			echo form_input('input_nome', set_value('input_nome'),'class="form-control" placeholder="Nome disparador" id="input_nome"');
			// <!-- input Error -->
			if($validation->getError('input_nome')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_nome'); ?>
				</div><?php 
			}

			echo '<h5 class="mt-5">Configuração de Email</h5>';

			echo form_label('E-mail Disparador: ','input_email',['class'=>'mt-3']);
			echo form_input('input_email', set_value('input_email'),'class="form-control" placeholder="Origem do disparo" id="input_email"');
			// <!-- input Error -->
			if($validation->getError('input_email')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_email'); ?>
				</div><?php 
			}

			echo form_label('Senha: ','input_senha',['class'=>'mt-3']);
			echo form_input('input_senha', set_value('input_senha'),'class="form-control" placeholder="Senha do email" id="input_senha"');
			// <!-- input Error -->
			if($validation->getError('input_senha')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_senha'); ?>
				</div><?php 
			}

			echo form_label('SMTP: ','input_smtp',['class'=>'mt-3']);
			echo form_input('input_smtp', set_value('input_smtp'),'class="form-control" placeholder="url" id="input_smtp"');
			// <!-- input Error -->
			if($validation->getError('input_smtp')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_smtp'); ?>
				</div><?php 
			}

			echo form_label('Autenticação Segura: ','input_secure',['class'=>'mt-3']);
			echo form_input('input_secure', set_value('input_secure'),'class="form-control" placeholder=" true ou false" id="input_secure"');
			// <!-- input Error -->
			if($validation->getError('input_secure')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_secure'); ?>
				</div><?php 
			}

			echo form_label('Porta: ','input_porta',['class'=>'mt-3']);
			echo form_input('input_porta', set_value('input_porta'),'class="form-control" placeholder=" true ou false" id="input_porta"');
			// <!-- input Error -->
			if($validation->getError('input_porta')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_porta'); ?>
				</div><?php 
			}

			echo form_label('E-mail para respostas: ','input_reply',['class'=>'mt-3']);
			echo form_input('input_reply', set_value('input_reply'),'class="form-control" placeholder="Receba respostas nele" id="input_reply"');
			// <!-- input Error -->
			if($validation->getError('input_reply')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_reply'); ?>
				</div><?php 
			}

			echo '<h5 class="mt-5">Configuração do Whatsapp</h5>';

			echo form_label('URL Bot: ','input_boturl',['class'=>'mt-3']);
			echo form_input('input_boturl', set_value('input_boturl'),'class="form-control" placeholder="Url do bot" id="input_boturl"');
			// <!-- input Error -->
			if($validation->getError('input_boturl')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_boturl'); ?>
				</div><?php 
			}

			echo form_label('Bot Auth: ','input_botauth',['class'=>'mt-3']);
			echo form_input('input_botauth', set_value('input_botauth'),'class="form-control" placeholder="Url do bot" id="input_botauth"');
			// <!-- input Error -->
			if($validation->getError('input_botauth')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_botauth'); ?>
				</div><?php 
			}

			echo form_label('Bot Hash: ','input_bothash',['class'=>'mt-3']);
			echo form_input('input_bothash', set_value('input_bothash'),'class="form-control" placeholder="Url do bot" id="input_bothash"');
			// <!-- input Error -->
			if($validation->getError('input_bothash')) { ?>
				<div class='alert alert-danger mt-2'>
				  <?= $validation->getError('input_bothash'); ?>
				</div><?php 
			}
			
			// confirmar envio
			echo csrf_field();
			echo form_submit('enviar','Cadastrar Disparador','class="btn btn-primary w-100 mt-3"');
		echo form_close();
		?>
	</div>

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