<?php
// INCLUDE HEADER IN PAGE
include('other_header.php');
// GET CURRENT DATE AND TIME
$date = date('Y-m-d H:i:s');
if($_POST['save1']) {
	$gatewayid = $_POST['gatewayid'];
	$status = $_POST['status'];
	$email = $_POST['email'];
	$sid = $_POST['sid'];
	$apihash = $_POST['apihash'];
	$secret = $_POST['secret'];
	$taxpercentage = $_POST['taxpercentage'];
	$taxdollars = $_POST['taxdollars'];
	$fee_withdraw = $_POST['fee_withdraw'];
	mysql_query("UPDATE Web_Gateways SET status='$status',data1='$email',taxpercentage='$taxpercentage',taxdollars='$taxdollars',fee_withdraw='$fee_withdraw' WHERE id='$gatewayid'");
	if(!empty($sid)){
		mysql_query("UPDATE Web_Gateways SET data2='$sid' WHERE id='$gatewayid'");
	}
	if(!empty($apihash)){
		mysql_query("UPDATE Web_Gateways SET data2='$apihash' WHERE id='$gatewayid'");
	}
	if(!empty($secret)){
		mysql_query("UPDATE Web_Gateways SET data3='$secret' WHERE id='$gatewayid'");
	}
}
?>
  <div class="container">
    <div class="text-center">
      <h1><?php echo $title; ?>
      	<small>/Active is: Admin Account
			</small>
		</h1>
 	 </div>
 	 </br>
		<div class="row">
      <div class="col-md-8 col-md-offset-2">
        <?php
			$countrieslist = mysql_query("SELECT * FROM Web_Gateways ORDER BY id ASC");
			while($rowc = mysql_fetch_array($countrieslist)) 
			{
				//Paypal: Email1
				//2Checkout: Email1 SID2
				//Payza: Email1
				//Skrill: Email1
				//G2A Pay: Email1 APIhash2 Secretkey3
				echo"<option value='{$rowc['country']}'>{$rowc['country']}</option>";
				?>
		<div class="well">
			<div class="row">
				<center>
				<form name="csrf_form" id="campaignform" action="" method="POST">
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<span class="input-group-btn">
								<input value="Save" class="btn btn-default" style="width: 150px;" name="save1" type="submit">
							</span>
					</div>
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<center>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">Name:</span>
               				<input name="name" value="<?php echo $rowc['name'];?>" class="form-control" type="text" readonly="">
       					  	</div>
							</div>
							</center>
					</div>
					<?php 
					if($rowc['phpname'] == 'twocheckout') {
					?>
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<center>
							<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">Active</span>
               						<input id="status<?php echo $rowc['id'];?>0" class="toggle toggle-left" name="status" value="1" type="radio" <?php if($rowc['status'] == '1'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="status<?php echo $rowc['id'];?>1" class="btn">In development</label>
											<input id="status<?php echo $rowc['id'];?>0" class="toggle toggle-right" name="status" value="0" type="radio" <?php if($rowc['status'] == '0'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="status<?php echo $rowc['id'];?>0" class="btn">Deactivated</label>
           							</div>
							</div>
							</center>
					</div>
					<?php
					}else {
					?>
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<center>
							<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">Active</span>
               						<input id="status<?php echo $rowc['id'];?>1" class="toggle toggle-left" name="status" value="1" type="radio" <?php if($rowc['status'] == '1'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="status<?php echo $rowc['id'];?>1" class="btn">Activated</label>
											<input id="status<?php echo $rowc['id'];?>0" class="toggle toggle-right" name="status" value="0" type="radio" <?php if($rowc['status'] == '0'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="status<?php echo $rowc['id'];?>0" class="btn">Deactivated</label>
           							</div>
							</div>
							</center>
					</div>
					<?php
					}
					?>
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<center>
							<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">Email:</span>
               						<input name="email" value="<?php echo $rowc['data1'];?>" class="form-control" type="text">
       					  			</div>
							</div>
							</center>
					</div>
					<?php 
					if($rowc['phpname'] == 'twocheckout') {
					?>
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<center>
							<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">SID:</span>
               						<input name="sid" value="<?php echo $rowc['data2'];?>" class="form-control" type="text">
       					  			</div>
							</div>
							</center>
					</div>
					<?php
					}
					?>
					<?php 
					if($rowc['phpname'] == 'g2apay') {
					?>
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<center>
							<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">Your API hash:</span>
               						<input name="apihash" value="<?php echo $rowc['data2'];?>" class="form-control" type="text">
       					  			</div>
							</div>
							</center>
					</div>
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<center>
							<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">Your Secret:</span>
               						<input name="secret" value="<?php echo $rowc['data3'];?>" class="form-control" type="text">
       					  			</div>
							</div>
							</center>
					</div>
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<center>
							<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">IPN:</span>
               						<input readonly="readonly" onmouseover="this.select()" style="cursor:copy; opacity: 1;text-align: center;" class="form-control" value="<?php echo $mainurl;?>system/general/components/payment/g2apay/ipn.php" name="url" type="text">
										</div>
							</div>
							</center>
					</div>
					<?php
					}
					?>
					<?php 
					if($rowc['active_deposit'] == '1') {
					?>
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<center>
							<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">Deposit taxes:</span>
               						<input class="form-control" value="<?php echo $rowc['taxpercentage']?>" placeholder="Percentage fee" name="taxpercentage" type="text">
											<span class="input-group-addon">% + $</span>
											<input class="form-control" value="<?php echo $rowc['taxdollars']?>" placeholder="Strong payment fee" name="taxdollars" type="text">
										</div>
							</div>
							</center>
					</div>
					<?php
					}
					?>
					<?php 
					if($rowc['active_withdraw'] == '1') {
					?>
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<center>
							<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">Withdrawals taxes:</span>
               						<input class="form-control" value="<?php echo $rowc['fee_withdraw']?>" placeholder="Withdraw fee" name="fee_withdraw" type="text">
										</div>
							</div>
							</center>
					</div>
					<?php
					}
					?>
					<input type="hidden" name="csrf_token" value="<?php echo $token; ?>">
					<input type="hidden" name="gatewayid" value="<?php echo $rowc['id'];?>">
				</form>
				</br>
				</center>
			</div>
      </div>
				<?php
			}
		?>
        
      </div>
    </div>
</div>

<?php
include('other_footer.php');
?>
