<?php
session_start();
require_once("../config.php");

// Redirect if not logged in
if (!isset($_SESSION['SESS_ADMINLOGGEDIN']) || $_SESSION['SESS_ADMINLOGGEDIN'] !== true) {
    header("Location: adminlogin.php");
    exit();
}




// Fetch Admin Username from Session
// $admin_id = $_SESSION['ADMIN_ID'];

$admin_id = $_SESSION['SESS_ADMINUSERID'];


$stmt = $pdo->prepare("SELECT username FROM logins WHERE id = ?");
$stmt->execute([$admin_id]);
$admin = $stmt->fetch(PDO::FETCH_ASSOC);
$username = $admin['username'] ?? 'Admin';




date_default_timezone_set('Africa/Lagos');
?>



  
  
  
 <?php
// Prepare the statement to retrieve all admins
$stmt = $pdo->prepare("SELECT * FROM logins");

// Execute the query
$stmt->execute();

// Fetch and process results
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
    // Assuming you want to authenticate based on username and password
   
    $ip = $row['ip'];
    $username = $row['username'];
    $hashedPassword = $row['password']; // Assuming password is hashed in the database

    // Use password_verify to check password against the hash if needed
    // Example: if ($passwordInput && password_verify($passwordInput, $hashedPassword)) { ... }

    // Display username (do not display password)
    // echo "Admin Username: " . htmlspecialchars($username) . "<br>";
}
?>

  
  
  

  
  
  
  
  <!DOCTYPE html>
<html lang="en">

<head>
    <script type="text/javascript" src="js/stripe.js"></script>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
     <div id="ytWidget"></div>
    <!-- CSRF Token -->
    <meta name="csrf-token" content="">
    <title><?php echo $domain_name ?> | Admin Dashboard</title>
    <link rel="icon" href="../img/favicon.png" type="image/png" />

            <!-- Fonts and icons -->
        <script src="dash/js/plugin/webfont/webfont.min.js"></script>
        <!-- Sweet Alert -->
        <script src="dash/js/plugin/sweetalert/sweetalert.min.js "></script>
        <!-- CSS Files -->
        <link rel="stylesheet" href="dash/css/bootstrap.min.css">
        <link rel="stylesheet" href="dash/css/fonts.min.css">
        <link rel="stylesheet" href="dash/css/atlantis.min.css">
        <link rel="stylesheet" href="dash/css/customs.css">
        <link rel="stylesheet" href="dash/css/style.css">
        <link rel="stylesheet" href="dash/css/atlantis.min.css">
        <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.6.2/css/buttons.dataTables.min.css">
        <link rel="stylesheet" type="text/css"
            href="https://cdn.datatables.net/v/bs4/dt-1.10.21/af-2.3.5/b-1.6.3/b-flash-1.6.3/b-html5-1.6.3/b-print-1.6.3/r-2.2.5/datatables.min.css" />
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
        <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />
        <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>

        <!-- Bootstrap Notify -->
        <script src="dash/js/plugin/bootstrap-notify/bootstrap-notify.min.js "></script>
        <script src="dash/js/plugin/sweetalert/sweetalert.min.js "></script>
        <script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.8.1/dist/alpine.min.js" defer></script>
        <script src="https://cdn.jsdelivr.net/npm/chart.js@3.2.1/dist/chart.min.js"></script>

        <!--PayPal-->
        <script>
            // Add your client ID and secret
            var PAYPAL_CLIENT = 'iidjdjdj';
            var PAYPAL_SECRET = 'jijdjkdkdk';

            // Point your server to the PayPal API
            var PAYPAL_ORDER_API = 'https://api.paypal.com/v2/checkout/orders/';
        </script>
        <script src="https://www.paypal.com/sdk/js?client-id=iidjdjdj"></script>
        <style >[wire\:loading], [wire\:loading\.delay], [wire\:loading\.inline-block], [wire\:loading\.inline], [wire\:loading\.block], [wire\:loading\.flex], [wire\:loading\.table], [wire\:loading\.grid], [wire\:loading\.inline-flex] {display: none;}[wire\:loading\.delay\.shortest], [wire\:loading\.delay\.shorter], [wire\:loading\.delay\.short], [wire\:loading\.delay\.long], [wire\:loading\.delay\.longer], [wire\:loading\.delay\.longest] {display:none;}[wire\:offline] {display: none;}[wire\:dirty]:not(textarea):not(input):not(select) {display: none;}input:-webkit-autofill, select:-webkit-autofill, textarea:-webkit-autofill {animation-duration: 50000s;animation-name: livewireautofill;}@keyframes livewireautofill { from {} }</style>
        
        <style>
