<?php
	if($_POST){
		$islem = $db->prepare("UPDATE paytr SET merchant_id = ?, merchant_key = ?, merchant_salt = ?");
		$islem = $islem->execute(array($_POST['merchant_id'],$_POST['merchant_key'],$_POST['merchant_salt']));
		if($islem){
			echo b();
		}else{
			echo h();
		}
	}
	$duzenle = $db->query("SELECT * FROM paytr")->fetch(PDO::FETCH_ASSOC);
?>

<div class="page-header">
	<div class="page-leftheader">
		<h4 class="page-title">Paytr Api Ayarı</h4>
	</div>
	<div class="page-rightheader ml-auto d-lg-flex d-none">
		<ol class="breadcrumb">
			<li class="breadcrumb-item"><a href="index.php">Anasayfa</a></li>
			<li class="breadcrumb-item active" aria-current="page">Paytr Api Ayarı</li>
		</ol>
	</div>
</div>
						
<div class="row">
	
	<div class="col-md-12">
		<div class="card">
			<div class="card-body">
				<div class="row">
					<div class="col-md-12">
						
						<form class="form-horizontal" method="post" action="">

							<div class="form-group row">
								<label class="col-md-3 form-label">merchant_id</label>
								<div class="col-md-9">
									<input type="text" class="form-control" name="merchant_id" value="<?php echo @$duzenle['merchant_id']; ?>">
								</div>
							</div>
							
							<div class="form-group row">
								<label class="col-md-3 form-label">merchant_key</label>
								<div class="col-md-9">
									<input type="text" class="form-control" name="merchant_key" value="<?php echo @$duzenle['merchant_key']; ?>">
								</div>
							</div>

							
							<div class="form-group row">
								<label class="col-md-3 form-label">merchant_salt</label>
								<div class="col-md-9">
									<input type="text" class="form-control" name="merchant_salt" value="<?php echo @$duzenle['merchant_salt']; ?>">
								</div>
							</div>

							<div class="form-group row">
								<label class="col-md-3 form-label">Paytr Bildirim Urlsi</label>
								<label class="col-md-9 form-label"><?php echo $site; ?>paytr-bildirim.php</label>
							</div>


							<div class="form-group row">
								<div class="col-md-12"><center><button type="submit" class="btn btn-info">Kaydet</button></center></div>
							</div>

						</form>

					</div>
				</div>
			</div>
		</div>
	</div>
</div>
