<?php include("auth.php");

  include "conn.php";
  $uid =base64_decode($_GET['uid']);
  $query = "select * from tbl_card_details where uid='$uid' and deleted_at is NULL";
  $smt1 = mysqli_query($conn, $query);
  $result = mysqli_fetch_assoc($smt1);  


?>


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

<head>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">

  <title>User Details</title>
  <meta content="" name="description">
  <meta content="" name="keywords">
  <?php include("templates/inc.php"); ?>

  <style>
      .bg-image-card {
  background-image: url('assets/img/cardbg.jpg'); /* 🔁 Replace with your actual image */
  background-size: cover; /* or 'contain' if you want full image visible */
  background-position: center;
  background-repeat: no-repeat;
  height: auto;
 /*aspect-ratio: 5 / 3; */
  color: white;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}
@media print {
  #printarea {
    /*display: flex;*/
    justify-content: center;
  width: 100%;
  }
}

  .btn-success.custom-hover:hover {
    background-color: #fff;
    color: #198754;
    border: 1px solid #198754;
  }

  .btn-primary.custom-hover:hover {
    background-color: #fff;
    color: #0d6efd;
    border: 1px solid #0d6efd;
  }

  .btn.custom-hover {
    transition: all 0.3s ease;
  }
</style>
<script>
    $(document).ready(function () {


  $("#formeditcard").submit(function (e) {
    e.preventDefault(); // prevent actual form submit
    var form = $(this);
    var url = form.attr("action"); //get submit url [replace url here if desired]

    // $("#btnAdd").val("...");
    $("#btnedit").prop("disabled", true);
    setTimeout(function () {
  $("#btnedit").prop("disabled", false);
}, 2000);

     
     $.ajax({
      type: "POST",
      url: url,
      data: form.serialize(), // serializes form input
      success: function (data) {
        //   alert(data);
          location.reload();
        }
    });

   });



});
</script>
</head>

<body>

  <!-- ======= Header ======= -->
  <?php
  include("templates/header.php");
  ?>

  <!-- End Header -->

  <!-- ======= Sidebar ======= -->

  <?php
  include("templates/sidebar.php");

  ?>


  <!-- End Sidebar-->

  <main id="main" class="main">

    <div class="pagetitle">
      <h1>User Profile</h1>
      <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item"><a href="index.html">Home</a></li>
          <li class="breadcrumb-item">User Profile</li>
        </ol>
      </nav>
    </div><!-- End Page Title -->
  <a href="create-user-list.php">
      <button class="btn btn-primary"><i class="bi bi-arrow-left"></i> Back</button>
  </a>
    <section class="section mt-2">
 <div class="card">
           <div class="card-body"><br>
     
     
   </div>
</div>

      
    </section>
  </main><!-- End #main -->
  <!-- ======= Footer ======= -->
  <?php
  include("templates/footer.php");
  ?>

  <!-- End Footer -->


  <?php include("templates/vendors.php"); ?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js"></script>
<script>
  document.querySelector('.btn-success').addEventListener('click', () => {
    const element = document.getElementById('printarea');

    const opt = {
      margin:       0.5,
      filename:     'card-details.pdf',
      image:        { type: 'jpeg', quality: 0.98 },
      html2canvas:  { scale: 2, useCORS: true },
      jsPDF:        { unit: 'in', format: 'letter', orientation: 'landscape' }
    };

    html2pdf().set(opt).from(element).save();
  });
</script>

</body>
</html>