<div class="nav-overlay"></div>

<?php $environment = getenv('CI_ENVIRONMENT'); ?>

<?php if ($environment === 'development') {	?>
	<div class="row">
		<div class="col-lg-12">
			<div class="ibox float-e-margins">
				<div class="ibox-title bg-danger text-light border-0">
					<i class="fa-light fa-code me-1"></i> Seu projeto está sendo executado em modo de DESENVOLVIMENTO.
				</div>
			</div>
		</div>
	</div>
<?php } ?>

<?php if(service('session')->get('usuario') !== null) { ?>

	<?php if(service('session')->get('usuario')->id_categoria == 1) { ?>

		<div class="row">
			<div class="col-lg-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title bg-danger text-light border-0">
						<i class="fa-light fa-triangle-exclamation me-1"></i> Você está logado como ROOT.
					</div>
				</div>
			</div>
		</div>

	<?php } else { ?>

		<div class="row">
			<div class="col-lg-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title bg-primary text-light border-0">
						<i class="fa-light fa-circle-user me-1"></i>Olá, <b><?php echo service('session')->get('usuario')->titulo; ?></b>
					</div>
				</div>
			</div>
		</div>

		<?php if(service('session')->get('usuario_origem') !== null) { ?>
			<div class="row">
				<div class="col-lg-12">
					<div class="ibox float-e-margins">
						<div class="ibox-title bg-danger text-light border-0">
							<i class="fa-light fa-triangle-exclamation me-1"></i>O acesso atual foi efetuado pelo usuário <b><?php echo service('session')->get('usuario_origem')->titulo; ?></b>
						</div>
					</div>
				</div>
			</div>
		<?php } ?>

	<?php } ?>

	<?php if(isset($MyInstitucional->ativo) AND $MyInstitucional->ativo == 0) { ?>
		<div class="row d-none">
			<div class="col-lg-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title bg-danger text-light border-0">
						<i class="fa-light fa-power-off mr-1"></i> Seu site está em <b>manutenção</b>.
					</div>
				</div>
			</div>
		</div>
	<?php } ?>

	<div class="row wrapper border-bottom white-bg page-heading">

		<!--
		------------------------------------------*
		----                                      *
		---- Cabeçalho                            *
		----                                      *
		------------------------------------------*
		---> 

		<div class="col-12 col-lg-6 py-4 px-4">
			<?php if (isset($MyModulo->thirdmenu) AND !empty($MyModulo->thirdmenu) AND $MyModulo->thirdmenu == 1) { ?> 
				<h2 class="m-0">
					<?php echo "<i class='" . $MyModulo->icone . "'></i> " . $MyModulo->titulo; ?>
				</h2>
			<?php } else { ?> 
				<h2 class="m-0">
					<?php echo "<i class='" . $MyModulo->icone . "'></i> " . $MyModulo->titulo; ?>
				</h2>
			<?php } ?>

			<ol class="breadcrumb">
				<li class="breadcrumb-item">
					<a href="<?php echo site_url('pagina-inicial'); ?>">
						<i class="fal fa-home"></i>
					</a>
				</li>

				<li class="breadcrumb-item">
					<a href="<?php echo BASECMSURL . $MyMod; ?>">
						<?php echo $MyModulo->titulo; ?>
					</a>
				</li>

				<li class="breadcrumb-item <?php if ($MyMet == "listagem") { echo 'active font-weight-bold'; } ?>">
					<a href="<?php echo BASECMSURL . $MyMod; ?>">
						Listagem
					</a>
				</li>

				<?php if($MyMet == "cadastrar") { ?>
					<li class="breadcrumb-item <?php if ($MyMet == "cadastrar") { echo 'active font-weight-bold'; } ?>">
						<a href="#">
							Cadastrando
						</a>
					</li>
				<?php } ?>

				<?php if($MyMet == "alterar") { ?>
					<li class="breadcrumb-item <?php if ($MyMet == "alterar") { echo 'active font-weight-bold'; } ?>">
						<a href="#">
							Alterando
						</a>
					</li>
				<?php } ?>

				<?php if($MyMet == "visualizar") { ?>
					<li class="breadcrumb-item <?php if ($MyMet == "visualizar") { echo 'active font-weight-bold'; } ?>">
						<a href="#">
							Visualizando
						</a>
					</li>
				<?php } ?>
			</ol>
		</div>

		<?php if(!empty($MyTreinamento) AND $MyTreinamento->modulo == $MyMod) { ?>
			<div class="video-trainamento d-flex justify-content-end align-items-center col-6">
				<button type="button" class="btn btn-w-m btn-danger" data-toggle="modal" data-target="#modalVideoTreinamento"><i class="fal fa-question"></i> Ver video aula</button>

				<div class="modal inmodal fade" id="modalVideoTreinamento" tabindex="-1" role="dialog" aria-hidden="true" style="display: none;">
					<div class="modal-dialog modal-lg">
						<div class="modal-content rounded-0">
							<div class="modal-body pt-4 mt-2">
								<?php if($MyTreinamento->tipo_link == '1') { ?>
									<iframe frameborder="0" allowfullscreen="" style="width: 100%; min-height: 500px" src="//www.youtube.com/embed/<?php echo $MyTreinamento->codigo; ?>"></iframe>
								<?php } else { ?>
									<iframe src="//player.vimeo.com/video/<?php echo $MyTreinamento->codigo; ?>" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
								<?php } ?>
							</div>
						</div>
					</div>
				</div>
			</div>
		<?php } ?>
	</div>

<?php } ?>
