Server IP : 2a02:4780:11:1359:0:1d43:a566:2 / Your IP : 216.73.216.31 Web Server : LiteSpeed System : Linux in-mum-web1259.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64 User : u490972518 ( 490972518) PHP Version : 5.6.40 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u490972518/domains/ppschool.org.in/public_html/code/../admin/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php $session=$_POST['session']; $board=$_POST['board']; $class=$_POST['class']; $section=$_POST['section']; $month=$_POST['month']; $all=$_POST['all']; if($month==1) { $a='APR'; $v1=''; } if($month==2) { $a='MAY'; $v1=''; } if($month==3) { $a='JUN'; $v1=''; } if($month==4) { $a='JUL'; $v1=''; } if($month==5) { $a='AUG'; $v1=''; } if($month==6) { $a='SEP'; $v1=''; } if($month==7) { $a='OCT'; $v1=''; } if($month==8) { $a='NOV'; $v1=''; } if($month==9) { $a='DE'; $v1=''; } if($month==10) { $a='JAN'; $v1=''; } if($month==11) { $a='FEB'; } if($month==12) { $a='MAR'; $v1=''; } // $monthNum = 3; ?> <?php // --- Database Connection --- include("../link/databaseconnection.php"); $pdo = new PDO("mysql:host=localhost;dbname=u490972518_ppschool;charset=utf8", "u490972518_ppschool", "Awadhesh25@"); // Example table: students(id, name, class, section, roll, exam, date, photo) // Adjust table/field names to match your DB $stmt = $pdo->query("SELECT * FROM registration where subject='$class' and session='$session' and section='$section' and status='' order by name "); $students = $stmt->fetchAll(PDO::FETCH_ASSOC); function e($str){ return htmlspecialchars($str, ENT_QUOTES, 'UTF-8'); } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>6 Admit Cards Per A4</title> <style> @page { size: A4; margin: 0; } body { font-family: Arial, sans-serif; margin:0; padding:0; } .sheet { width:310mm; height:397mm; padding:10mm; box-sizing:border-box; } table.cards { width:100%; height:100%; border-collapse:separate; border-spacing:8mm; } td.card { width: 33%; border:1px solid #000; border-radius:6px; padding:6mm; vertical-align: top; page-break-inside: avoid; } .header { display:flex; align-items:center; gap:8px; margin-bottom:6px; } .logo { width:48px;height:48px;background:#eee;display:flex;align-items:center;justify-content:center;font-size:10px; } .school-name { font-weight:bold; font-size:12pt; } .school-sub { font-size:12pt; color:#444; } .details { display:flex; gap:8px; } .photo { width:60px; height:72px; border:1px solid #999; background:#fafafa; text-align:center; font-size:12pt; color:#666; } .photo img { width:100%; height:100%; object-fit:cover; } .info { font-size:12pt; } .row { margin-bottom:4px; } .label { display:inline-block; width:90px; color:#444; font-size:12pt; } .value { font-weight:600; } .footer { font-size:12pt; margin-top:6px; display:flex; justify-content:space-between; } @media print { .sheet { padding:6mm; } } </style> </head> <body> <?php $total = count($students); $s1=1; for ($i=0; $i < $total; $i+=6) { echo "<div class='sheet'><table class='cards'><tr>"; for ($j=$i; $j<$i+6 && $j<$total; $j++) { $s = $students[$j]; $app=$s['application']; // $app=$s['application']; $application=$s['application']; $code=$s['code']; $subject=$s['subject']; $class=$s['subject']; $sel="select * from studentfees where year='$session' and search='$app' and status='' order by id asc "; $res=mysqli_query($conn,$sel); /////for fees paid $am=0; $co=0; $van1=0; $mon=''; $paid=0; while($row1=mysqli_fetch_array($res,MYSQLI_BOTH)) { $paid=$row1['paid']; $con=$row1['con']; $am=$am+$paid; $co=$co+$con; $van1=$van1+$row1['van']; $m=$row1['month']; $mon=$mon.','.$m; } /////for fees paid $totalpay=$totalpay+$am; ////for class fees $sel2="select * from fees where session='$session' and class='$class' "; $res2=mysqli_query($conn,$sel2); /////for fees paid $row2=mysqli_fetch_array($res2,MYSQLI_BOTH); $comp_fee=$row2['comp']; $fees=$row2['fees']; $sel23="select * from free where session='$session' and sch='$app' "; $res23=mysqli_query($conn,$sel23); /////for fees paid $row23=mysqli_fetch_array($res23,MYSQLI_BOTH); $fix=$row23['fix']; $fee_free=$row23['fee']; $conv_free=$row23['conv']; if($fix>0) { $f_fix=$fix; } else { $f_fix=0; } if($fee_free=='YES') { $fee_free=$fees; } else { $fee_free=0;; } if($conv_free=='YES') { $conv_free=$code; } else { $conv_free=0;; } if($session=='2020-2021') { $cal=12; } else { $cal=$month; } $sel211f133="select * from studentfees where year='$session' and search='$app' and status='' order by id asc"; $res211f133=mysqli_query($conn,$sel211f133); $ot=0; $ad=0; $rg=0; $rg1=0; $cp=0; $gn=0; $ann1=0; $exam1=0; $van12=0; $fee1=0; $tpaid=0; while($row211f133=mysqli_fetch_array($res211f133,MYSQLI_BOTH)) { $tpaid=$row211f133['paid']+$tpaid; } //echo $cal; //////////// ///////// //////// $fees=$row2['fees']; ///// /// $application=$app; //echo $conc; $apr=''; $c=''; $a1=''; $selca="select * from studentfees where month like '%April%' and year='$session' and search='$application' and status='' order by id asc "; $resca=mysqli_query($conn,$selca); if($rowca=mysqli_fetch_array($resca,MYSQLI_BOTH)) { $apr=1; $c++; $a1='APR'; $m1='April'; } //////may $may=''; $a2=''; $selcm="select * from studentfees where month like '%May%' and year='$session' and search='$application' and status='' order by id asc "; $rescm=mysqli_query($conn,$selcm); if($rowcm=mysqli_fetch_array($rescm,MYSQLI_BOTH)) { //echo "SHOW2"; $may=2; $c++; $a2='MAY'; } //////Jun $jun=''; $a3=''; $selcj="select * from studentfees where month like '%Jun%' and year='$session' and search='$application' and status='' order by id asc "; $rescj=mysqli_query($conn,$selcj); if($rowcj=mysqli_fetch_array($rescj,MYSQLI_BOTH)) { //echo "SHOW3"; $jun=3; $c++; $a3='JUN'; } //////july $jul=''; $a4=''; $selcmj="select * from studentfees where month like '%July%' and year='$session' and search='$application' and status='' order by id asc "; $rescmj=mysqli_query($conn,$selcmj); if($rowcmj=mysqli_fetch_array($rescmj,MYSQLI_BOTH)) { //echo "SHOW4"; $jul=4; $c++; $a4='JUL'; } //////August $aug=''; $a5=''; $selcmja="select * from studentfees where month like '%August%' and year='$session' and search='$application' and status='' order by id asc "; $rescmja=mysqli_query($conn,$selcmja); if($rowcmja=mysqli_fetch_array($rescmja,MYSQLI_BOTH)) { //echo "SHOW5"; $aug=5; $c++; $a5='AUG'; } //////sep $sep=''; $a6=''; $selcms="select * from studentfees where month like '%September%' and year='$session' and search='$application' and status='' order by id asc "; $rescms=mysqli_query($conn,$selcms); if($rowcms=mysqli_fetch_array($rescms,MYSQLI_BOTH)) { //echo "SHOW6"; $sep=6; $c++; $a6='SEP'; } //////oct $oct=''; $a7=''; $selcmjo="select * from studentfees where month like '%October%' and year='$session' and search='$application' and status='' order by id asc "; $rescmjo=mysqli_query($conn,$selcmjo); if($rowcmjo=mysqli_fetch_array($rescmjo,MYSQLI_BOTH)) { //echo "SHOW7"; $oct=7; $c++; $a7='OCT'; } //////Nov $nov=''; $a8=''; $selcmjn="select * from studentfees where month like '%November%' and year='$session' and search='$application' and status='' order by id asc "; $rescmjn=mysqli_query($conn,$selcmjn); if($rowcmjn=mysqli_fetch_array($rescmjn,MYSQLI_BOTH)) { //echo "SHOW7"; $nov=8; $c++; $a8='NOV'; } //////Dec $dec=''; $a9=''; $selcmjd="select * from studentfees where month like '%December%' and year='$session' and search='$application' and status=''order by id asc "; $rescmjd=mysqli_query($conn,$selcmjd); if($rowcmjd=mysqli_fetch_array($rescmjd,MYSQLI_BOTH)) { //echo "SHOW7"; $dec=9; $c++; $a9='DEC'; } //////Jan $jan=''; $a10=''; $selcmjdj="select * from studentfees where month like '%January%' and year='$session' and search='$application' and status='' order by id asc "; $rescmjdj=mysqli_query($conn,$selcmjdj); if($rowcmjdj=mysqli_fetch_array($rescmjdj,MYSQLI_BOTH)) { //echo "SHOW7"; $jan=10; $c++; $a10='JAN'; } //////Jan $feb=''; $a11=''; $selcmf="select * from studentfees where month like '%February%' and year='$session' and search='$application' and status=''order by id asc "; $rescmf=mysqli_query($conn,$selcmf); if($rowcmf=mysqli_fetch_array($rescmf,MYSQLI_BOTH)) { //echo "SHOW7"; $feb=11; $c++; $a11='FEB'; } //////mar $mar=''; $a12=''; $selcmm="select * from studentfees where month like '%March%' and year='$session' and search='$application' and status='' order by id asc "; $rescmm=mysqli_query($conn,$selcmm); if($rowcmm=mysqli_fetch_array($rescmm,MYSQLI_BOTH)) { //echo "SHOW7"; $mar=12; $a12='MAR'; $c++; $ex1=0; } $g=max(0,$apr,$may,$jun,$jul,$aug,$sep,$oct,$nov,$dec,$jan,$feb,$mar); $new_g=$cal-$g; $t=$fees*$new_g; $re_fee=$fees*$new_g; $t=0; foreach ($at as $x) { if($x=='') { $t++; } } $sel4="select * from studentfees where year='$session' and search='$app' and status='' order by id desc "; $res4=mysqli_query($conn,$sel4); $row4=mysqli_fetch_array($res4,MYSQLI_BOTH); $remain=$row4['remain']; $van_fee=$code*$new_g; $comp_fee_c=$comp_fee*$new_g; $f_fix=$f_fix*$new_g; $fee_free1=$fee_free*$new_g; $conv_free1=$conv_free*$new_g; $comp_fee_c1=$comp_fee_c1+$comp_fee_c; $re_fee_van=$re_fee+$van_fee+$remain+$comp_fee_c-$f_fix-$fee_free1-$conv_free1; $remain1=$remain+$remain1; $tpaid1=$tpaid1+$tpaid; $free=$f_fix+$fee_free1+$conv_free1; $free1=$free1+$free; $mon=$a1.','.$a2.','.$a3.','.$a4.','.$a5.','.$a6.','.$a7.','.$a8.','.$a9.','.$a10.','.$a11.','.$a12; if($re_fee_van>0) { $re_fee_van=$re_fee_van; } else { $re_fee_van=0; } ////////// /////////// $t=$re_fee+$van_fee; if($re_fee>0) { $re_fee=$re_fee; } else { $re_fee=0; } if($van_fee>0) { $van_fee=$van_fee; } else { $van_fee=0; } $free=$f_fix+$fee_free1+$conv_free1; $t1=$van_fee+$re_fee; $t12=$t1+$remain-$free; if($t12>0) { $t12=$t12; } else { $t12=0; } $re_fee1=$re_fee+$re_fee1; $van_fee1=$van_fee1+$van_fee; if($g>$month) { $re_fee_van=0; $comp_fee_c=0; } else { $re_fee_van=$re_fee_van; $comp_fee_c=$comp_fee_c; } $total1=$re_fee_van+$total1; // open new row after every 3 cards if ($j > $i && $j % 2 == 0) { echo "</tr><tr>"; } echo "<td class='card'>"; echo "<div class='header' style='margin-left:50px'> <div class='logo'><img src='../images/logo.png' style='height:70px;width:70px'></div> <div> <div class='school-name' style='font-size:25px'>PACIFIC PUBLIC SCHOOL</div> <div class='school-sub'> CHARGAWAN- GORAKHPUR <br/><span style='margin-left:40px'>Website : ppschool.org.in<br/></span><span style='margin-left:90px'> <u>Admit Card</u></span></div> </div> </div>"; echo '----------------------------------------------------------------------------------'; echo '<br/>'; echo '<br/>'; echo "<div class='details'>"; echo "<div class='photo'><img src='../code/img/".e($s['picture'])."'></div>"; echo "<div class='info'>"; echo "<div class='row'><span class='label'>Roll No.:</span><span class='value'>".e($s1)."</span> <span class='label' style='margin-left:50px'>Sch No.:</span><span class='value'>".e($app)."</span></div>"; echo "<div class='row'><span class='label'>Name:</span><span class='value'>".e($s['name'])."</span></div>"; echo "<div class='row'><span class='label'>DOB:</span><span class='value'>".e($s['dob'])."</span></div>"; echo "<div class='row'><span class='label'>Father's Name:</span><span class='value'>".e($s['fname'])."</span></div>"; echo "<div class='row'><span class='label'>Mother's Name:</span><span class='value'>".e($s['mname'])."</span></div>"; echo '<br/>'; echo "<div class='row'><span class='label'>Class/Sec:</span><span class='value'>".e($s['subject'])." / ".e($s['section'])."</span></div>"; echo '<br/>'; echo "<div class='row'><span class='label'>Add:</span><span class='value' style='font-size:14px'>".e($s['village'])."</span></div>"; echo "</div></div>"; // info + details echo '<br/>'; echo '<br/>'; echo "<div class='footer'><div>Dues: $re_fee_van ; Rs.</div><div>Principal Sign</div></div>"; echo "</td>"; $s1++; } echo "</tr></table></div>"; } ?> </body> </html>