<?php

require('../lib/dbclass.php');

$id = $_POST['id'];

$custid = $_POST['custid'];



if ($_POST['clubid'] == '') {
    $clubid = 0;
} else {
    $clubid = $_POST['clubid'];
}

$name   = $_POST['name'];
$mobile = $_POST['mobile'];

$ward = $_POST['ward_id'];


updateQuery("update tbl_customer set name='$name',mobile='$mobile',Ward=$ward  where id=$custid");

updateQuery("update tbl_transaction set clubid=$clubid where id=$id");

$message = 'Edited successfully!';



$encodedMessage = urlencode($message);



$url = "challengereport.php?message={$encodedMessage}";

// Redirect to the new URL
echo "<script>window.location.href='{$url}';</script>";
