<?php 
  ob_start();
  session_start();
  error_reporting( ~E_NOTICE );
  require_once '../includes/conn.php';
  require_once '../includes/dbconfig.php';
  include('../scripts2.php'); 
?> 

<!DOCTYPE html>
<html lang="en">
<head>
  <?php require_once 'head_link.php'; ?>
  <style type="text/css"> 
    .left{width:30%;}
  </style>
</head>
<body class="bg-white">
<?php // require_once 'header1.php'; ?> 

<?php 
if(isset($_GET['view']) && !empty($_GET['view'])) {
    $customer_id = $_GET['view'];
    
    $stmt_edit = $DB_con->prepare('select * from expense

                              left join office_exp_name on office_exp_name.of_id=expense.expense_name
							  where expense.id = :uid'); 
    
    $stmt_edit->execute(array(':uid' => $customer_id));
    $edit_row = $stmt_edit->fetch(PDO::FETCH_ASSOC);
    extract($edit_row);
} else {
    header("Location: index");
}
?>

<?php // require_once 'sidebar.php'; ?>

<section class="section bg-white">
  <div class="row1">
    <div class="col-lg-7 m-auto mt-3 pb-5 border rounded">
      <table class="table table-hover table-responsive mb-5 ">
        <tr>  
            <?php 
            $sql = $con->query("SELECT * FROM stuff WHERE userid ='".$_SESSION['id']."' ");
            $row = $sql->fetch_assoc();
            $BizLogo = $row['photo'];           
            $BizNam = $row['business_name'];
            $BizDetails = $row['business_details'];
            $BizPhn = $row['business_phone']; 
            $BizEml = $row['business_email'];
            $BizWeb = $row['biz_web'];
            $BizAdr = $row['business_address'];
            ?>
            
            <header class="clearfix text-center">
              <div id="logo"><br>
                <img src="../<?php if($BizLogo==""){echo "../img/user.jpg";}else{echo $BizLogo;} ?>" width="130px"> 
              </div>
              <div id="company"> 
                <h4 class="name"><b><?php echo $BizNam ; ?></b> <br><?php echo $BizDetails ; ?></h4>
              </div>
            </header>
        </tr>

        <tr>
          <div class="mt-4 mb-2 text-center"> 
            <img class="d-none" src="user_images/<?php echo $userPic; ?>" width="120" />
            
           
          </div>
        </tr>

        <tr>
          <td></td> <td></td>
        </tr>

        <tr>
          <td><label class="control-label"> Name </label></td>
          <td><label class="control-label"><?php echo $name; ?> </label></td>
        </tr>

        <tr>
          <td><label class="control-label"> Details </label></td>
          <td><label class="control-label"><?php echo $exp_details; ?></label></td>
        </tr>



        <tr>
          <td><label class="control-label"> Qty </label></td>
          <td><label class="control-label"><?php echo $ammount; ?></label></td>
        </tr>

        <tr>
          <td><label class="control-label"> Taka </label></td>
          <td><label class="control-label"><?php echo $expense_cost; ?></label></td>
        </tr>

        <tr>
          <td><label class="control-label"> Reference </label></td>
          <td><label class="control-label"><?php echo $reference; ?></label></td> 
        </tr>
		
		



        <tr>
          <td><label class="control-label"> Date </label></td>
          <td><label class="control-label"><?php echo date("d-F-Y", strtotime($entry_date)); ?></label></td> 
        </tr>
	

		
      </table>

      <br><br><br><br><br>
    
      <footer class="text-center mt-5">       
        <div id="company">  
          <div><?php echo $BizAdr ; ?></div>  
          <div>Call: <?php echo $BizPhn ; ?>, Email: <a href="mailto:<?php echo $BizEml ; ?>"><?php echo $BizEml ; ?></a>, Website: <?php echo $BizWeb ; ?></div>
        </div>
      </footer>
    </div>
  </div>
</section>

<?php // require_once 'footer1.php'; ?>
