<?php
	include'connection.php';
	    $userid=$_GET['uid'];
			echo "<table width='100%' border='1' id='t1' cellpadding='5'>";
				echo "<tr>";
					echo "<th>";
						echo "Sl. No.";
					echo "</th>";
					echo "<th>";
						echo "Date | Time";
					echo "</th>";
					echo "<th>";
						echo "Ewallet Id";
					echo "</th>";
					echo "<th>";
						echo "Operator Id";
					echo "</th>";
					echo "<th>";
						echo "Operator Name";
					echo "</th>";
					
					echo "<th>";
						echo "Mobile No.";
					echo "</th>";
					
					echo "<th>";
						echo "Amount";
					echo "</th>";
					
					echo "<th>";
						echo "Status";
					echo "</th>";
					echo "<th>";
						echo "Recharge Id";
					echo "</th>";
					
				echo "</tr>";
				$sl=0;
				$getrechhistq="select * from recharge where Userid='$userid' order by Id desc limit 20";
				$resultgetrechhid=mysqli_query($con,$getrechhistq);
				while($row=mysqli_fetch_array($resultgetrechhid))
				{
					$sl=$sl+1;
					if($row['Status']=="SUCCESS")
					{
						$colorid="green";
					}
					elseif($row['Status']=="FAILED")
					{
						$colorid="red";
					}
					else
					{
					    $colorid="blue";
					}
					echo "<tr>";
						echo "<td>".$sl."</td>";
						echo "<td>".$row['Rechargedate']." | ".$row['Time']."</td>";
						echo "<td>".$row['Ewalletid']." , ".$row['Creditewalletid']."</td>";
						echo "<td>".$row['Operatorid']."</td>";
						echo "<td>".$row['Companyname']."</td>";
						echo "<td>".$row['Mobile']."</td>";
						echo "<td>".$row['Amount']."</td>";
						echo "<td><p id='$colorid'>".$row['Status']."</p></td>";
						echo "<td id='RechIdColor'>".$row['Id']."</td>";
						
					echo "</tr>";
				}
				
			echo "</table>";
		
		?>