<?php $pagetitle = "অ্যাডমিট কার্ড"; include 'dbconnect.php'; include…
- User
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
<div class="admit-cards-container">
<?php
$students = [];
while ($student = $students_result->fetch_assoc()) {
$students[] = $student;
}
// Group students into pairs for 2 cards per page
for ($i = 0; $i < count($students); $i += 2):
?>
<div class="admit-card-page">
<!-- First Card -->
<div class="admit-card">
<!-- Header -->
<div class="admit-header text-center">
<h3 class="institution-name"><?php echo htmlspecialchars($institution_info['name']); ?></h3>
<p class="institution-address"><?php echo htmlspecialchars($institution_info['address']); ?></p>
<h4 class="admit-title">প্রবেশপত্র</h4>
</div>
<!-- Student Information -->
<div class="student-info">
<table class="info-table">
<tr>
<td><strong>ছাত্রের নাম:</strong></td>
<td><?php echo htmlspecialchars($students[$i]['name_bn']); ?></td>
</tr>
<tr>
<td><strong>স্টুডেন্ট আইডি:</strong></td>
<td><?php echo htmlspecialchars($students[$i]['student_id']); ?></td>
</tr>
<tr>
<td><strong>শ্রেণি:</strong></td>
<td><?php echo htmlspecialchars($class_name); ?></td>
</tr>
<tr>
<td><strong>পরীক্ষার নাম:</strong></td>
<td><?php echo htmlspecialchars($exam_details['exam_name']); ?></td>
</tr>
<tr>
<td><strong>অভিভাবকের নাম:</strong></td>
<td><?php echo htmlspecialchars($students[$i]['guardian_name_bn']); ?></td>
</tr>
<tr>
<td><strong>মোবাইল নং:</strong></td>
<td><?php echo htmlspecialchars($students[$i]['guardian_phone']); ?></td>
</tr>
<tr>
<td><strong>সেশন:</strong></td>
<td><?php echo htmlspecialchars($exam_details['session_year']); ?></td>
</tr>
<tr>
<td><strong>সিট নং:</strong></td>
<td></td>
</tr>
</table>
</div>
<!-- Signature Section -->
<div class="signature-section">
<div class="row">
<div class="col-4 text-center">
<div class="signature-line"></div>
<p>জামেয়া প্রধানের স্বাক্ষর</p>
</div>
<div class="col-4 text-center">
<div class="signature-line"></div>
<p>শিক্ষা পরিচালকের স্বাক্ষর</p>
</div>
<div class="col-4 text-center">
<div class="signature-line"></div>
<p>প্রধান শিক্ষকের স্বাক্ষর</p>
</div>
</div>
</div>
<!-- Footer Date Only -->
<div class="admit-footer">
<p class="issue-date">জারির তারিখ: 27/06/2025</p>
</div>
</div>
<!-- Second Card (if exists) -->
<?php if (isset($students[$i + 1])): ?>
<div class="admit-card">
<!-- Header -->
<div class="admit-header text-center">
<h3 class="institution-name"><?php echo htmlspecialchars($institution_info['name']); ?></h3>
<p class="institution-address"><?php echo htmlspecialchars($institution_info['address']); ?></p>
<h4 class="admit-title">প্রবেশপত্র</h4>
</div>
<!-- Student Information -->
<div class="student-info">
<table class="info-table">
<tr>
<td><strong>ছাত্রের নাম:</strong></td>
<td><?php echo htmlspecialchars($students[$i + 1]['name_bn']); ?></td>
</tr>
<tr>
<td><strong>স্টুডেন্ট আইডি:</strong></td>
<td><?php echo htmlspecialchars($students[$i + 1]['student_id']); ?></td>
</tr>
<tr>
<td><strong>শ্রেণি:</strong></td>
<td><?php echo htmlspecialchars($class_name); ?></td>
</tr>
<tr>
<td><strong>পরীক্ষার নাম:</strong></td>
<td><?php echo htmlspecialchars($exam_details['exam_name']); ?></td>
</tr>
<tr>
<td><strong>অভিভাবকের নাম:</strong></td>
<td><?php echo htmlspecialchars($students[$i + 1]['guardian_name_bn']); ?></td>
</tr>
<tr>
<td><strong>মোবাইল নং:</strong></td>
<td><?php echo htmlspecialchars($students[$i + 1]['guardian_phone']); ?></td>
</tr>
<tr>
<td><strong>সেশন:</strong></td>
<td><?php echo htmlspecialchars($exam_details['session_year']); ?></td>
</tr>
<tr>
<td><strong>সিট নং:</strong></td>
<td></td>
</tr>
</table>
</div>
<!-- Signature Section -->
<div class="signature-section">
<div class="row">
<div class="col-4 text-center">
<div class="signature-line"></div>
<p>জামেয়া প্রধানের স্বাক্ষর</p>
</div>
<div class="col-4 text-center">
<div class="signature-line"></div>
<p>শিক্ষা পরিচালকের স্বাক্ষর</p>
</div>
<div class="col-4 text-center">
<div class="signature-line"></div>
<p>প্রধান শিক্ষকের স্বাক্ষর</p>
</div>
</div>
</div>
<!-- Footer Date Only -->
<div class="admit-footer">
<p class="issue-date">জারির তারিখ: 27/06/2025</p>
</div>
</div>
<?php endif; ?>
</div>
<?php endfor; ?>
</div>
<div class="alert alert-warning text-center">
এই শ্রেণিতে কোনো সক্রিয় ছাত্র পাওয়া যায়নি।
</div>
When I try to print this admit card, the signature part of the first admit card on the page does not show, but the signature part of the second admit card does. So solve the problem of not showing the signature of the first admit card.
Looking at your code, the issue appears to be with the CSS styling and layout in the print media query. The signature section of the first admit card is likely being cut off or hidden due to height constraints or positioning issues.
Here's the corrected CSS that should fix the problem:
/* Print Styles */
@media print {
.no-print { display: none !important; }
@page {
size: A4 portrait;
margin: 0.5in; /* Increased margin for better spacing */
}
body {
margin: 0;
padding: 0;
background: white;
font-size: 11px;
}
.admit-card-page {
page-break-after: always;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
justify-content: space-between;
min-height: 100vh;
}
.admit-card {
border: 2px solid #000;
padding: 15px;
margin: 10px 0;
height: calc(50vh - 30px); /* Adjusted height calculation */
position: relative;
background: white;
page-break-inside: avoid;
box-sizing: border-box;
display: flex;
flex-direction: column;
overflow: visible; /* Ensure content is not clipped */
}
.admit-header {
flex-shrink: 0;
border-bottom: 2px solid #000;
padding-bottom: 10px;
margin-bottom: 10px;
}
.institution-name {
font-size: 16px;
margin-bottom: 3px;
}
.institution-address {
font-size: 10px;
margin-bottom: 5px;
}
.admit-title {
font-size: 14px;
padding: 5px 15px;
border: 1px solid #000;
}
.student-info {
flex: 1;
margin-bottom: 10px;
overflow: hidden;
}
.info-table td {
padding: 3px 0;
font-size: 10px;
border-bottom: 1px solid #ddd;
}
.signature-section {
flex-shrink: 0;
margin-top: 10px;
margin-bottom: 25px; /* Space for footer */
position: relative;
z-index: 10; /* Ensure it's above other elements */
}
.signature-line {
height: 20px;
border-bottom: 1px solid #000;
width: 90%;
margin: 0 auto 3px;
}
.signature-section p {
font-size: 8px;
margin: 0;
}
.admit-footer {
position: absolute;
bottom: 5px;
right: 10px;
text-align: right;
}
.issue-date {
font-size: 9px;
margin-bottom: 0;
font-weight: bold;
}
}
/* Screen Styles */
.admit-cards-container {
margin: 20px 0;
}
.admit-card-page {
margin-bottom: 30px;
}
.admit-card {
border: 2px solid #006a4e;
border-radius: 10px;
padding: 20px;
background: white;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
min-height: 450px; /* Changed from fixed height to min-height */
position: relative;
margin-bottom: 20px;
display: flex;
flex-direction: column;
}
.admit-header {
border-bottom: 3px solid #006a4e;
padding-bottom: 15px;
margin-bottom: 20px;
}
.institution-name {
color: #006a4e;
font-weight: bold;
margin-bottom: 5px;
font-size: 20px;
}
.institution-address {
color: #666;
margin-bottom: 10px;
font-size: 14px;
}
.admit-title {
color: #f42a41;
font-weight: bold;
border: 2px solid #f42a41;
display: inline-block;
padding: 10px 25px;
border-radius: 5px;
font-size: 18px;
}
.student-info {
flex: 1;
margin-bottom: 20px;
}
.info-table {
width: 100%;
}
.info-table td {
padding: 6px 0;
border-bottom: 1px solid #eee;
font-size: 12px;
}
.info-table td:first-child {
width: 40%;
font-weight: bold;
}
.signature-section {
margin-top: auto;
margin-bottom: 40px; /* Space for footer */
}
.signature-line {
border-bottom: 2px solid #000;
width: 80%;
margin: 0 auto 8px;
height: 30px;
}
.signature-section p {
margin: 0;
font-size: 12px;
font-weight: bold;
}
.admit-footer {
position: absolute;
bottom: 15px;
right: 20px;
text-align: right;
}
.issue-date {
margin-bottom: 0;
font-size: 12px;
font-weight: bold;
}
The key changes made to fix the signature visibility issue:
46vh to calc(50vh - 30px) to provide more consistent spacingoverflow: visible: Ensures content isn't clipped within the admit cardz-index: Ensures signature section appears above other elementsmin-height: Allows cards to expand if neededThese changes should ensure that both admit cards display their signature sections properly when printing.