<?php
session_start();
include_once ('../include/session.php');
require_once '../include/class.user.php';
if(!isset($_SESSION['acc_no'])){
	
header("Location: login.php");
exit(); 
}
$reg_user = new USER();



$stmt = $reg_user->runQuery("SELECT * FROM account WHERE acc_no=:acc_no");
$stmt->execute(array(":acc_no"=>$_SESSION['acc_no']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);

if(isset($_GET['subject'])){
	
$subject=$_GET['subject'];	

$msg = $reg_user->runQuery("SELECT * FROM message WHERE subject='$subject'");
$msg->execute();
$show = $msg->fetch(PDO::FETCH_ASSOC);


}


?>


 <?php include 'header.php'; ?>
 
 <!---begin of Mobile View Here   only from Digital Forest Team-->
 
       <?php include 'mobmenu.php'; ?>
  
  <!---End of Mobile View Here   only from Digital Forest Team-->
  
   <!---begin of Main Menu View View Here   only from Digital Forest Team-->
   <?php include 'mainmenu.php'; ?>

     <!---End of Main Menu View Here   only from Digital Forest Team-->
     
     
     
  
    <div class="container-fluid mt--7">
      
      
      
      
      
      
      
     <div class="row">
        <div class="col-xl-4 order-xl-2 mb-5 mb-xl-0">
          <div class="card card-profile shadow">
            <div class="row justify-content-center">
              <div class="col-lg-3 order-lg-2">
                <div class="card-profile-image">
                  <a href="#">
                    <img src="admin/pic/<?php echo $row['uname']; ?>.jpg" class="rounded-circle">
                  </a>
                </div>
              </div>
            </div>
            <div class="card-header text-center border-0 pt-8 pt-md-4 pb-0 pb-md-4">
              <div class="d-flex justify-content-between">
                <a href="#" class="btn btn-sm btn-info mr-4"><?php echo $row['status']; ?></a>
                <a href="#" class="btn btn-sm btn-default float-right"><?php echo $row['type']; ?></a>
              </div>
            </div>
             
            <div class="card-body pt-0 pt-md-4">
               <div class="row">
                <div class="col">
                  &nbsp;
                </div>
              </div>
              <div class="text-center">
                <h3>
                  <?php echo $row['fname']; ?> <?php echo $row['lname']; ?> <span class="font-weight-light">, Date of Birth:  <?php echo $row['dob']; ?></span>
                </h3>
                <div class="h5 font-weight-300">
                  <i class="ni location_pin mr-2"></i><?php echo $row['addr']; ?>	
                </div>
                
              </div>
            </div>
          </div>
        </div>
        <div class="col-xl-8 order-xl-1">
          <div class="card bg-secondary shadow">
            <div class="card-header bg-white border-0">
              <div class="row align-items-center">
                <div class="col-8">
                  <h3 class="mb-0">Bank Messages</h3>
                </div>
                <div class="col-4 text-right">
                  <a href="editpass.php" class="btn btn-sm btn-primary">Settings</a>
                </div>
              </div>
            </div>
            <div class="card-body">
              
                
              
             
						<!-- END mail-box-toolbar -->
						<!-- BEGIN mail-box-container -->
						<div class="mail-box-container">
							<div data-scrollbar="true" data-height="100%">
								<div class="email-detail">
									<!-- BEGIN mail-detail-header -->
									<div class="email-detail-header">
										<h4 class="email-subject"><?php echo $show['subject']; ?></h4>
										<div class="email-sender">
											<a href="javascript:;" class="email-sender-img">
												<img src="img/company6.png" alt="" />
											</a>
											<div class="email-sender-info">
												<h4 class="title"><?php echo $show['sender_name']; ?></h4>
												<div class="time"><?php echo $show['date']; ?></div>
												<div class="email-to">
													<small class="text-muted m-r-5">to</small> <?php echo $row['fname']; ?> <?php echo $row['lname']; ?>
												</div>
											</div>
										</div>
									</div>
									<!-- END mail-detail-header -->
									<div class="email-detail-content">
										<!-- BEGIN email-detail-attachment -->
										
										<!-- END email-detail-attachment -->
										<!-- BEGIN email-detail-body -->
										<div class="email-detail-body">
											<?php echo $show['msg']; ?>
										</div>
										<!-- END email-detail-body -->
									</div>
								</div>
							</div>
						</div>
						<!-- END mail-box-container -->
              
              
              
              
              
            </div>
          </div>
        </div>
      </div>
      
      
      
       
      
      
     
      <!-- Footer -->
       <?php include 'footercopyright.php'; ?>
      
     