Server : LiteSpeed System : Linux us-phx-web1202.main-hosting.eu 4.18.0-553.84.1.lve.el8.x86_64 #1 SMP Tue Nov 25 18:33:03 UTC 2025 x86_64 User : u615232177 ( 615232177) PHP Version : 8.1.33 Disable Function : NONE Directory : /home/u615232177/public_html/admin5352/ |
<?php session_start();
$page_name = basename($_SERVER['PHP_SELF']);
include("headerstrict.php"); ?>
<title><?php echo $company_name; ?>, Admin, Donations</title>
<!-- ======= Breadcrumbs ======= -->
<section id="breadcrumbs" class="breadcrumbs">
<div class="container"> </div>
</section>
<!-- End Breadcrumbs -->
<!-- ======= Contact Section ======= -->
<section id="contact" class="contact inner-page">
<div class="container" data-aos="fade-up">
<div class="section-title">
<h2>Donations</h2>
<p>All payments made online</p>
</div>
<div class='row'>
<?php
$stmt = $con -> prepare('SELECT * FROM transactions');
$stmt -> execute();
$stmt -> store_result();
$stmt -> bind_result($id,$email,$amount,$paystack_reference,$status,$gateway_response,$transaction_date,$full_name);
$numrows = $stmt -> num_rows();
if($numrows > 0){
while ($stmt -> fetch()) {
echo"
<div class='col-md-4'>
<form action='";?><?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?><?php echo"' method='post'class='php-email-form1'enctype='multipart/form-data'>
<div class='form-row'>
Name - $full_name<br/>
Email - $email<br/>
Amount - $amount<br/>
Transaction ID - $paystack_reference<br/>
Status - $status<br/>
Gateway response - $gateway_response<br/>
Date - $transaction_date<br/>
</div>
<div class='text-center'>
<button type='submit' name='delete$id'>Delete</button>
</div>
</form>
</div>
";
if (isset($_POST["delete$id"])) {
$stmt = $con -> prepare('DELETE FROM transactions WHERE id = ?');
$stmt -> bind_param('i', $id);
$stmt -> execute();
//create a session to verify it's coming from here
$_SESSION["action"] = "true";
$message="Transaction successfully deleted.";
echo "<meta http-equiv=\"refresh\" content=\"0; url=success.php?u=$page_name&m=$message\">";
}
}
}
?>
</div>
</div>
</section><!-- End Contact Section -->
<?php include("footer.php"); ?>