<?php
	include'session.php';
	include'../connection.php';
	include'../functions.php';
	
	
?>
<html>
<head>
	<title>Edit Api</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%;
			min-height:500px;
			float:left;
			text-align:center;
		}
		.subDiv1{
			background:#6b5127;
			color:white;
			width:30%;
			height:40px;
			line-height:40px;
			margin:15px 0px 0px 10px;
			border-radius:;
			font-size:17px;
			float:left;
		}
		.subDiv1Add{
			background:#6b5127;
			color:white;
			width:30%;
			height:100px;
			line-height:100px;
			margin:10px 0px 10px 10px;
			border-radius:;
			font-size:17px;
			float:left;
		}
		.subDiv2{
			color:white;
			width:64%;
			height:40px;
			line-height:40px;
			margin:15px 0px 0px 0px;
			border-radius:;
			font-size:19px;
			float:left;
		}
		
		.subDiv2Add{
			color:white;
			width:64%;
			height:100px;
			line-height:100px;
			margin:10px 0px 10px 0px;
			border-radius:;
			font-size:19px;
			float:left;
		}
		.div1 input, .div1 select, .div1 p{
			color:black;
			text-align:left;
			width:100%;
			height:40px;
			margin:0px;
			padding:2px 10px;
			border:1px solid #6b5127;
			font-size:17px;
		}
		input[type=file]
		{
			border:none;
		}
		.div1 textarea{
			width:100%;
			height:100px;
			padding:2px 10px;
			border:1px solid #6b5127;
			font-size:19px;
		}
		.divImg{
			background:white;
			width:94%;
			height:100px;
			margin:15px 10px;
			padding:8px;
			border:1px solid #6b5127;
			font-size:19px;
			text-align:left;
		}
		.divImg img{
			width:19%;
			height:80px;
			float:left;
		}
		.divImg input{
			width:70%;
			float:right;
			font-size:15px;
		}
		input[type=submit]{
			background:#6b5127;
			width:94%;
			margin:15px 10px 10px 0px;
			padding:2px;
			color:white;
			font-size:25px;
			transition:1s;
			text-align:center;
		}
		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;
			}
			.subDiv1{width:35%; font-size:15px;}
			.subDiv2{width:59%; font-size:15px;}
			.subDiv1Add{width:35%; font-size:15px;}
			.subDiv2Add{width:59%; font-size:15px;}
			input[type=submit]{width:94%; margin:15px 2%;}
		}
	</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';
			$api_id = $_GET['api_id'];
			
			if(isset($_POST['submit']))
	        {	
	            include'../LinkFile/edit_api.php';
	        }   
			
			$quApi = "SELECT * FROM api WHERE Id='$api_id'";
			$reApi = mysqli_query($con,$quApi);
			$dataApi = mysqli_fetch_array($reApi);
		?>
		<div class="content">
			<div class="head">
				<div class="title"><p>Edit Api :-</p></div>
				<div class="msg"><marquee><?php include'../msg.php'; ?></marquee></msg>
			</div><hr>
			<div class="data-content">
				<form method="post" enctype="multipart/form-data">
					<div class="div1">
						<div class="subDiv1">Api Id : </div><div class="subDiv2"><p><?php echo $api_id; ?></p></div>
						<div class="subDiv1">Api Name : </div><div class="subDiv2"><p><?php echo $dataApi['ApiName'];; ?></p></div>
						<div class="subDiv1">Api Userid : </div><div class="subDiv2"><input type="text" name="ApiUsrId" value="<?php echo $dataApi['ApiUsrId']; ?>"></div>
						<div class="subDiv1">Api Token : </div><div class="subDiv2"><input type="text" name="ApiToken" value="<?php echo $dataApi['ApiToken']; ?>"></div>
						<div class="subDiv1">Api IP: </div><div class="subDiv2"><input type="text" name="Api_IP" value="<?php echo $dataApi['Api_IP']; ?>"></div>
						<div class="subDiv1">RchReqUrl: </div><div class="subDiv2"><input type="text" name="RchReqUrl" value="<?php echo $dataApi['RchReqUrl']; ?>"></div>
						<div class="subDiv1">chkRechUrl: </div><div class="subDiv2"><input type="text" name="chkRechUrl" value="<?php echo $dataApi['chkRechUrl']; ?>"></div>
						<div class="subDiv1">Call Back Url: </div><div class="subDiv2"><input type="text" name="cb_url" value="<?php echo $dataApi['cb_url']; ?>"></div>
						<div class="subDiv1">Req Format: </div><div class="subDiv2">
						    <select name="ReqFormat">
						        <?php
						            if($dataApi['ReqFormat']=="GET")
						            {
						                echo "<option>SELECT FORMAT</option><option selected>GET</option><option>POST</option>";
						            }
						            elseif($dataApi['ReqFormat']=="POST")
						            {
						                echo "<option>SELECT FORMAT</option><option>GET</option><option selected>POST</option>";
						            }
						            else
						            {
						                echo "<option>SELECT FORMAT</option><option>GET</option><option>POST</option>";
						            }
						        
						        ?>
						    </select>
						</div>
						<h3 style="margin-top:10px">Request Keyword<h3>
						<div class="subDiv1">USERID</div><div class="subDiv2"><input type="text" name="USERID" value="<?php echo $dataApi['USERID']; ?>"></div>
						<div class="subDiv1">TOKEN</div><div class="subDiv2"><input type="text" name="TOKEN" value="<?php echo $dataApi['TOKEN']; ?>"></div>
						<div class="subDiv1">ACCOUNT</div><div class="subDiv2"><input type="text" name="ACCOUNT" value="<?php echo $dataApi['ACCOUNT']; ?>"></div>
						<div class="subDiv1">AMOUNT</div><div class="subDiv2"><input type="text" name="AMOUNT" value="<?php echo $dataApi['AMOUNT']; ?>"></div>
						<div class="subDiv1">OPCODE</div><div class="subDiv2"><input type="text" name="OPCODE" value="<?php echo $dataApi['OPCODE']; ?>"></div>
						<div class="subDiv1">ORDERID</div><div class="subDiv2"><input type="text" name="ORDERID" value="<?php echo $dataApi['ORDERID']; ?>"></div>
						<div class="subDiv1">STV</div><div class="subDiv2"><input type="text" name="STV" value="<?php echo $dataApi['STV']; ?>"></div>
						<div class="subDiv1">CIRCLE</div><div class="subDiv2"><input type="text" name="CIRCLE" value="<?php echo $dataApi['CIRCLE']; ?>"></div>
						<div class="subDiv1">ROFFER</div><div class="subDiv2"><input type="text" name="ROFFER" value="<?php echo $dataApi['ROFFER']; ?>"></div>
						<div class="subDiv1">LAPUGROUP</div><div class="subDiv2"><input type="text" name="LAPUGROUP" value="<?php echo $dataApi['LAPUGROUP']; ?>"></div>
						<div class="subDiv1">FORMAT</div><div class="subDiv2"><input type="text" name="FORMAT" value="<?php echo $dataApi['FORMAT']; ?>"></div>
						<h3 style="margin-top:10px">Response Keyword<h3>
						<div class="subDiv1">Respo Status</div><div class="subDiv2"><input type="text" name="STATS" value="<?php echo $dataApi['STATS']; ?>"></div>
						<div class="subDiv1">Respo Msg</div><div class="subDiv2"><input type="text" name="MSG" value="<?php echo $dataApi['MSG']; ?>"></div>
						<div class="subDiv1">Error Msg</div><div class="subDiv2"><input type="text" name="ERRMSG" value="<?php echo $dataApi['ERRMSG']; ?>"></div>
						<div class="subDiv1">Error Code</div><div class="subDiv2"><input type="text" name="ERRCODE" value="<?php echo $dataApi['ERRCODE']; ?>"></div>
						<div class="subDiv1">Op Ref Id</div><div class="subDiv2"><input type="text" name="TXNID" value="<?php echo $dataApi['TXNID']; ?>"></div>
						<div class="subDiv1">Partner Id</div><div class="subDiv2"><input type="text" name="PARTNRID" value="<?php echo $dataApi['PARTNRID']; ?>"></div>
						<div class="subDiv1">Api Bal</div><div class="subDiv2"><input type="text" name="BAL" value="<?php echo $dataApi['BAL']; ?>"></div>
						<div class="subDiv1">Lapu No</div><div class="subDiv2"><input type="text" name="LAPU" value="<?php echo $dataApi['LAPU']; ?>"></div>
						<div class="subDiv1">R Offer</div><div class="subDiv2"><input type="text" name="ROFR" value="<?php echo $dataApi['ROFR']; ?>"></div>
						<div class="subDiv1">Roaming</div><div class="subDiv2"><input type="text" name="ROAM" value="<?php echo $dataApi['ROAM']; ?>"></div>
						<input type="submit" name="submit" value="Submit"  onclick='showLoader()'>
					</div>
				</form>
			</div>
		</div>
	</div>
	<?php
		require'footer.php';
	?>
</body>
</html>