if($_POST['btn']){
if($_POST['user_id']){
$status = $_POST['status'];
$end_date = strtotime($_POST['end_date']);
foreach($_POST['user_id'] as $id){
mysql_query("UPDATE cms_user SET status = '$status',am_date = '$end_date' WHERE user_id = '$id'") or die (mysql_error());
}
}
}
$status = $_POST['status'];
$end_date = strtotime($_POST['end_date']);
foreach($_POST['user_id'] as $id){
if($status != "")
{
mysql_query("UPDATE cms_user SET status = '$status' WHERE user_id = '$id'") or die (mysql_error());
}
if($end_date != "")
{
mysql_query("UPDATE cms_user SET am_date = '$end_date' WHERE user_id = '$id'") or die (mysql_error());
}
}