<?php
session_start();
include "includes/database.php";
include "includes/functions.php";

$conn = new Functions();

//fetch school details from database
$sql = "SELECT * FROM general_settings";
$conn->query($sql);
$church_details = $conn->fetchSingle();
$logo = $church_details->logo;
$church_name = $church_details->church_name;
$main_url = $church_details->main_url;
$footer = $church_details->footer;
global $church_name;
$base_url = $conn->base_url();
$main_url = $conn->main_url();
?>
<!DOCTYPE html>
<html lang="en">
  <head>
  <meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no" />
    <link rel="apple-touch-icon" href="pages/ico/60.png">
    <link rel="apple-touch-icon" sizes="76x76" href="<?php echo $base_url; ?>pages/ico/76.png">
    <link rel="shortcut icon" href="<?php echo $base_url; ?>upload/<?php echo $logo; ?>">
    <title>Admin Login | <?php echo $church_name; ?></title>
    <meta name="apple-mobile-web-app-cap<?php echo $base_url; ?>able" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta content="Meet pages - The simplest and fastest way to build web UI for your dashboard or app." name="description" />
    <meta content="Ace" name="author" />
    <link href="<?php echo $base_url; ?>assets/plugins/pace/pace-theme-flash.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo $base_url; ?>assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link href="<?php echo $base_url; ?>assets/plugins/jquery-scrollbar/jquery.scrollbar.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="<?php echo $base_url; ?>assets/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css" media="screen" />
    <link class="main-stylesheet" href="<?php echo $base_url; ?>assets/pages/css/pages.css" rel="stylesheet" type="text/css" />
      <!-- Toastr-->
      <link rel="stylesheet" href="<?php echo $base_url; ?>assets/plugins/toastr/toastr.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css">
    <!-- Please remove the file below for production: Contains demo classes -->
    <link class="main-stylesheet" href="<?php echo $base_url; ?>assets/css/style.css" rel="stylesheet" type="text/css" />
  <style>
    .pgn.push-on-sidebar-open.pgn-simple {
    width: 396px !important;
    margin: auto !important;
}

.pgn-simple .alert {
    padding-top: 9px;
    padding-bottom: 9px;

}
  </style>
