Current Path : /var/www/html/clients/e-nkama.ru/e-nkama_bitrix/hbd/ |
Current File : /var/www/html/clients/e-nkama.ru/e-nkama_bitrix/hbd/index.php |
<? require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); $APPLICATION->SetTitle("Дни рождения"); ?><h1>HBDTY</h1> <pre> <?php $currentDay = date ('d'); $currentMonth = date ('m'); $currentYear = date ('Y'); $newDay = date ("d", mktime( 0,0,0,$currentMonth,$currentDay+1,$currentYear)); $newMonth = date ("m", mktime( 0,0,0,$currentMonth,$currentDay+1,$currentYear)); $newYear = date ("Y", mktime( 0,0,0,$currentMonth,$currentDay+1,$currentYear)); $items = GetIBlockElementList(40, false, Array("SORT"=>"ASC"), 0, Array(">DATE_ACTIVE_FROM"=>"15.03") ); $currentHBD = array(); $newHBD = array(); while($arItem = $items->GetNext()) { $hbd = explode(".",$arItem['DATE_ACTIVE_FROM']); if ($hbd[0]==$currentDay AND $hbd[1]==$currentMonth) { $currentHBD[] = array ( 'День рождения' => $arItem['DATE_ACTIVE_FROM'], 'Ф.И.О.' => $arItem['NAME'], 'Должность' => $arItem['PREVIEW_TEXT'] ); } if ($hbd[0]==$newDay AND $hbd[1]==$newMonth) { $newHBD[] = array ( 'День рождения' => $arItem['DATE_ACTIVE_FROM'], 'Ф.И.О.' => $arItem['NAME'], 'Должность' => $arItem['PREVIEW_TEXT'] ); } } if (!empty($currentHBD)) { print_r($currentHBD); } if (!empty($newHBD)) { print_r($newHBD); } ?> </pre> <?php require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php"); ?>