📁 File Manager
🏠 /
/
home
/
u857492117
/
domains
/
mangaldaicollege.org
/
public_html
/
alumniPortal
Dosya Düzenle: id_card.php
<?php session_start(); if (!isset($_SESSION['user_id'])) { header("Location: login.php"); exit(); } require_once("db.php"); $user_id = $_SESSION['user_id']; /*------------------------------- Check Payment Status --------------------------------*/ $payment = mysqli_query($con," SELECT payment_status FROM alumni_payments WHERE user_id='$user_id' ORDER BY id DESC LIMIT 1 "); if(mysqli_num_rows($payment)==0){ $status="Pending"; }else{ $row=mysqli_fetch_assoc($payment); $status=$row['payment_status']; } /*------------------------------- Payment Not Approved --------------------------------*/ if($status!="Approved"){ ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Payment Verification</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"> <style> body{ background:#eef2f7; font-family:'Poppins',sans-serif; } .verify-box{ max-width:700px; margin:80px auto; background:#fff; padding:45px; border-radius:18px; text-align:center; box-shadow:0 10px 30px rgba(0,0,0,.12); } .verify-box h2{ color:#d97706; font-weight:700; } .verify-box p{ font-size:16px; color:#555; margin-top:15px; } </style> </head> <body> <div class="verify-box"> <h2>⏳ Payment Under Verification</h2> <hr> <p> Your payment has been submitted successfully. </p> <p> The Alumni Association Administrator is verifying your payment. </p> <p> After approval, your Digital Alumni ID Card will be available for download. </p> <br> <a href="dashboard.php" class="btn btn-primary btn-lg"> Back to Dashboard </a> </div> </body> </html> <?php exit(); } /*------------------------------- Fetch Alumni Details --------------------------------*/ $sql=mysqli_query($con," SELECT u.full_name, u.email, u.phone, p.photo, p.membership_no, p.course, p.admission_year, p.gender FROM alumni_users u LEFT JOIN alumni_profiles p ON u.id=p.user_id WHERE u.id='$user_id' LIMIT 1 "); $data=mysqli_fetch_assoc($sql); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Official Alumni ID Card</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Roboto+Mono:wght@500&display=swap" rel="stylesheet"> <!-- html2canvas for JPG Download --> <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script> <style>/* ============================ GENERAL ============================= */ *{ margin:0; padding:0; box-sizing:border-box; } body{ background:#dfe7ef; font-family:'Poppins',sans-serif; } .card-area{ max-width:900px; margin:40px auto; text-align:center; } /* ============================ PVC CARD ============================= */ .id-card{ width:340px; height:540px; margin:auto; background:#ffffff; border-radius:18px; overflow:hidden; position:relative; box-shadow:0 12px 30px rgba(0,0,0,.20); } /* ============================ HEADER ============================= */ .header{ height:90px; background:linear-gradient(135deg,#003c8f,#0b5ed7); color:#fff; display:flex; align-items:center; padding:15px; } .logo{ width:55px; height:55px; background:#fff; border-radius:50%; padding:4px; object-fit:contain; margin-right:12px; } .header-text{ flex:1; } .header-text h3{ margin:0; font-size:16px; font-weight:700; } .header-text h5{ margin-top:3px; font-size:11px; letter-spacing:1px; font-weight:500; text-transform:uppercase; opacity:.9; } /* ============================ YELLOW RIBBON ============================= */ .ribbon{ background:#FFC107; color:#000; font-size:11px; font-weight:700; text-align:center; padding:6px; letter-spacing:1px; } /* ============================ PHOTO ============================= */ .photo-wrap{ text-align:center; margin-top:18px; } .photo{ width:105px; height:105px; border-radius:50%; object-fit:cover; border:4px solid #fff; outline:3px solid #0B5ED7; box-shadow:0 5px 12px rgba(0,0,0,.18); } /* ============================ NAME ============================= */ .name{ text-align:center; margin-top:12px; color:#003c8f; font-size:19px; font-weight:700; } .member-tag{ text-align:center; color:#666; font-size:12px; margin-bottom:15px; } /* ============================ DETAILS ============================= */ .info{ padding:0 22px; } .info-table{ width:100%; border-collapse:collapse; } .info-table tr{ border-bottom:1px dashed #d8d8d8; } .info-table tr:last-child{ border:none; } .info-table td{ padding:8px 4px; } .label{ width:38%; color:#666; font-size:10px; text-transform:uppercase; font-weight:700; letter-spacing:.6px; } .value{ font-family:'Roboto Mono',monospace; font-size:12px; color:#111; } /* ============================ FOOTER ============================= */ .footer-strip{ position:absolute; bottom:0; width:100%; background:#003c8f; color:#fff; text-align:center; padding:12px; font-size:11px; line-height:18px; } .footer-strip b{ font-size:13px; } /* ============================ BUTTONS ============================= */ .print-btn{ margin-top:25px; } .print-btn .btn{ margin:5px; } /* ============================ WATERMARK ============================= */ .id-card::before{ content:""; position:absolute; width:250px; height:250px; background:url("assets/3d png.png") center center no-repeat; background-size:contain; opacity:.04; left:45px; top:145px; pointer-events:none; } /* ============================ RESPONSIVE ============================= */ @media(max-width:480px){ .id-card{ width:320px; height:525px; } } /* ============================ PRINT ============================= */ @media print{ body{ background:#fff; } .print-btn{ display:none; } .id-card{ box-shadow:none; } }</style> </head> <body> <div class="card-area"> <!-- Alumni ID Card --> <div class="id-card" id="idCard"> <!-- Header --> <div class="header"> <img src="assets/3d png.png" class="logo"> <div class="header-text"> <h3>Mangaldai College (Autonomous)</h3> <h5>Official Alumni ID Card</h5> </div> </div> <!-- Ribbon --> <div class="ribbon"> ALUMNI ASSOCIATION MEMBER </div> <!-- Photo --> <div class="photo-wrap"> <?php if(!empty($data['photo'])){ ?> <img src="<?php echo htmlspecialchars($data['photo']); ?>" class="photo"> <?php }else{ ?> <img src="assets/default-user.png" class="photo"> <?php } ?> </div> <!-- Name --> <h3 class="name"> <?php echo strtoupper(htmlspecialchars($data['full_name'])); ?> </h3> <p class="member-tag"> Membership No : <strong> <?php echo htmlspecialchars($data['membership_no']); ?> </strong> </p> <!-- Details --> <div class="info"> <table class="info-table"> <tr> <td class="label">Course</td> <td class="value"> <?php echo htmlspecialchars($data['course']); ?> </td> </tr> <tr> <td class="label">Admission Year</td> <td class="value"> <?php echo htmlspecialchars($data['admission_year']); ?> </td> </tr> <tr> <td class="label">Gender</td> <td class="value"> <?php echo htmlspecialchars($data['gender']); ?> </td> </tr> <tr> <td class="label">Email</td> <td class="value" style="font-size:10px;"> <?php echo htmlspecialchars($data['email']); ?> </td> </tr> <tr> <td class="label">Phone</td> <td class="value"> <?php echo htmlspecialchars($data['phone']); ?> </td> </tr> </table> </div> <!-- Footer --> <div class="footer-strip"> <b>Authorized by</b> <br> Mangaldai College (Autonomous) <br> Alumni Association </div> </div> <!-- Buttons --> <div class="print-btn"> <button class="btn btn-success btn-lg" onclick="downloadJPG();"> 📥 Download JPG </button> <a href="dashboard.php" class="btn btn-secondary btn-lg"> Back </a> </div> </div><script> /* ========================================== Download Alumni ID Card as High Quality JPG ========================================== */ function downloadJPG(){ const card = document.getElementById("idCard"); // Hide buttons while capturing const btnArea = document.querySelector(".print-btn"); btnArea.style.display = "none"; html2canvas(card,{ scale:4, // HD Quality useCORS:true, allowTaint:false, backgroundColor:"#ffffff", logging:false }).then(function(canvas){ // Show buttons again btnArea.style.display = "block"; // Convert Canvas to JPG let image = canvas.toDataURL("image/jpeg",1.0); // Create Download Link let link = document.createElement("a"); link.href = image; link.download = "Alumni_ID_<?php echo $data['membership_no']; ?>.jpg"; document.body.appendChild(link); link.click(); document.body.removeChild(link); }).catch(function(){ btnArea.style.display = "block"; alert("Unable to generate JPG."); }); } </script> </body> </html>
💾 Kaydet
İptal