</head>
  <body class="fixed-header ">
    <div class="login-wrapper " style="background: url(https://1.bp.blogspot.com/-RLQi8BIqH80/Xepb9OdAMRI/AAAAAAAArlA/R5pdlH7EY9krHS4I7MRHwA6fyXIOdA2MwCNcBGAsYHQ/s1600/IMG_7708.JPG);">
      <!-- START Login Background Pic Wrapper-->
      <div class="bg-pic">
        <!-- START Background Caption-->
        <div class="bg-caption pull-bottom sm-pull-bottom text-white p-l-20 m-b-20">
          <!-- <h1 class="semi-bold text-white">
				<?php echo date('Y'); ?> NUPE CHRISTIAN FELLOWSHIP INTERNATIONAL CONFERENCE</h1> -->
          <!-- <p class="small">
            Our beautifully-designed UI Framework come with hundreds of customizable features. Every Layout is just a starting point. ©2019-2020 All Rights Reserved. Pages® is a registered trademark of Revox Ltd.
          </p> -->
        </div>
        <!-- END Background Caption-->
      </div>
      <!-- END Login Background Pic Wrapper-->
      <!-- START Login Right Container-->
      <div class="login-container bg-white">
        <div class="p-l-50 p-r-50 p-t-50 m-t-30 sm-p-l-15 sm-p-r-15 sm-p-t-40">
          <img src="<?php echo $base_url; ?>upload/<?php echo $logo; ?>" alt="logo" data-src="<?php echo $base_url; ?>upload/<?php echo $logo; ?>" data-src-retina="<?php echo $base_url; ?>upload/<?php echo $logo; ?>" width="48" height="48">
          <h3 class="p-t-25">Admin Portal</h3>
          <!-- <p class="mw-80 m-t-5">Sign in to your account</p> -->
          <div id="msg"></div>
          <!-- START Login Form -->
          <form autocomplete="off" action="" method="post" id="login_form">
            <!-- START Form Control-->
            <div class="form-group form-group-default">
              <label>Username</label>
              <div class="controls">
                <input type="text" name="username" placeholder="Enter Username Here" class="form-control" required>
              </div>
            </div>
            <!-- END Form Control-->
            <!-- START Form Control-->
            <div class="form-group form-group-default">
              <label>Password</label>
              <div class="controls">
                <input type="password" class="form-control" name="password" placeholder="Enter Password Here" required>
              </div>
            </div>
            <!-- START Form Control-->
            <div class="row">
              <div class="col-md-6 no-padding sm-p-l-10">
                <div class="form-check">
                  <input type="checkbox" value="1" id="checkbox1">
                  <label for="checkbox1">Remember me</label>
                </div>
              </div>
              <div style="padding-left:0" class="col-md-12 d-flex align-items-center justify-content-end">
              <button id="msgb" aria-label="" class="btn-animated from-left col-md-12 btn btn-primary btn-lg m-t-10">
            <span>Sign in</span>
            <span class="hidden-block">
													<i class="pg-icon">unlock</i>
												</span></button>
              </div>
            </div>
            <!-- <div class="m-b-5 m-t-30">
              <a href="#" class="normal">Lost your password?</a>
            </div> -->
            <!-- <div>
              <a href="#" class="normal">Not a member yet? Signup now.</a>
            </div> -->
            <!-- END Form Control-->
          </form>
          <!--END Login Form-->
          <div class="pull-bottom sm-pull-bottom">
            <div class="m-b-30 p-r-80 sm-m-t-20 sm-p-r-15 sm-p-b-20 clearfix">
              <div class="col-sm-12 no-padding m-t-10">
                <p class="small-text normal hint-text">
                  ©<?php echo date('Y'); ?> Developed & Designed by <a href="https://facebook.com/ganajohnpj">John4peace</a>
                </p>
              </div>
            </div>
          </div>
        </div>
      </div>
      <!-- END Login Right Container-->
    </div>
    
    </div>
    <!-- END OVERLAY -->
    <!-- BEGIN VENDOR JS -->
    <script src="<?php echo $base_url; ?>assets/plugins/pace/pace.min.js" type="text/javascript"></script>
    <!--  A polyfill for browsers that don't support ligatures: remove liga.js if not needed-->
    <script src="<?php echo $base_url; ?>assets/plugins/liga.js" type="text/javascript"></script>
    <script src="<?php echo $base_url; ?>assets/plugins/jquery/jquery-3.2.1.min.js" type="text/javascript"></script>
    <script src="<?php echo $base_url; ?>assets/plugins/modernizr.custom.js" type="text/javascript"></script>
    <script src="<?php echo $base_url; ?>assets/plugins/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
    <script src="<?php echo $base_url; ?>assets/plugins/popper/umd/popper.min.js" type="text/javascript"></script>
    <script src="<?php echo $base_url; ?>assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="<?php echo $base_url; ?>assets/plugins/jquery/jquery-easy.js" type="text/javascript"></script>
    <script src="<?php echo $base_url; ?>assets/plugins/jquery-unveil/jquery.unveil.min.js" type="text/javascript"></script>
    <script src="<?php echo $base_url; ?>assets/plugins/jquery-ios-list/jquery.ioslist.min.js" type="text/javascript"></script>
    <script src="<?php echo $base_url; ?>assets/plugins/jquery-actual/jquery.actual.min.js"></script>
    <script src="<?php echo $base_url; ?>assets/plugins/jquery-scrollbar/jquery.scrollbar.min.js"></script>
    <script type="text/javascript" src="<?php echo $base_url; ?>assets/plugins/select2/js/select2.full.min.js"></script>
    <script type="text/javascript" src="<?php echo $base_url; ?>assets/plugins/classie/classie.js"></script>
    <script src="<?php echo $base_url; ?>assets/plugins/jquery-validation/js/jquery.validate.min.js" type="text/javascript"></script>
    <!-- END VENDOR JS -->
    <script src="<?php echo $base_url; ?>assets/pages/js/pages.min.js"></script>
    <!-- Toastr-->
<script src="<?php echo $base_url; ?>assets/plugins/toastr/toastr.min.js"></script>

<script>
    $(function () {
        $('#login_form').on('submit', function (event) {
            event.preventDefault();
            let formData = $(this).serialize();
            $.ajax({
                type: "POST",
                url: "<?php echo $base_url; ?>process-login.php",
                data: formData,
                beforeSend: function () {
                    $('#msg').html("");
                },
                success: function (response) {
                    $('#msgb').attr('disabled', false);
                    $('#msg').html(response);
                }
            })
        })
    })
</script>
    <!-- <script>
    $(function()
    {
      $('#form-login').validate()
    })
    </script> -->

  </body>
</html>