Server : LiteSpeed System : Linux nl-srv-web1396.main-hosting.eu 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64 User : u107206879 ( 107206879) PHP Version : 7.2.34 Disable Function : NONE Directory : /home/u107206879/domains/escort46.de/public_html/admin/ |
<?php
$error = "";
$message = "";
include "db_connection.php";
include "sessioncheck.php";
$error = "";
$message = "";
if (!empty($_GET["id"])) {
$query = "SELECT * from payment WHERE id='" . $_GET['id'] . "'";
$result = mysqli_query($connection, $query);
$row = mysqli_fetch_assoc($result);
if (!empty($row["id"])) {
} else {
header("Location:payment_order_list");
}
} else {
header("Location:payment_order_list");
}
if (!empty($_POST["Process"]) && trim($_POST["Process"]) == "EditNow") {
$order = array();
$order['ad_id'] = test_input($_POST['ad_id']);
$order['payment_type'] = test_input($_POST['payment_type']);
$order['paypal_txn_id'] = test_input($_POST['paypal_txn_id']);
$order['plan_type'] = test_input($_POST['plan_type']);
$order['plan_id'] = test_input($_POST['plan_id']);
$order['sub_plan_id'] = test_input($_POST['sub_plan_id']);
$order['rec_amount'] = test_input($_POST['rec_amount']);
$order['currency'] = test_input($_POST['currency']);
$order['payer_email'] = test_input($_POST['payer_email']);
$order['payment_date'] = test_input($_POST['payment_date']);
$query = "UPDATE payment SET ad_id='" . addslashes($order['ad_id']) . "', payment_type='" . addslashes($order['payment_type']) . "', paypal_txn_id='" . addslashes($order['paypal_txn_id']) . "',plan_type='" . addslashes($order['plan_type']) . "', plan_id='" . addslashes($order['plan_id']) . "', sub_plan_id='" . addslashes($order['sub_plan_id']) . "', rec_amount='" . addslashes($order['rec_amount']) . "', currency='" . addslashes($order['currency']) . "', payer_email='" . addslashes($order['payer_email']) . "', payment_date='" . addslashes($order['payment_date']) . "' WHERE id=" . $row["id"];
$usrresult = mysqli_query($connection, $query);
$message = "Order updated successfully";
#ftch the latet data
$query = "SELECT * from payment WHERE id='" . $row['id'] . "'";
$result = mysqli_query($connection, $query);
$row = mysqli_fetch_assoc($result);
}
?>
<!-- Header Start-->
<?php include("header.php"); ?>
<nav class=" navbar navbar-expand navbar-white navbar-light">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#">
<i class="fa fa-bars" style="color:white;"></i>
</a>
</li>
</ul>
<div>
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item ">Orders</li>
<li class="breadcrumb-item">Edit Order</li>
</ol>
</div>
</nav>
<!-- Header Ends-->
<!-- Content Start-->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card">
<!--<div class="card-header">
<h3 class="card-title"><button type="button" class="btn btn-info" onClick="window.location.href='<?php echo MAIN_URL ?>/admin/payment_order_list'">List Orders</button> </h3>
</div>-->
<!-- /.card-header -->
<div class="card-body">
<?php include_once 'notification.php'; ?>
<?php if (!empty($error)) : ?><div class="alert alert-info" role="alert" style="color:#FF0000;"><?php echo $error; ?></div><?php endif; ?>
<!-- Error Message -->
<form action="" method="post" id="add-user-form" enctype="multipart/form-data">
<div class="form-group">
<label for="usrname">Select Advert</label>
<?php $adQuery = mysqli_query($connection, "SELECT * FROM advertise ORDER BY id DESC"); ?>
<select class="form-control input_border_radius input-sm" name="ad_id" id="ad_id" required>
<option value="">Select Ad</option>
<?php while ($adData = mysqli_fetch_assoc($adQuery)) { ?>
<option value="<?= $adData['id'] ?>" <?= ($row['ad_id'] == $adData['id']) ? 'selected' : '' ?>><?= $adData['id'] ?> - <?= $adData['profile_tile'] ?></option>
<?php } ?>
</select>
</div>
<div class="form-group">
<label for="email">Payment Type</label>
<select class="form-control input_border_radius input-sm" id="payment_type" name="payment_type" required>
<option value="Paypal" <?php if ($row['payment_type'] == "Paypal") echo 'selected="selected"'; ?>> Paypal </option>
<option value="Bankwire" <?php if ($row['payment_type'] == "Bankwire") echo 'selected="selected"'; ?>> Bankwire </option>
<option value="Stripe" <?php if ($row['payment_type'] == "Stripe") echo 'selected="selected"'; ?>> Stripe </option>
</select>
</div>
<div class="form-group">
<label for="password">Paypal Trasaction Id</label>
<input type="text" class="form-control" id="paypal_txn_id" name="paypal_txn_id" placeholder="Enter Paypal Trasaction Id" value="<?php if (!empty($row["paypal_txn_id"])) {
echo $row["paypal_txn_id"];
} ?>">
</div>
<div class="form-group">
<label for="country">Plan Type</label>
<input type="text" class="form-control" id="plan_type" name="plan_type" placeholder="Enter Plan Type" value="<?php if (!empty($row["plan_type"])) {
echo $row["plan_type"];
} ?>" required>
</div>
<div class="form-group">
<label for="country">Plan Id</label>
<input type="text" class="form-control" id="plan_id" name="plan_id" placeholder="Enter Plan Id" value="<?php if (!empty($row["plan_id"])) {
echo $row["plan_id"];
} ?>" required>
</div>
<div class="form-group">
<label for="country">Sub Plan Id</label>
<input type="text" class="form-control" id="sub_plan_id" name="sub_plan_id" placeholder="Enter Sub Plan Id" value="<?php if (!empty($row["sub_plan_id"])) {
echo $row["sub_plan_id"];
} ?>" required>
</div>
<div class="form-group">
<label for="country">Amount</label>
<input type="text" class="form-control" id="rec_amount" name="rec_amount" placeholder="Enter Amount" value="<?php if (!empty($row["rec_amount"])) {
echo $row["rec_amount"];
} ?>" required>
</div>
<div class="form-group">
<label for="country">Currency</label>
<input type="text" class="form-control" id="currency" name="currency" placeholder="Enter Currency" value="<?php if (!empty($row["currency"])) {
echo $row["currency"];
} ?>" required>
</div>
<div class="form-group">
<label for="country">Payer Email</label>
<input type="text" class="form-control" id="payer_email" name="payer_email" placeholder="Enter Payer Email" value="<?php if (!empty($row["payer_email"])) {
echo $row["payer_email"];
} ?>">
</div>
<div class="form-group">
<label for="country">Payment Date</label>
<input type="text" class="form-control" id="payment_date" name="payment_date" placeholder="Enter Payment Date Id" value="<?php if (!empty($row["payment_date"])) {
echo $row["payment_date"];
} ?>">
</div>
<button type="submit" class="btn btn-primary">Edit</button>
<input type="hidden" name="Process" id="Process" value="EditNow" />
</form>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
</div>
<!-- /.row (main row) -->
</div><!-- /.container-fluid -->
</section>
<!-- Content Ends-->
<!-- Footer Start-->
<?php include("footer.php"); ?>
<!-- Footer Ends-->