$tb->execute(array(':reply_login'=>$username,':reply_msg'=>$repl_msg));
	}
	function ChangeChk($username,$autoCheck){
		$sql = 'UPDATE bcc SET active=:active_chk WHERE bcc_name = :reply_login';
		$tb = $this->db->connection->prepare($sql);
		$tb->execute(array(':reply_login'=>$username,':active_chk'=>$autoCheck));
	}
	function writeLoging($inneruserId,$rzlt){
		$sql = 'INSERT INTO loging (`tmlog`,`login_id`,`moving`,`rzlt`,`vargroup`,`ipuser`) VALUES (NOW(),:login_id,"редактирование",:rzlt,"2","'.$_SERVER["REMOTE_ADDR"].'")';
		$tb = $this->dbIt->connection->prepare($sql);
		$tb->execute(array(':login_id'=>$inneruserId,':rzlt'=>$rzlt));
	}	
}

$getData = new mainpage_query();
$arrLogin = $getData ->getAllfromtable($user_id,$username,$datefrom,$email,$datefrom,$dateto);

$getData ->writeLoging($_SESSION['user_id'],$username);

//--auto replay msg
	$arrCheck = $getData ->checkIfExAutoReply($bcc_names);
		if($arrCheck['bcc_id']){
			if(!$repl_msg==''){
				$getData ->UpdAutoReply($bcc_names,$repl_msg);
			}
			$arrChkBox = $getData -> ChangeChk($bcc_names,$autoCheck);
		}else{
			$arrInsertRepl = $getData ->writeInAutoReply($bcc_names,$bcc_maps,$repl_msg,$autoCheck);
		}		

?>
		$tb->execute(array(':login'=>$username));
		$this->arrBest = $tb->fetch(PDO::FETCH_ASSOC);
		return $this->arrBest;
	}	
	function writeLoging($inneruserId,$rzlt){
		$sql = 'INSERT INTO loging (`tmlog`,`login_id`,`moving`,`rzlt`,`vargroup`,`ipuser`) VALUES (NOW(),:login_id,"мн. удаление",:rzlt,"1","'.$_SERVER["REMOTE_ADDR"].'")';
		$tb = $this->dbIt->connection->prepare($sql);
		$tb->execute(array(':login_id'=>$inneruserId,':rzlt'=>$rzlt));
	}
}

//print_r($_GET);

$count=0;

$dellData = new mainpage_query();
foreach($_GET as $DelUsers){
	$count++;
		$userGet = $dellData -> getDatafromtableUsers($DelUsers);
	if(count($_GET)==$count){
		$email .= $userGet['login'];
	}else{
		$email .= $userGet['login'] .', ';
	}
	$dellData ->Deletefromtable($DelUsers);	
}
$dellData ->writeLoging($_SESSION['user_id'],$email);
?>


			$sername = $userData['staff_lastname'];
			$username = $userData['staff_name'];
		}		
		
		$sql = 'UPDATE users SET login=:login, password=:password, email=:email, sername=:sername, name=:username, mailbox=:mailbox, userdate=:userdate, domain_id=:domain_id, active=:active, staff_id=:staff_id WHERE user_id=:user_id';
		$tb = $this->db->connection->prepare($sql);
		$tb->execute(array(':user_id'=>$user_id,':login'=>$login,':password'=>$password,':email'=>$email,':username'=>$username,':sername'=>$sername,':mailbox'=>$mailbox,':userdate'=>date('Y-m-d',strtotime($userdate)),':domain_id'=>$domain_id,':active'=>$active,':staff_id'=>$profile_create));
		/*$this->arrBest = $tb->fetch(PDO::FETCH_ASSOC);
		return $this->arrBest;*/
	}	
	function writeLoging($inneruserId,$rzlt){
		$sql = 'INSERT INTO loging (`tmlog`,`login_id`,`moving`,`rzlt`,`vargroup`,`ipuser`) VALUES (NOW(),:login_id,"редактирование",:rzlt,"1","'.$_SERVER["REMOTE_ADDR"].'")';
		$tb = $this->dbIt->connection->prepare($sql);
		$tb->execute(array(':login_id'=>$inneruserId,':rzlt'=>$rzlt));
	}
	function writeLogingBlocking($inneruserId,$rzlt){
		$sql = 'INSERT INTO loging (`tmlog`,`login_id`,`moving`,`rzlt`,`vargroup`) VALUES (NOW(),:login_id,"блокирование",:rzlt,"1")';
		$tb = $this->db->connection->prepare($sql);
		$tb->execute(array(':login_id'=>$inneruserId,':rzlt'=>$rzlt));
	}
}

$getData = new mainpage_query();
$arrLogin = $getData ->getAllfromtable($user_id,$login,$password,$email,$username,$sername,$mailbox,$userdate,$domain_id,$active,$profile_create);

$getData ->writeLoging($_SESSION['user_id'],$login);

if(empty($active)){
	$getData ->writeLogingBlocking($_SESSION['user_id'],$login);
}
?>
		$tb = $this->db->connection->prepare($sql);
		$tb->execute(array(':alias_id'=>$param));
		

	}
	function getDatafromtableUsers($username){
		$sql = 'SELECT * FROM aliases WHERE alias_id = :login';
		$tb = $this->db->connection->prepare($sql);
		$tb->execute(array(':login'=>$username));
		$this->arrBest = $tb->fetch(PDO::FETCH_ASSOC);
		return $this->arrBest;
	}	
	function writeLoging($inneruserId,$rzlt){
		$sql = 'INSERT INTO loging (`tmlog`,`login_id`,`moving`,`rzlt`,`vargroup`,`ipuser`) VALUES (NOW(),:login_id,"удаление",:rzlt,"2","'.$_SERVER["REMOTE_ADDR"].'")';
		$tb = $this->dbIt->connection->prepare($sql);
		$tb->execute(array(':login_id'=>$inneruserId,':rzlt'=>$rzlt));
	}	
}

//print_r($_GET);
$dellData = new mainpage_query();

$userGet = $dellData -> getDatafromtableUsers($param);

$dellData -> writeLoging($_SESSION['user_id'],$userGet['username']);

$dellData ->Deletefromtable($param);
?>


	function getDatafromtable($username){
		$sql = 'SELECT `alias_id`,`username`,`alias` FROM aliases WHERE username = :login ORDER BY alias_id DESC';
		$tb = $this->db->connection->prepare($sql);
		$tb->execute(array(':login'=>$username));
		$this->arrBest = $tb->fetch(PDO::FETCH_ASSOC);
		return $this->arrBest;
	}
}

$getData = new mainpage_query();
$arrLogin = $getData ->getAllfromtable($username,$datefrom,$email,$datefrom,$dateto);

//--auto replay msg

	$arrCheck = $getData ->checkIfExAutoReply($bcc_names);
		if($arrCheck['bcc_id']){
			if(!$repl_msg==''){
				$getData ->UpdAutoReply($bcc_names,$repl_msg);
			}
			$arrChkBox = $getData -> ChangeChk($bcc_names,$autoCheck);
		}else{
			$arrInsertRepl = $getData ->writeInAutoReply($bcc_names,$bcc_maps,$repl_msg,$autoCheck);
		}


$getter = $getData ->getDatafromtable($username);

$getData ->writeLoging($_SESSION['user_id'],$username .' -> ('.$email.')');

require 'template_right_side_alias.php';
?>