<?php


// DELETE ADMIN DATA
if(isset($_POST['del']))
{
     require 'CpanelScript/connect.php';
    $id = $_POST['trans_id'];
    // $conn = mysqli_connect("localhost", "akfinanc_admin", "boy510251023Aa", "akfinanc_ascension") or die("Could not connect to mysql".mysqli_error($connect));
    date_default_timezone_set('Africa/Lagos');
    $query = "DELETE FROM transactions WHERE id='$id' ";
    $query_run = mysqli_query($con, $query);

    if($query_run)
    {
        $_SESSION['status'] = "Your Data is Deleted";
        $_SESSION['status_code'] = "success";
        header('Location: register.php'); 
    }
    else
    {
        $_SESSION['status'] = "Your Data is NOT DELETED";       
        $_SESSION['status_code'] = "error";
        header('Location: register.php'); 
    }    
}




// if(isset($_POST['del'])) {
//  $id = $_POST('trans_id');
 
//  $conn = mysqli_connect("localhost", "springwe_useradmin", "supportadmin", "springwe_in") or die("Could not connect to mysql".mysqli_error($connect));
//   date_default_timezone_set('Africa/Lagos');
//  $sql = mysqli_query($conn, "DELETE FROM transactions WHERE ID = $id");
 
//  if($sql) {
//      echo 'Done';
//  }
// }

?>

