<?php 
session_start();
require('../db.php'); 
include('../inc/func.php');
include('../inc/logo.php');
?> 


    <?php 
 $GetHistory = "SELECT * FROM mypin WHERE email='$user' and ref='$_GET[ref]' ";
$qryHistory = $conn->query($GetHistory);
          ?>




  <table width="100%">
    <tr>
    <td>
    <form id="form1" name="form1" method="post" action="voucher.php">
    <table class="mystyle" cellpadding="5" width="100%">
   <?php
	$no = 0;
	$siteurl = $_SERVER['SERVER_NAME'];

	while($ticket_row = $qryHistory->fetch_assoc()){ 

		if($no == 0)
		{
		?>
        <tr>
        <?php
		}
		?>
        <td style="border:2px dotted"><?php 

if(strtolower($ticket_row['net'])=='mtn') { 
$sn = $ticket_row['serial'];
$pin = $ticket_row['pins'];
$name = "PIN";
echo "<small style='font-size:15px'><table><tr><td><img src='../assets/images/mtn.jpg' height='40' width='40' /> </td><td> www.$siteurl <br/> MTN N".$ticket_row['amount']."  </td></tr></table></small>"; }

elseif(strtolower($ticket_row['net'])=='airtel') { 
$sn = $ticket_row['serial'];
$pin = $ticket_row['pins'];
$name = "PIN";
echo "<small style='font-size:15px'><table><tr><td><img src='../assets/images/airtel.jpg' height='40' width='40' /> </td><td> www.$siteurl<br/> AIRTEL N".$ticket_row['amount']."  </td></tr></table></small>"; }

elseif(strtolower($ticket_row['net'])=='glo') {
$sn = $ticket_row['serial'];
$pin = $ticket_row['pins'];
$name = "PIN";
echo "<small style='font-size:15px'><table><tr><td><img src='../assets/images/glo.jpg' height='40' width='40' /> </td><td> www.$siteurl<br/> GLO N".$ticket_row['amount']."  </td></tr></table></small>"; }

elseif(strtolower($ticket_row['net'])=='9mobile') {
$sn = $ticket_row['serial'];
$pin = $ticket_row['pins'];
$name = "PIN";
echo "<small style='font-size:15px'><table><tr><td> <img src='../assets/images/9mobile.jpg' height='40' width='40' /> </td><td> www.$siteurl<br/> 9MOBILE N".$ticket_row['amount']." </td></tr></table></small>"; }

elseif(strtolower($ticket_row['net'])=='waec') {
$sn = $ticket_row['serial'];
$pin = $ticket_row['pins'];
$name = "PIN";
 echo "<small style='font-size:15px'><table><tr><td><img src='../assets/images/waec.jpg' height='40' width='40' /> </td><td> www.$siteurl <br/>  WAEC Result Checking Pin  </td></tr></table></small>"; }

elseif(strtolower($ticket_row['net']) =='neco') {
$sn = $ticket_row['serial'];
$pin = $ticket_row['pins'];
$name = "TOKEN";
echo "<small style='font-size:15px'><table><tr><td><img src='../assets/images/neco.jpg' height='40' width='40' /> </td><td> www.$siteurl <br/>NECO Result Checking TOKEN  </td></tr></table></small>"; 
    
    
}else{
$sn = $ticket_row['serial'];
$pin = $ticket_row['pins'];
$name = "PIN";
$service = strtoupper($ticket_row['net']);
echo "<small style='font-size:15px'><table><tr><td> </td><td> www.$siteurl <br/> $service PIN</td></tr></table></small>"; 
    
}

 ?>

 <?php
echo "<small style='font-size:15px'><table cellpadding='2'><tr><td>$name:</td><td><b>".$pin."</b></td></tr>
<tr><td>Serial:</td><td>".$sn."</td><td>".$ticket_row['date']."</td></tr>
</table></small>";

$no = $no + $nou;
?>
</td>
        <?php
		if($no ==$yes)
		{
		?>
        </tr>
        <?php
		$no =$yee;
		}
	}
    ?>
      </table>
      </form>
      </td>
    </tr>
    </table>
</body>
  </div>
  </div>
      </div>
  </div>