$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);
		}		

?>