As Afzaal said, you're not sending the user ID when you click on the button. You need to add a hidden input to the form with the user ID you want to process:
$output .= "<tr>
<td> $user_data->ID</td>
<td> $user_data->user_nicename</td>
<td> $user_data->Phone</td>
<td> $user_data->user_email</td>
<td> $user_data->refID</td>
<td> <form method='post'> <input type='hidden' name='ID' value='$user_data->ID' /> <input type='submit' name='submit' value='Activate' /> </form> </td>
</tr>";
You'll also need to move your
if($_POST['submit'])
block outside of the
foreach
loop - preferably before the
$wpdb->get_results
call, so that the data you display reflects the update you've just made.