<?php
session_start();
$id=$_REQUEST['flag'];
$session=$_REQUEST['flag1'];

include("link/databaseconnection.php");
$sel="select * from  registration2 where   id='$id' order by id desc";
$res=mysqli_query($conn,$sel);
$row=mysqli_fetch_array($res,MYSQLI_BOTH);
$app1=$row['mobile'];
$session=$row['session'];
$sel124="select * from  pratiyogita where form_no ='$id' and session='$session' ";
$res124=mysqli_query($conn,$sel124);
$row124=mysqli_fetch_array($res124,MYSQLI_BOTH);


	$f = "visit.php";
if(!file_exists($f)){
	touch($f);
	$handle =  fopen($f, "w" ) ;
	fwrite($handle,0) ;
	fclose ($handle);
}
 
include('admin/libs/phpqrcode/qrlib.php'); 

if($row124)
{
?>

<html>
<head>
     <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link href="https://fonts.googleapis.com/css?family=Mukta&display=swap" 

    rel="stylesheet">
 <script src="js/jquery-3.2.1.min.js"></script>  <!--jquery-->
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
 <style>
 #name2{font-weight:bold}
 @media print {
 #name2{font-weight:bold;font-size:12px}
 #name3{font-size:12px
     
     text-transform: uppercase;
 }
 th, td {
  padding-top: 10px;
 
}

  body{
  -webkit-print-color-adjust:exact;
}
  p{font-size:11px}
  td{font-size:12px}
 }
 #gh{transform-origin: 0 0;
  transform: rotate(-45deg);;
    position: absolute;
    top: 580;
  left: 100;
  font-size:50px;
  color:GREEN;
    
    
}
#n {
  position: absolute;
  left: 25%;
  top: 30%;
  z-index: -1;
}
 </style>
<script>
$(document).ready(function(){
	$("#pay").click(function(){
		window.location.href='bil.php';
	});
});
$(document).ready(function(){

	$("#print").click(function(){
		$("#pay").css("visibility","hidden");
		$("#back").css("visibility","hidden");
		$("#print").css("visibility","hidden");
		window.print();
		
	});
	$("#back").click(function(){
		window.location.href='index.php';
	});
});

</script>
<link href="css/student_print.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
     <div id='n'><img src='images/t1.png' style='opacity: 0.4;height:400px;width:400px;'></div>
<h3 id='gh'>ANNUAL SPORTS </h3>
<table frame="border" width="100%" >
<caption style="font-size:25px;font-weight:bold">ANNUAL SPORTS <i class="fa fa-trophy"></i><?php echo $row['session'];?></caption>
<tr>
<td colspan='2' style='background-color:black;color:white'><span><img src="images/name.png" height="95px" width="100%"/></span></td>
</tr>
</table>
<table cellspacing="0" width="100%" border="1px" style='font-size:12px'>

<tr>
<td ><span id="name2">Form No.</span></td><td ><span id="name3" style='font-weight:bold'><?php echo $row124['id'];?></span></td><td><span id="name2">Course</span></td><td ><span id="name2"><?php echo $row['class'];?></span></td>
</tr>
<tr style=''>
<td width="20%"><span id="name2">Student's Name</span></td><td width="" style='text-transform: uppercase;'><span id="name3"><?php echo $row['name'];?></span></td><td width="20%"><span id="name2">Father's Name</span></td><td width="" style='text-transform: uppercase;'><span id="name3"><?php echo $row['fname'];?></span></td>
</tr>
<tr>
<td width="20%"><span id="name2"> Mother's Name</span></td><td style='text-transform: uppercase;'><span id="name3"><?php echo $row['mname'];?></span></td><td width="20%"><span id="name2"> DOB</span></td><td style='text-transform: uppercase;'><span id="name3"><?php echo $row['dob'];?></span></td>
</tr>


