<?php
include "connection.php";
if (session_status()== PHP_SESSION_NONE){
  session_start();

}


// echo 'MEM_ID: ' . (isset($_SESSION['MEM_ID']) ? $_SESSION['MEM_ID'] : 'Not Set');


// if (!isset($_SESSION['MEM_ID'])) {
//     header("Location: index.php");
//     exit();
// }

$MEM_ID = $_SESSION['MEM_ID'];
$query = "SELECT PAYMENT_STATUS FROM NAA_EVENTS_REG WHERE MEM_ID = :MEM_ID";
$stid = oci_parse($conn, $query);
oci_bind_by_name($stid, ":MEM_ID", $MEM_ID);
oci_execute($stid);

$payment_status = '';
if ($row = oci_fetch_assoc($stid)) {
    $payment_status = $row['PAYMENT_STATUS'];
}
?>





<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
      <title></title>

      <link rel="shortcut icon" type="image/jpg" href="assets/img/logo.jpg">
      <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css?h=a9a31ec932de3114d9b1ed27688edc60">
      <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
      <!--
      <link rel="stylesheet"
         href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i">
      <link rel="stylesheet" href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css" />
      <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.7.0/css/buttons.dataTables.min.css" />-->
      <!-- ===== CSS ===== -->
      <!-- <link rel="stylesheet" href="/assets/css/styles.css"> -->
      <!-- Icon link added -->
      <!--<script src="https://kit.fontawesome.com/c598047e8f.js" crossorigin="anonymous"></script>
      <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">-->
      <style>
         /* @media screen and (max-width: 572px) {
         #myInput {
         width: 103% !important;
         margin-bottom: 1rem;
         }
         } */
         .sidebar .nav-item .nav-link[data-toggle=collapse]:after {
         width: 1rem;
         text-align: center;
         float: right;
         vertical-align: 0;
         border: 0;
         font-weight: 900;
         content: "\f107";
         font-family: Font Awesome\ 5 Free;
         }
         #collapseA:after,
         #collapseB:after {
         display: block;
         position: absolute;
         top: 50%;
         right: 20px;
         transform: translateY(-50%);
         }
         accordionSidebar {
         padding-right: 0 !important;
         margin-right: 0 !important;
         }
         #accordionSidebar a:hover {
         color: #145ee7 !important;
         }
         #accordionSidebar a {
         color: #ffffffcc !important;
         }
         #accordionSidebar a.active {
         /* background-color: #ccc; */
         color: white !important;
         }
      </style>
   </head>
   <body id="page-top">
      <div id="wrapper">
         <nav class="navbar navbar-dark align-items-start sidebar accordion p-0" id="sidebar"
            style="background-color: rgb(5, 42, 65); transition: 0.5s;">
            <div class="container-fluid d-flex flex-column p-0" style="margin-top: 0rem!important;">
               <a class="navbar-brand d-flex justify-content-center align-items-center sidebar-brand m-0" href="edit.php">
                  <div class="sidebar-brand-icon"><i class=""><img class="border rounded-0 mt-2"
                     src="assets/img/Holy_cross.png" height="50" alt=""></i></div>
                  <!-- <div class="sidebar-brand-text mx-2"><span>NDC Alumni</span></div> -->
               </a>
               <hr class="sidebar-divider my-2">
               <ul class="nav navbar-nav" id="accordionSidebar"
                  style="margin-right: 0 !important; padding-right: 0rem !important;">
                  <li class="nav-item"><a class="nav-link" href="edit.php"><i
                     class="fas fa-user"></i>&nbsp;&nbsp;<span>Hi, <?php echo $_SESSION['MEM_NAME']; ?></span></a></li>



                     <li class="nav-item">
    <a class="nav-link" href="edit.php">
        <i class="fa fa-edit"></i>&nbsp;&nbsp;<span> Update Profile</span>
    </a>
</li>

<?php if($payment_status == 'P'): ?>
    <!-- Payment complete: disable Payment button, show Download -->
    <li class="nav-item">
        <a class="nav-link disabled" href="#" style="pointer-events: none; opacity: 0.6;">
            <i class="fa fa-credit-card"></i>&nbsp;&nbsp;<span> Payment</span>
        </a>
    </li>
    <!-- <li class="nav-item">
        <a class="nav-link" href="download.php">
            <i class="fa fa-download"></i>&nbsp;&nbsp;<span> Download</span>
        </a>
    </li> -->

    
<?php else: ?>
    <!-- Payment pending: show Payment button only -->
    <li class="nav-item">
        <a class="nav-link" href="tracking.php">
            <i class="fa fa-credit-card"></i>&nbsp;&nbsp;<span> Payment</span>
        </a>
    </li>
<?php endif; ?>


                     <!-- <li class="nav-item"><a class="nav-link" href="invoice.php"><i
                        class="fas fa-money-bill-alt"></i>&nbsp;&nbsp;<span> Payment</span></a></li> -->
                  <!-- <li class="nav-item"><a class="nav-link" href="all_event.php"><i
                     class="fas fa-book-reader"></i>&nbsp;&nbsp;<span>Event</span></a></li> -->
                  <li class="nav-item"><a class="nav-link" href="change_password.php"><i
                     class="fas fa-book-reader"></i>&nbsp;&nbsp;<span>Change Password</span></a></li>   

                     <li class="nav-item"><a class="nav-link" href="index.php"><i
                     class="fas fa-sign-out-alt"></i>&nbsp;&nbsp;<span>Logout</span></a></li>
               </ul>
               <div class="text-center d-none d-md-inline"></div>
            </div>
         </nav>
         
         <div>
            <div id="content">
            <button class="btn btn-link rounded-circle mr-3" data-bs-hover-animate="swing"
                        id="sidebarToggleTop" type="button"><i class="fas fa-bars"
                        style="color: black;"></i></button>
 
         </div>
      </div>



      
      <a class="border rounded d-inline scroll-to-top " href="#page-top "><i class="fas fa-angle-up "></i></a>
      <!--===== MAIN JS =====-->
      <script src="js/main.js "></script>
      <!-- Optional JavaScript; choose one of the two! -->
      <!-- Option 1: jQuery and Bootstrap Bundle (includes Popper) -->
      <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js "
         integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj "
         crossorigin="anonymous "></script>
      <script src="assets/js/script.min.js?h=af3a23ce326fbc8eb447b5418ddb619e "></script>
      <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js "></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.2/js/bootstrap.bundle.min.js "></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.bundle.min.js "></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.js "></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/js/bootstrap-select.min.js "
         integrity="sha512-yDlE7vpGDP7o2eftkCiPZ+yuUyEcaBwoJoIhdXv71KZWugFqEphIS3PU60lEkFaz8RxaVsMpSvQxMBaKVwA5xg=="
         crossorigin=" anonymous "></script>-->
      
   </body>
</html>