<?php 
include_once "../conexao/functions.php";
session_start();
$config = buscarConfig();
$usuario = buscarUsuariosID($_SESSION['admin_id']);

// var_dump($usuario); die();
?>
<!DOCTYPE html>
<html lang="pt-br">
<?php include_once "./includes/head.php"; ?>
<body class="dark-only">
  <!-- Loader starts-->
  <div class="loader-wrapper">
    <div class="loader-index"><span></span></div>
    <svg>
      <defs></defs>
      <filter id="goo">
        <fegaussianblur in="SourceGraphic" stddeviation="11" result="blur"></fegaussianblur>
        <fecolormatrix in="blur" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 19 -9" result="goo">    </fecolormatrix>
      </filter>
    </svg>
  </div>
  <!-- Loader ends-->
  <!-- page-wrapper Start-->
  <div class="page-wrapper compact-wrapper" id="pageWrapper">
    <?php include_once "./includes/header.php"; ?>
    <!-- Page Body Start-->
    <div class="page-body-wrapper sidebar-icon">
      <!-- Page Sidebar Start-->
      <?php include_once "./includes/menu.php"; ?>
      <!-- Page Sidebar Ends-->
      <div class="page-body">
        <div class="container-fluid">
          <div class="page-header">
            <div class="row">
              <div class="col-lg-6">
                <h3>Configurações</h3>
                <ol class="breadcrumb">
                  <li class="breadcrumb-item"><a href="index-2.html"><i data-feather="home"></i></a></li>
                  <li class="breadcrumb-item active">Minhas configurações</li>
                </ol>
              </div>
            </div>
          </div>
        </div>
        <!-- Container-fluid starts-->
        <div class="container-fluid">
          <div class="row">
            <div class="col-xl-12">
              <div class="row">
                <div class="col-xl-12 col-sm-12 box-col-12">
                  <div class="card">
                    <div class="card-header">
                      <h5>Configurar painel</h5><span>Configurações do <b>App Panel v.1</b></span>
                    </div>
                    <div class="card-body">
                      <form class="needs-validation"  novalidate="" action="actions/config.php" method="POST">
                        <div class="row">
                          <div class="col-md-4 mb-3">
                            <label for="validationTooltip01">Titulo</label>
                            <input class="form-control" id="validationTooltip01" type="text" placeholder="Link do seu ícone (.png)" name="titulo" value="<?php echo $config['Titulo']; ?>" required="">
                            <div class="valid-tooltip">Muito bom!</div>
                          </div>
                          <div class="col-md-4 mb-3">
                            <label for="validationTooltip02">Ícone site</label>
                            <input class="form-control" id="validationTooltip02" type="text" placeholder="Link da sua logotipo (.png)" name="icone" value="<?php echo $config['Logotipo_1']; ?>" required="">
                            <div class="valid-tooltip">Muito bom</div>
                          </div>
                          <div class="col-md-4 mb-3">
                            <label for="validationTooltip02">Logotipo site</label>
                            <input class="form-control" id="validationTooltip02" type="text" placeholder="Link da sua logotipo  (.png)" name="logo" value="<?php echo $config['Logotipo_2']; ?>" required="">
                            <div class="valid-tooltip">Muito bom</div>
                          </div>
                        </div>
                        <div class="row">
                          <div class="col-md-6 mb-3">
                            <label for="validationTooltip03">Background</label>
                            <input class="form-control" id="validationTooltip03" type="text" placeholder="Link do background  (.png)" name="background" value="<?php echo $config['Background']; ?>" required="">
                            <div class="invalid-tooltip">Adicione o link</div>
                          </div>
                          <div class="col-md-3 mb-3">
                            <label for="validationTooltip04">Email</label>
                            <input class="form-control" name="email" value="<?php echo $usuario['Email']; ?>" id="validationTooltip04" type="email" placeholder="Digite seu email ou deixe em branco">
                            <div class="invalid-tooltip">Digite um email</div>
                          </div>
                          <div class="col-md-3 mb-3">
                            <input type="password" style="display:none">
                            <label for="validationTooltip05">Senha</label>
                            <input class="form-control" name="senha" id="validationTooltip05" type="password" placeholder="Digite sua senha ou deixe em branco">
                            <div class="invalid-tooltip">Digite uma senha</div>
                          </div>
                        </div>
                        <button class="btn btn-primary" name="submit" type="submit">Salvar informações</button>
                      </form>
                    </div>
                  </div>
                </div>
              </div>
            </div>



          </div>
        </div>
        <!-- Modal de editar clientes -->
        <div class="modal fade bd-example-modal-lg" id="exampleModalgetbootstrap" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
          <div class="modal-dialog modal-lg" role="document" id="modal_jef">

          </div>
        </div>
        <!-- Fim modal -->
        <!-- Container-fluid Ends-->
      </div>
      <!-- footer start-->
      <?php include_once "./includes/footer.php"; ?>
    </div>
  </div>
  <!-- latest jquery-->
  <script src="assets/js/jquery-3.5.1.min.js"></script>
  <!-- Bootstrap js-->
  <script src="assets/js/bootstrap/popper.min.js"></script>
  <script src="assets/js/bootstrap/bootstrap.js"></script>
  <!-- feather icon js-->
  <script src="assets/js/icons/feather-icon/feather.min.js"></script>
  <script src="assets/js/icons/feather-icon/feather-icon.js"></script>
  <!-- Sidebar jquery-->
  <script src="assets/js/sidebar-menu.js"></script>
  <script src="assets/js/config.js"></script>
  <!-- Plugins JS start-->
  <script src="assets/js/tooltip-init.js"></script>
  <!-- Plugins JS Ends-->
  <!-- Theme js-->
  <script src="assets/js/script.js"></script>
  <script src="assets/js/notify/bootstrap-notify.min.js"></script>
  <!-- login js-->
  <!-- Plugin used-->
  <script src="assets/js/sweet-alert/swalert.js" aria-hidden="true"></script>
  <script src="assets/js/form-validation-custom.js"></script>

 <?php 
 if (isset($_GET["r"])) {
  $result = $_GET["r"];
  switch ($result) {
    case "app_adicionado":
    echo "<script src='assets/js/notify/index.js'></script>";
    break;
    case "app_erro":
    echo "<script src='assets/js/notify/erro.js'></script>";
    break;
    case "app_editado":
    echo "<script src='assets/js/notify/sucesso_app.js'></script>";
    break;
    case "app_erro_edit":
    echo "<script src='assets/js/notify/erro_app.js'></script>";
    break;
  }
}
?>
</body>
</html>