<?PHP
	include'session.php';
	include'../connection.php';
	include'../functions.php';
	
	
?>
<html>
<head>
	<title>Add Money</title>
	<!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    
	<link rel="icon" href="images/logo.png" type="image/gif" sizes="16x16">
	
	<!-- Admin CSS File Link -->
	<link rel="stylesheet" href="css/style.css">
	
	<!-- User JAVA SCRIPT File Link -->
	<script type="text/javascript" src="js/script.js"></script>

	
	<!-- Font Awesome Icone -->
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
	
	<style>
		.div1{
			background:#f7f7f7;
			width:50%;
			height:auto;
			float:left;
			text-align:center;
			padding:10px;
		}
		.div1 table{
			width:94%;
			text-align:center;
			font-size:13px;
			border-collapse:collapse;
			margin:10px;
			padding:5px;
		}
		.div1 hr{
			margin:5px 10px;
			padding:0 10px;
		}
		table th{
			background:#6b5127;
			color:white;
			height:40px;
			border:solid white 1px;
		}
		table td{
			background:white;
			height:40px;
			border:solid black 1px;
			padding:5px;
		}
		.div1 hr{width:94%;}
		.div1 input,select, textarea{
			width:90%;
			height:45px;
			margin:5px 10px;
			padding:2px 10px;
			border-radius:5px;
			border:1px solid #6b5127;
			font-size:18px;
		}
		textarea{
			height:100px;
			padding:5px 10px;
		}
		input[type=submit]{
			background:#6b5127;
			color:white;
			font-size:30px;
			transition:1s;
		}
		input[type=submit]:hover{
			background:white;
			color:#6b5127;
			border:1px solid #6b5127;
			cursor:pointer;
			transition:1s;
		}
		
		@media(max-width:768px)
		{
			.div1{
				width:100%;
				height:auto;
			}
			.nav,.container{
				height:auto;
			}
		}
	</style>
	<link rel="stylesheet" href="css/mediaStyle.css">
</head>
<body>
	<!--Header Divison-->
	<?php
		require'header.php';
	?>
	
	<!--Container Division-->
	<div class="container">
		<?php
			include'menu.php';
			
			if(isset($_POST['submit']))
			{
			    include'../LinkFile/addMoney.php';
			}

		?>
		<div class="content">
			<div class="head">
				<div class="title"><p>Add Money :-</p></div>
				<div class="msg"><marquee><?php include'../msg.php'; ?></marquee></msg>
			</div><hr>
			<div class="data-content">
			    <script>
			        function reqTyp()
			        {
			            var r = document.getElementById("reqT").value;
			            if(r=="BANKING")
			            {
			                document.getElementById("bankMode").style.display = "inline";
			                document.getElementById("pMode").style.display = "inline";
			                document.getElementById("txnMode").style.display = "inline";
			            }
			            else if(r=="ADVANCE")
			            {
			                document.getElementById("bankMode").style.display = "none";
			                document.getElementById("pMode").style.display = "none";
			                document.getElementById("txnMode").style.display = "none";
			            }
			        }
			    </script>
				<form method="post">
					<div class="div1">
					    <center><h3 style="color:blue">Minimum Amount Limit 2000 Rs.</h3></center>
						<select name="reqType" onchange="reqTyp()" id="reqT">
							<option>BANKING</option>
							<option>ADVANCE</option>
						</select>
						<input type="number" name="amount" placeholder="Minimum Amount 2000..." >
						<select name="BankId" id="bankMode">
							<option>--Select Bank--</option>
							<?php
							    $quBank="SELECT * FROM bank WHERE Status='Active'";
							    $reBank=mysqli_query($con,$quBank);
							    while($dataBank=mysqli_fetch_array($reBank))
							    {
							        echo "<option value='".$dataBank['Id']."'>".$dataBank['Bankname']." - ".$dataBank['Accno']."</option>";
							    }
							
							?>
						</select>
						<select name="mode" id="pMode">
							<option>--Select Mode--</option>
							<option>IMPS</option>
							<option>NEFT</option>
							<option>RTGS</option>
						</select>
						<input type="text" name="txn" placeholder="Txn No..." id="txnMode">
						<textarea name="msg" placeholder="Type your message hear..(optional)"></textarea>
						<input type="submit" name="submit" value="Submit"  onclick='showLoader()'>
					</div>
				</form>
				<div class="div1">
					<center><h1>Recent Transaction</h1></center><hr>
					<table cellpadding="20" border="2">
						<tr>
							<th>Req.Id</th>
							<th>Date</th>
							<th><i class="fa fa-inr"></i></th>
							<th>Discription</th>
							<th>Status</th>
						</tr>
						<?php
							$quGetTxn="SELECT * FROM order_req WHERE Userid='$userid' ORDER BY Id DESC LIMIT 10";
							$reGetTxn=mysqli_query($con,$quGetTxn);
							while($dataGetTxn=mysqli_fetch_array($reGetTxn))
							{
								if($dataGetTxn['Status']=="PENDING")
								{
									$color="blue";
								}
								elseif($dataGetTxn['Status']=="APPROVED")
								{
									$color="green";
								}
								else
								{
									$color="red";
								}
								echo "<tr>";
									echo "<td>".$dataGetTxn['Id']."</td>";
									echo "<td>".$dataGetTxn['Date']."</td>";
									echo "<td>".$dataGetTxn['Amount']."</td>";
									echo "<td style='width:55%'>".$dataGetTxn['ReqType']." ".$dataGetTxn['Mode']." ".$dataGetTxn['TxnNo']." ".$dataGetTxn['Bankname']."</td>";
									echo "<td style='color:".$color."'>".$dataGetTxn['Status']."</td>";
								echo "</tr>";
							}
						?>
					</table>
				</div>
			</div>
		</div>
	</div>
	<?php
		require'footer.php';
	?>
</body>
</html>