* {
  box-sizing: border-box;
}

#myInput {
  background-image: url('search-icon.png');
  background-position: 10px 10px;
  background-repeat: no-repeat;
  width: 100%;
  font-size: 16px;
  padding: 12px 20px 12px 40px;
  border: 1px solid #ddd;
  margin-bottom: 12px;
}

#myTable {
  border-collapse: collapse;
  width: 100%;
  border: 1px solid #ddd;
  font-size: 18px;
}

#myTable th, #myTable td {
  text-align: left;
  padding: 12px;
}

#myTable tr {
  border-bottom: 1px solid #ddd;
}

#myTable tr.header, #myTable tr:hover {
  background-color: #f1f1f1;
}



</style>

<style>
    label {
        color: black;
    }
</style>

        
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
        
        
</head>

<body data-background-color="dark">
    <div id="app">
		<script>
		{tawk to codess}	
		</script>
        <div>
            <div class="wrapper">
                        <div class="main-header">
    <!-- Logo Header -->
<div class="logo-header" data-background-color="blue">
        
    <button class="ml-auto navbar-toggler sidenav-toggler" type="button" data-toggle="collapse" data-target="collapse" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon">
                <i class='fa fa-bars' style='font-size:25px;color:red'></i>
            </span>
        </button>
        <button class="topbar-toggler more">
            <i class='fa fa-user' style='font-size:35px;color:gold'></i>
        </button>
        <div class="nav-toggle">
            <button class="btn btn-toggle toggle-sidebar">
                <i class='fa fa-bars' style='font-size:25px;color:red'></i>
            </button>
        </div>
        
    </div>
    <!-- End Logo Header -->

    <!-- Navbar Header -->
    <nav class="navbar navbar-header navbar-expand-lg" data-background-color="blue">
        
        <div class="container-fluid">
            <div class="collapse" id="search-nav">
                <!--<a href="adminverify.php">-->
                <!--    <form class="navbar-left navbar-form nav-search mr-md-3" action="">-->
                <!--        <div class="input-group">-->
                <!--            <div class="input-group-prepend">-->
                <!--                <button type="submit" class="pr-1 btn btn-search">-->
                <!--                    <i class="fa fa-search search-icon"></i>-->
                <!--                </button>-->
                <!--            </div>-->
                <!--            <input type="text" placeholder="Manage users" class="form-control text-dark bg-light">-->
                <!--        </div>-->
                <!--    </form>-->
                <!--</a>-->
                
                <script>
                    document.getElementById('searchform').addEventListener('subit' searchuser);
                   function searchuser(){
                       console.log('ddj');
                       let url = "adminverify.php";
                       window.location.href = url;
                   }
               </script>
            </div>
            <ul class="navbar-nav topbar-nav ml-md-auto align-items-center">
                <!--<li>-->
                <!--    <form action="javascript:void(0)" method="post" id="styleform">-->
                <!--        <div class="form-group">-->
                <!--            <label class="style_switch">-->
                <!--                <input name="style" id="style" type="checkbox" value="true" class="modes">-->
                <!--                <span class="slider round"></span>-->
                <!--            </label>-->
                <!--        </div> -->
                <!--        <input type="hidden" name="_token" value="">-->
                <!--    </form>-->
                <!--</li>-->
               
                <li class="nav-item dropdown hidden-caret">
                    <a class="nav-link" data-toggle="dropdown" href="#" aria-expanded="false">
                       <button class="mr-2 btn btn-warning btn-border">ADMIN PASKEY</button>
                    </a>
                   
                    <ul class="dropdown-menu dropdown-user animated fadeIn">
                        <div class="dropdown-user-scroll scrollbar-outer">
                            <li>
                                
                                
                                <a class="dropdown-item" href="generate_pal.php">Genarate Parcel</a>
                                 <div class="dropdown-divider"></div>
                                 
                                <a class="dropdown-item" href="password.php">Change Password</a>
                                 <div class="dropdown-divider"></div>
                                 
                                 <a class="dropdown-item" href="maintenance.php?id=21">Maintenance Mood</a>
                                <div class="dropdown-divider"></div>
                                
                              <a class="dropdown-item" href="logout.php">
                                Logout
                                </a>
                                <!--<form id="logoutform" action="adminlogin/logout" method="POST" style="display: none;">-->
                                <!--    <input type="hidden" name="_token" value="">-->
                                <!--</form>-->
                            </li>
                        </div>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>
    <!-- End Navbar -->
</div>


