<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require('connect.php');
if(isset($_GET['client_email'])){
$client_email = $_GET['client_email'];
$chk_data = "DELETE FROM new_customer WHERE customer_email = '$client_email'";
$querytoData = mysqli_query($cxn, $chk_data);
if($querytoData){
  header('location:view_account.php');
}}elseif(isset($_GET['contact_id'])){
  $contact_id = $_GET['contact_id'];
  $chk_data = "UPDATE contac_form SET delete_status = 'yes' WHERE contact_id = '$contact_id'";
  if(!($querytoData = mysqli_query($cxn, $chk_data))){
    echo "fail";
  }else{
    header('location:view_messages.php');
  }
}elseif(isset($_GET['stop_trading'])){
  $invest_id = $_GET['invest_id'];
  $chk_data = "UPDATE investment SET finished = 'true' WHERE investment_unique = '$invest_id'"; 
  if(!($querytoData = mysqli_query($cxn, $chk_data))){
    echo "fail";
  }else{
    header('location:view_wire.php');
  }
}elseif(isset($_GET['invest_id'])){
  $invest_id = $_GET['invest_id'];
  $chk_data = "DELETE FROM investment WHERE investment_unique = '$invest_id'";
  if(!($querytoData = mysqli_query($cxn, $chk_data))){
    echo "fail";
  }else{
    header('location:view_wire.php');
  }
}elseif(isset($_GET['chtopaid'])){
  $with_id = $_GET['with_id'];
  $chk_data = "UPDATE withdrawal SET withdrawal_status = 'success' WHERE withdrawal_invest_unique = '$with_id'"; 
  if(!($querytoData = mysqli_query($cxn, $chk_data))){
    echo "fail";
  }else{
    header('location:view_withdraw.php');
  }
}elseif(isset($_GET['signal_id'])){
  $with_id = $_GET['signal_id'];
  $chk_data = "DELETE FROM trade_signals WHERE signal_id = '$with_id'"; 
  if(!($querytoData = mysqli_query($cxn, $chk_data))){
    echo "fail";
  }else{
    header('location:trade_signals.php');
  }
}

?>