function getMail($param){		
		$sql = 'SELECT * FROM users WHERE staff_id = :staff_id';
		$tb = $this->dbMail->connection->prepare($sql);
		$tb->execute(array(':staff_id'=>$param));
		$this->arrBest = $tb->fetch(PDO::FETCH_ASSOC);
		return $this->arrBest;
	}
}

$getData = new mainpage_query($pagiPage,$limit,$typePage,$_POST['staff_option'],$searchData);

$getter = $getData ->getDatafromtable($_POST['valComp_filt'],$_POST['valDep_filt'],$_POST['valLoca_filt']);

$counter = 0;
foreach($getter as $arItMs){
$companyName = $getData -> getCompanyById($arItMs['staff_company_id']);
$depName = $getData -> getDepById($arItMs['staff_depart_id']);
$grName = $getData -> getGroupyById($arItMs['staff_group_id']);
//$avatar = $getData -> getAvatar($arItMs['staff_lastname'],$arItMs['staff_name'],$arItMs['staff_secondname']);
$locaName = $getData -> getLocation($arItMs['staff_location']);
$UserMail = $getData -> getMail($arItMs['staff_id']);
	$getter[$counter]['staff_company_id'] = $companyName['company_name'];
	$getter[$counter]['staff_depart_id'] = $depName['department_name'];
	if($arItMs['staff_ats']=='0'){$getter[$counter]['staff_ats'] = '';}
	if($arItMs['staff_group_id']=='0'){$getter[$counter]['staff_group_id'] = '';}else{
		$getter[$counter]['staff_group_id'] = $grName['group_name'];
	}
	if($arItMs['staff_avatar']){$getter[$counter]['staff_avatar'] = $arItMs['staff_avatar'];}else{$getter[$counter]['staff_avatar']='no-image.jpg';}
	$getter[$counter]['staff_location'] = $locaName['location_name'];
	if($arItMs['staff_active'] == '0'){$getter[$counter]['staff_status'] = 'В ожидании';}
	if($arItMs['staff_typedeactive']=='0'){$getter[$counter]['staff_status'] = 'Уволен';}