<script type="text/javascript">
    //create investment
        $("#styleform").on('change',function(){
        $.ajax({
            url: "changestyle",
            type: 'POST',
            data:$("#styleform").serialize(),
            success: function (data) {
				location.reload(true);
            },
            error: function (data) {
                console.log('Something went wrong');
            },

        });
    });
    
</script>
        <!-- Stored in resources/views/child.blade.php -->

<!-- Sidebar -->
<div class="sidebar sidebar-style-2" data-background-color="light">
    <div class="sidebar-wrapper scrollbar scrollbar-inner">
        <div class="sidebar-content">
            <div class="user">
                <div class="info">
                    <a data-toggle="collapse" href="#collapseExample" aria-expanded="true">
                        <span>
                            Admin Panel
                            <span class="user-level"> Admin</span>
                            
                        </span>
                    </a>
                </div>
            </div>

            <ul class="nav nav-primary">
                <li class="nav-item active">
                    <a href="dashboard.php">
                        <i class="fa fa-home"></i>
                        <p>DASHBOARD</p>
                    </a>
                </li>
                
                    <li
                        class="nav-item    ">
                        <a data-toggle="collapse" href="#pln">
                            <i class="fa fa-cubes "></i>
                            <p>COURIER</p>
                            <span class="caret"></span>
                        </a>
                        <div class="collapse" id="pln">
                            <ul class="nav nav-collapse">
                               
                                <li>
                                    
                                    <a href="list_parcel.php">
                                        <span class="sub-item">List Parcels</span>
                                    </a>
                                    
                                    
                                    
                                     <a href="add_parcel.php">
                                        <span class="sub-item">Add Parcel</span>
                                    </a>
                                    
                                  
                                </li>
                            </ul>
                        </div>
                    </li>
                    
                    
                    
                    
                    
                    
                     <!--<li class="nav-item    ">-->
                     <!--   <a data-toggle="collapse" href="#fin">-->
                     <!--       <i class="fa fa-money "></i>-->
                     <!--       <p>Finance</p>-->
                     <!--       <span class="caret"></span>-->
                     <!--   </a>-->
                     <!--   <div class="collapse" id="fin">-->
                     <!--       <ul class="nav nav-collapse">-->
                               
                     <!--           <li>-->
                     <!--               <a href="mdeposits.php">-->
                     <!--                   <span class="sub-item">Manage Deposits</span>-->
                     <!--               </a>-->
                                    
                     <!--               <a href="mwithdrawals.php">-->
                     <!--                   <span class="sub-item">Manage Withdrawals</span>-->
                     <!--               </a>-->
                                    
                                    <!--<a href="mining.php">-->
                                    <!--    <span class="sub-item">Mining Investments</span>-->
                                    <!--</a>-->
                                    
                                    <!--<a href="realestate.php">-->
                                    <!--    <span class="sub-item">RealEstate Investments</span>-->
                                    <!--</a>-->
                                    
                                    <!--<a href="giveaway.php">-->
                                    <!--    <span class="sub-item">GiveAway Investments</span>-->
                                    <!--</a>-->
                                    
                                  
                    <!--            </li>-->
                    <!--        </ul>-->
                    <!--    </div>-->
                    <!--</li>-->
                    
                    
                    

                    <!--<li-->
                    <!--    class="nav-item    ">-->
                    <!--    <a href="adminverify.php">-->
                    <!--        <i class="fa fa-user-circle" aria-hidden="true"></i>-->
                    <!--        <p>Manage Users</p>-->
                    <!--    </a>-->
                    <!--</li>-->

                    <!--<li-->
                    <!--    class="nav-item   ">-->
                    <!--    <a href="kyc.php">-->
                    <!--        <i class="fa fa-users" aria-hidden="true"></i>-->
                    <!--        <p>Manage KYC</p>-->
                    <!--    </a>-->
                    <!--</li>-->

                    <!--<li-->
                    <!--    class="nav-item    ">-->
                    <!--    <a href="mwithdrawals.php">-->
                    <!--        <i class="fa fa-upload" aria-hidden="true"></i>-->
                    <!--        <p>Manage Wallet</p>-->
                    <!--    </a>-->
                    <!--</li>-->

                 <!--<li class="nav-item ">-->
                 <!--           <a #="msubtrade.php">-->
                 <!--           <i class="fa fa-sync" aria-hidden="true"></i>-->
                 <!--               <p>Manage Trades</p>-->
                 <!--           </a>-->
                 <!--       </li>-->
                                            
                
                    <!--    <li class="nav-item  ">-->
                    <!--    <a data-toggle="collapse" href="#adm">-->
                    <!--        <i class="fa fa-user"></i>-->
                    <!--        <p>Administrator(s)</p>-->
                    <!--        <span class="caret"></span>-->
                    <!--    </a>-->
                    <!--    <div class="collapse" id="adm">-->
                    <!--        <ul class="nav nav-collapse">-->
                    <!--            <li>-->
                    <!--                <a href="addmanager">-->
                    <!--                    <span class="sub-item">Add Manager</span>-->
                    <!--                </a>-->
                    <!--            </li>-->
                    <!--            <li>-->
                    <!--                <a href="madmin">-->
                    <!--                    <span class="sub-item">Manage Administrator(s)</span>-->
                    <!--                </a>-->
                    <!--            </li>-->
                    <!--        </ul>-->
                    <!--    </div>-->
                    <!--</li>-->

                    <li class="nav-item">
                        <a data-toggle="collapse" href="#settings">
                            <i class="fa fa-cog"></i>
                            <p>Settings</p>
                            <span class="caret"></span>
                        </a>
                        <div class="collapse" id="settings">
                            <ul class="nav nav-collapse">
                              
                                <li>
                                    <a href="site_settings.php?id=21">
                                        <span class="sub-item">Site Settings</span>
                                    </a>
                                </li>
                                
                                
                                <!--<li>-->
                                <!--    <a href="site_wallet.php?id=21">-->
                                <!--        <span class="sub-item">Wallet Settings</span>-->
                                <!--    </a>-->
                                <!--</li>-->
                                
                                
                                <li>
                                    <a href="webmail.php">
                                        <span class="sub-item">Webmail</span>
                                    </a>
                                </li>
                                
                                
                                
                                <!-- <li>-->
                                <!--    <a href="currency.php?id=21">-->
                                <!--        <span class="sub-item">Currency</span>-->
                                <!--    </a>-->
                                <!--</li>-->
                                <!--<li>-->
                                <!--    <a href="payment-settings.php">-->
                                <!--        <span class="sub-item">Payment Settings</span>-->
                                <!--    </a>-->
                                <!--</li>-->
                                <!--<li>-->
                                <!--    <a href="manage-crypto-assets.php">-->
                                <!--        <span class="sub-item">Swap Settings</span>-->
                                <!--    </a>-->
                                <!--</li>-->
                                <!--<li>-->
                                <!--    <a href="subscription-settings.php">-->
                                <!--        <span class="sub-item">Subscription Settings</span>-->
                                <!--    </a>-->
                                <!--</li>-->
                                <!--<li>-->
                                <!--    <a href="frontpage.php">-->
                                <!--        <span class="sub-item">Frontend Settings</span>-->
                                <!--    </a>-->
                                <!--</li>-->
                                <!--<li>-->
                                <!--    <a href="privacy-policy.php">-->
                                <!--        <span class="sub-item">Terms and Privacy</span>-->
                                <!--    </a>-->
                                <!--</li>-->
                                <!--<li>-->
                                <!--    <a href="ipaddress.php">-->
                                <!--        <span class="sub-item">IP Address</span>-->
                                <!--    </a>-->
                                <!--</li>-->
                            </ul>
                        </div>
                    </li>
                               
                               
                               
                <!--    <li class="nav-item">-->
                <!--    <a data-toggle="collapse" href="#task">-->
                <!--        <i class="fas fa-align-center"></i>-->
                <!--        <p>Task</p>-->
                <!--        <span class="caret"></span>-->
                <!--    </a>-->
                <!--    <div class="collapse" id="task">-->
                <!--        <ul class="nav nav-collapse">-->
                <!--                    <li>-->
                <!--                    <a href="ctask.php">-->
                <!--                        <span class="sub-item">Create Task</span>-->
                <!--                    </a>-->
                <!--                </li>-->
                <!--                <li>-->
                <!--                    <a href="mtask.php">-->
                <!--                        <span class="sub-item">Manage Task</span>-->
                <!--                    </a>-->
                <!--                </li>-->
                <!--        </ul>-->
                <!--    </div>-->
                <!--</li>-->
                  
                  
                  
                    <!--                <li class="nav-item ">-->
                    <!--    <a href="leads.php">-->
                    <!--        <i class="fas fa-user-slash " aria-hidden="true"></i>-->
                    <!--        <p>Leads</p>-->
                    <!--    </a>-->
                    <!--</li>-->
                    
                    
                    
                
                                                <li class="nav-item ">
                    <a href="about.php">
                        <i class=" fa fa-info-circle" aria-hidden="true"></i>
                        <p>About Onlinetrader</p>
                    </a>
                </li>
                            </ul>
        </div>
    </div>
</div>
<!-- End Sidebar -->