<tr>
<td width="30%"><span id="name2">Gender</span></td><td width="30%" style='text-transform: uppercase;'><span id="name3"><?php echo $row['gender'];?></span></td><td width="20%"> <span id="name2">Category</span></td><td width="30%" style='text-transform: uppercase;'><span id="name3"><?php echo $row['category'];?></span></td>
</tr>
<tr>
<td width="30%"><span id="name2">Aadhaar Number</span></td><td width="30%"><span id="name3"><?php echo $row['adhar'];?></span></td><td width="20%"><span id="name2">Caste</span></td><td width="20%" style='text-transform: uppercase;'><span id="name3"><?php echo $row['sub_category'];?></span></td>
</tr>
<tr>
<td width="30%"><span id="name2">Email Id</span></td><td width="30%"><span id="name3"><?php echo $row['email'];?></span></td><td width="20%"><span id="name2"> Reg Date</span></td><td width="20%"><span id="name3"><?php echo date("d/m/Y", strtotime($row124['date'])); ?></span></td>
</tr>
</table>




<table  cellspacing="0" width="100%" border="1px">
<tr>
<td align="center" style='background-color:black;color:white'><span id="name2">Student Address</span></td><td align="center" style='background-color:black;color:white'><span id="name2"></span></td><td align="center" style='background-color:black;color:white'><span id="name2">Photo & Signature
</span></td>
</tr>
<tr align="left" style='font-size:12px'>
<td><span id="name3"><?php echo $row['village'];?></br><?php echo $row['postoffice'];?> </br><?php echo $row['dist'];?></br><?php echo $row['state'];?></br><?php echo $row['mobile'];?></br><?php echo $row['pincode'];?></span></td>
<td align="center" style='font-weight:bold;font-size:12px'><img src="admin/temp/<?php echo $filename.'.png';?>" style='height:80px;width:80px' id='qr'><br/><?php echo $row['alot_number']?></td>
<td  align="center"><img src="code/img/<?php echo $row['picture'];?>" height="80px" ></br><img src="code/img/<?php echo $row['signature'];?>" height="30px" ></td>
</tr>
</table>



<table cellspacing="0" width="100%" border="1px">
<tr>
<th  >#</th>
<th >खेल का नाम</th>
<th >खेल की तिथि </th>
<th >स्थान </th>

</tr>
<?php
$sr=1;
$sel124="select * from  pratiyogita where form_no ='$id' and session='$session' ";
$res124=mysqli_query($conn,$sel124);
while($row124=mysqli_fetch_array($res124,MYSQLI_BOTH))
{
    $game=$row124['game'];
    $sel1241="select * from  game where id ='$game'";
$res1241=mysqli_query($conn,$sel1241);
$row1241=mysqli_fetch_array($res1241,MYSQLI_BOTH)

?>
<tr>
<td ><?php echo $sr++?></td>
<td><?php echo $row1241['game']?></td>
<td><?php echo $row1241['date']?></td>
<td></td>


</tr>
<?php }?>

</table>

	   <h2>Note-</h2><br/>
	<ol>
	    <li>प्रतिभागी अधिक्तम 5 प्रतियोगिता में भाग ले सकता हैं। </li>
	    <li>प्रतिभाग के समय परिचय पत्र एवं आधार कार्ड लाना अनिवार्य है। </li>
	    <li>किसी प्रतियोगिता में 5 प्रतिभागी से कम रहने पर प्रतियोगिता निरस्त कर दी जाएगी। </li>
	    
	    </ol>
<table   style="border:none; border-collapse:collapse; cellspacing:0; cellpadding:0;margin-top:35px" width="100%">

	</table><br/><br/>
<button id="print" style="margin-left:500px;" >Click For Print</button>&emsp;
<a href='login_pratiyogita.php'><button  >Back</button></a>
</body>
</html>
<?php
}
else
{
    echo "<script>alert('Please Contact College');window.location.href='adm_process.php;</script>";
}
?>