<?php
session_start();
$user = "educateb_bof-engla";
$pass = "bof-engla.com";
$dbname = "educateb_bof-engla";
$conn = mysqli_connect("localhost", $user, $pass, $dbname);
$sql = "SELECT * FROM site_details";
$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {
        while($row = mysqli_fetch_assoc($result)) {
            $email = $row["email"];
            $sitename = $row["site_name"];
            $location = $row["location"];
            $phone = $row["phone"];
        }
}

if (!isset($_SESSION["online_id"])){
    header("Location: login.php");
}
else{
    $online_id = $_SESSION["online_id"];
    $sql = "SELECT online_id, status FROM accounts WHERE online_id='$online_id'";
    $result = mysqli_query($conn, $sql);
    
    if (mysqli_num_rows($result) > 0) {
        while($row = mysqli_fetch_assoc($result)) {
            $chk_id = $row["online_id"];
            $status = $row["status"];
        }
        if($status == "Suspended"){
            header("Location: sign_out.php");
        }
    }
    $online_id = $_SESSION["online_id"];
    $conn = mysqli_connect("localhost", $user, $pass, $dbname);
    if (!$conn) {
        die("Connection failed: " . mysqli_connect_error());
    }
    $sql = "SELECT * FROM accounts WHERE online_id='$online_id'";
    $result = mysqli_query($conn, $sql);
    
    if (mysqli_num_rows($result) > 0) {
        while($row = mysqli_fetch_assoc($result)) {
            $online_id = $row["online_id"];
            $balance = $row["balance"];
            $reg_firstname = $row["reg_firstname"];
            $reg_middlename = $row["reg_middlename"];
            $reg_lastname = $row["reg_lastname"];
            $reg_acc_type = $row["reg_acc_type"];
            $account_no = $row["account_no"];
            $reg_phone1 = $row["reg_phone1"];
            $passport = $row["passport"];
            $reg_nos_firstname = $row["reg_nos_firstname"];
            $reg_nos_middlename = $row["reg_nos_middlename"];
            $reg_nos_lastname = $row["reg_nos_lastname"];
        }
    }
    
    $mcontent = "<div class=\"container mt-5\" id=\"London1\" style=\"\">
            <div class=\"mt-5\" style=\"\"><h4 class='text-success1 font-weight-bold'>Bill Payments</h4></div>
            <ul class=\"list-group text-dark bg-white\">
                <li class='list-group-item'><a href=\"online-account.php\" class=\"btn btn-lg\">Pay Internet Bills <i class=\"fa fa-arrow-circle-right text-success1\"></i></a></li>
                <li class='list-group-item'><a href=\"flight.php\" class=\"btn btn-lg\">Flight Reservations <i class=\"fa fa-arrow-circle-right text-success1\"></i></a></li>
                <li class='list-group-item'><a href=\"online-account.php\" class=\"btn btn-lg\">Pay Electricity Bills <i class=\"fa fa-arrow-circle-right text-success1\"></i></a></li>
                <li class='list-group-item'><a href=\"online-account.php\" class=\"btn btn-lg\">Interswitch <i class=\"fa fa-arrow-circle-right text-success1\"></i></a></li>
                <li class='list-group-item'><a href=\"online-account.php\" class=\"btn btn-lg\">eTransact <i class=\"fa fa-arrow-circle-right text-success1\"></i></a></li>
                <li class='list-group-item'><a href=\"online-account.php\" class=\"btn btn-lg\">Hotel reservation <i class=\"fa fa-arrow-circle-right text-success1\"></i></a></li>
                <li class='list-group-item'><a href=\"online-account.php\" class=\"btn btn-lg\">Pay Internet Bills <i class=\"fa fa-arrow-circle-right text-success1\"></i></a></li>
            </ul>

            

            <div id=\"\" class=\"container\">

                <p style=\"margin-top: 15px;font-weight:bold;font-size: 12px;color: #069;font-style: italic;\"><i class='fa fa-lightbulb text-warning'></i>&nbsp;If you have any issues regarding your bill payments status, please do not hesitate to contact the office in charge of client accounts management, by sending an email to $email</p>
                
                
            </div>
        </div>";
}
$sql = "SELECT * FROM site_details";
$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {
        while($row = mysqli_fetch_assoc($result)) {
            $email = $row["email"];
            $sitename = $row["site_name"];
            $location = $row["location"];
            $phone = $row["phone"];
        }
}
?>
<?php
include("accountheader.php");
?>
<div class="header-bg" style="width:100%;overflow:hidden">
    <div class="row">
        <div class="col-sm-3 mob2 shadow bg-light" style="">
            <?php
            include("accountsidebar.php");
            ?>
        </div>
        <div class="col-sm-9 pb-5" style="padding:0px;margin:0px">
            <?php
            include("dashhome.php");
            ?>
            
            <div class="container mt-5">
                <div class="">
                    <? echo $mcontent; ?>
                </div>
            </div>
            
        </div>
    </div>
</div>
<?php
include("footer1.php");
?>