File size: 1,834 Bytes
0aff64c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
if (!isset($_GET['id'])) {
    echo "Invalid request.";
    exit();
}

$conn = new mysqli("localhost", "root", "", "stc_db");
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);

$id = intval($_GET['id']);
$result = $conn->query("SELECT * FROM applications WHERE id = $id AND status = 'Approved'");

if ($result->num_rows !== 1) {
    echo "Application not found or not approved yet.";
    exit();
}

$data = $result->fetch_assoc();
?>

<!DOCTYPE html>
<html>
<head>
  <title>ID Card</title>
  <style>
    body { font-family: Arial, sans-serif; }
    .id-card {
      width: 340px; height: 210px;
      border: 2px solid #004e56; border-radius: 12px;
      padding: 15px; background: #f4f4f4;
      box-shadow: 0 0 10px rgba(0,0,0,0.2);
    }
    .id-card h2 { color: #004e56; font-size: 16px; text-align: center; }
    .id-card img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto; }
    .id-details { text-align: center; margin-top: 10px; font-size: 14px; }
    .print-btn {
      margin-top: 20px; display: block;
      padding: 10px 20px; background: #004e56; color: white;
      text-align: center; text-decoration: none;
      border-radius: 5px;
    }
  </style>
</head>
<body>

<div class="id-card">
  <h2>Shelleng Team for Change (STC)</h2>
  <img src="uploads/<?= htmlspecialchars($data['passport']) ?>" alt="Passport">
  <div class="id-details">
    <strong><?= htmlspecialchars($data['fullname']) ?></strong><br>
    <?= htmlspecialchars($data['gender']) ?> | <?= htmlspecialchars($data['dob']) ?><br>
    <?= htmlspecialchars($data['state']) ?>, <?= htmlspecialchars($data['lga']) ?><br>
    Phone: <?= htmlspecialchars($data['phone']) ?>
  </div>
</div>

<a href="#" class="print-btn" onclick="window.print()">Print ID</a>

</body>
</html>