= 0; $i --) { if ($i == $class-1) { echo '[' . $clnames[$i] . '] '; } else { echo '' . $clnames[$i] . ' '; } ; echo ' '; } ; ?>

'); $drclass = array (); $dri = 0; $query = "SELECT * FROM persons WHERE class_abs=" . $class_abs . " AND graduated IS NULL ORDER by binary(lastname)"; $result = mysql_query ( $query ); while ( $row = mysql_fetch_array ( $result ) ) { echo (''); if (!empty($row['foto_fragment'])) { $photo= explode ( "-", $row ['foto_fragment'] ); echo ('фото '); } elseif ($row ['foto_1553'] != NULL) { $photo = explode ( " ", $row ['foto_1553'] ); echo ('фото '); } ; echo ('' . $row ['lastname'] . ' ' . $row ['firstname'] . ''); if (($row ['email'] != NULL) && (! empty ( $row ['showemail'] ))) { echo (' e-mail'); } ; if (!EMPTY($row['email'])) { $identicons.= identicon($row['email'],$row['identicon'],'title="'.$row ['lastname'] . ' ' . $row ['firstname'].'"')." "; }; $db = 0; $mb = 0; if ($row ['datebirth'] > '1900-01-01') { $db = date_format ( date_create ( $row ['datebirth'] ), 'j' ); $mb = date_format ( date_create ( $row ['datebirth'] ), 'n' ); } elseif (($row [db] > 0) and ($row [mb] > 0)) { $db = $row [db]; $mb = $row [mb]; } ; if ($db > 0 and $mb > 0) { $dri ++; $drclass [$dri] = array (1 => $db, 2 => $mb, 3 => $row ['firstname'] . ' ' . $row ['lastname'] ); } ; echo (''); } ; $query = "SELECT * FROM persons WHERE class_ruc=" . $class_abs . " ORDER by binary(lastname)"; $result = mysql_query ( $query ); if (mysql_num_rows ( $result ) > 0) { echo (''); echo (' '); echo (''); echo (''); echo (mysql_num_rows ( $result ) > 1 ? 'Классные руководители:' : 'Классный руководитель:'); echo (''); } while ( $row = mysql_fetch_array ( $result ) ) { echo (''); if (!empty($row['foto_fragment'])) { $photo= explode ( "-", $row ['foto_fragment'] ); echo ('фото '); } elseif ($row ['foto_1553'] != NULL) { $photo = explode ( " ", $row ['foto_1553'] ); echo ('фото '); } ; echo ('' . $row ['lastname'] . ' ' . $row ['firstname'] . ' ' . $row ['middlename']); if (($row ['email'] != NULL) && (! empty ( $row ['showemail'] ))) { echo (' e-mail'); } ; $db = 0; $mb = 0; if ($row ['datebirth'] > '1900-01-01') { $db = date_format ( date_create ( $row ['datebirth'] ), 'j' ); $mb = date_format ( date_create ( $row ['datebirth'] ), 'n' ); } elseif (($row [db] > 0) and ($row [mb] > 0)) { $db = $row [db]; $mb = $row [mb]; } ; if ($db > 0 and $mb > 0) { $dri ++; $drclass [$dri] = array (1 => $db, 2 => $mb, 3 => $row ['firstname'] . ' ' . $row ['middlename'] . ' ' . $row ['lastname'] ); } ; echo (''); } ; echo (''); $query = "SELECT * FROM persons WHERE class_abs=" . $class_abs . " AND graduated IS NULL ORDER by binary(lastname)"; $result = mysql_query ( $query ); while ( $row = mysql_fetch_array ( $result ) ) { if (!empty($row['foto_fragment'])) { $photo = explode ( "-", $row ['foto_fragment'] ); echo ' '; } elseif ($row ['foto_1553'] != NULL) { $photo = explode ( " ", $row ['foto_1553'] ); $dbname2 = "1553_foto"; $dblogin2 = "1553_foto"; $dbpass2 = "n3jmsen6"; mysql_connect ( $dbhost, $dblogin2, $dbpass2 ) or die ( "Connection failed!!" ); mysql_select_db ( $dbname2 ) or die ( "Database failed!" ); ; $query = "SELECT dir, prefix, code, image FROM photo LEFT JOIN albums USING(album_code) WHERE code = " . $photo [0]; $result2 = mysql_query ( $query ) or die ( 'Фото не подключаются...' ); $row2 = mysql_fetch_array ( $result2 ); echo ' '; } ; } ; echo '
Скачать список класса'; $dri = count ( $drclass ); $nextdr = array (); $dplus = 0; $d = date ( "d" ) + 0; $m = date ( "m" ) + 0; do { $m1 = date ( "m", mktime ( 0, 0, 0, $m, $d + $dplus, date ( "Y" ) ) ); $d1 = date ( "d", mktime ( 0, 0, 0, $m, $d + $dplus, date ( "Y" ) ) ); for($i = 1; $i <= $dri; $i ++) { if (($d1 == $drclass [$i] [1]) and ($m1 == $drclass [$i] [2])) { ; $nextdr [] = $drclass [$i] [1] . ' ' . $rusmonth [$drclass [$i] [2]] . ' — ' . $drclass [$i] [3] . ' (' . ($dplus == 0 ? 'сегодня' : ($dplus == 1 ? 'завтра' : 'через ' . PChis ( $dplus, 'день', 'дня', 'дней' ))) . ')'; } } $dplus ++; } while ( (count ( $nextdr ) < 3) and ($dplus < 90) ); $dri = count ( $nextdr ); echo ($dri > 0 ? '

Ближайшие дни рождения в классе:
' : ''); for($i = 0; $i < $dri; $i ++) { echo $nextdr [$i] . '
'; } ; echo '
'; echo $identicons; ?>