[ближайшие 2 недели] ';} else {echo 'ближайшие 2 недели ';}; echo ' '; if ($cde=='abc') {echo '[все (по алфавиту)] ';} else {echo 'все (по алфавиту) ';}; echo '
'; for ($i = 1; $i <= 12; $i++) { if ($i==$cde) {echo '['.$b[$i].'] ';} else {echo ''.$b[$i].' ';}; if ($i==6) {echo '
';}; }; echo '

'; if ($cde=="abc") { $query=" SELECT lastname as lan, firstname as fan, middlename as pat, day(datebirth) as d, month(datebirth) as m, lastname2 as lan2, name_lastnameorder, name_needpatronym, class_abs FROM persons WHERE (`class_abs`<0 OR `class_abs`>18) AND COALESCE(`graduated`,' ')<>'-' UNION SELECT lname as lan, fname as fan, pname as pat, day as d, mth as m, lname2 as lan2, name_lastnameorder, name_needpatronym, 'none' as class_abs FROM dr Order by lan, fan; "; $result = mysql_query($query) or die ("Query failed"); while($row = mysql_fetch_array($result)) { print($row["lan"]); if (!empty($row["lan2"])) print(" (".$row["lan2"].")"); print(" ".$row["fan"]); if ($row["name_needpatronym"]=='+') echo(" ".$row["pat"]); if ($row["class_abs"]<>'none') echo(" ".$row["firstname"]." ".$class_names[$row['class_abs']].""); print(" - ".$row["d"].$a[$row["m"]]."
"); }; mysql_free_result($result); }; if (($cde>0)and($cde<13)) { // $d=date("d")+0; // $m=date("m")+0; // // for ($i = 0; $i <= $plus; $i++) // { // $mth1=date("m",mktime(0,0,0,$m,$d+$i,date("Y"))); // $day1=date("d",mktime(0,0,0,$m,$d+$i,date("Y"))); // // // while($row = mysql_fetch_array($result)) { // print($row["day"].$a[$row["mth"]]." - "); // if (($row["type"]=="у") or ($row["type"]=="*")) {print("");}; // print($row["lname"]); // if (($row["type"]<>"в") and ($row["lname2"])) {print(" (".$row["lname2"].")");}; // print(" ".$row["fname"]); // if ($row["type"]=="*") {print("");}; // if ($row["type"]=="у") {print(" ".$row["pname"]."");}; // if ($row["type"]=="в") { // print(" ("); // if ($row["lname2"]) {print($row["lname2"]." ");}; // print($row["fname"]." ".$row["pname"].")"); // }; // print("
"); // // // $query = "SELECT * FROM persons WHERE day(datebirth)=".$day1." and month(datebirth)=".$mth1." AND ".$classSQL." ORDER BY `lastname`, `firstname`"; // //echo $query; // $result = mysql_query($query) or die ("Query dr2 failed"); // while($row = mysql_fetch_array($result)) // { // print '=='; // print(($day1*1).$rusmonth[$mth1*1]." - "); // print($row["lastname"]); // print(" ".$row["firstname"]." ".$class_names[$row['class_abs']].""); // print("
"); // }; // mysql_free_result($result); // // //}; //mysql_free_result($result); $d=1; $m=$cde+0; $i=0; do { $mth1=date("m",mktime(0,0,0,$m,$d+$i,date("Y"))); $day1=date("d",mktime(0,0,0,$m,$d+$i,date("Y"))); $result = mysql_query("SELECT * FROM dr WHERE `day`=".$day1." and `mth`=".$mth1." ORDER BY `mth`,`day`") or die ("Query dr1 failed"); while($row = mysql_fetch_array($result)) { print($row["day"].$a[$row["mth"]]." - "); if (($row["type"]=="у") or ($row["type"]=="*")) {print("");}; print($row["lname"]); if (($row["type"]<>"в") and ($row["lname2"])) {print(" (".$row["lname2"].")");}; print(" ".$row["fname"]); if ($row["type"]=="*") {print("");}; if ($row["type"]=="у") {print(" ".$row["pname"]."");}; if ($row["type"]=="в") { print(" ("); if ($row["lname2"]) {print($row["lname2"]." ");}; print($row["fname"]." ".$row["pname"].")"); }; print("
"); }; mysql_free_result($result); $query = "SELECT * FROM persons WHERE day(datebirth)=".$day1." and month(datebirth)=".$mth1." AND ".$classSQL." ORDER BY `lastname`, `firstname`"; //echo $query; $result = mysql_query($query) or die ("Query dr2 failed"); while($row = mysql_fetch_array($result)) { print(($day1*1).$rusmonth[$mth1*1]." - "); print($row["lastname"]); print(" ".$row["firstname"]." ".$class_names[$row['class_abs']].""); print("
"); }; mysql_free_result($result); $i++; } while ((date("m",mktime(0,0,0,$m,$d+$i,date("Y")))+0)==($cde+0)) ; }; if ($cde=="now") { $d=date("d")+0; $m=date("m")+0; for ($i = 0; $i <= $plus; $i++) { $mth1=date("m",mktime(0,0,0,$m,$d+$i,date("Y"))); $day1=date("d",mktime(0,0,0,$m,$d+$i,date("Y"))); $result = mysql_query("SELECT * FROM dr WHERE `day`=".$day1." and `mth`=".$mth1." ORDER BY `mth`,`day`") or die ("Query dr1 failed"); while($row = mysql_fetch_array($result)) { print($row["day"].$a[$row["mth"]]." - "); if (($row["type"]=="у") or ($row["type"]=="*")) {print("");}; print($row["lname"]); if (($row["type"]<>"в") and ($row["lname2"])) {print(" (".$row["lname2"].")");}; print(" ".$row["fname"]); if ($row["type"]=="*") {print("");}; if ($row["type"]=="у") {print(" ".$row["pname"]."");}; if ($row["type"]=="в") { print(" ("); if ($row["lname2"]) {print($row["lname2"]." ");}; print($row["fname"]." ".$row["pname"].")"); }; print("
"); }; mysql_free_result($result); $query = "SELECT * FROM persons WHERE day(datebirth)=".$day1." and month(datebirth)=".$mth1." AND ".$classSQL." ORDER BY `lastname`, `firstname`"; //echo $query; $result = mysql_query($query) or die ("Query dr2 failed"); while($row = mysql_fetch_array($result)) { print(($day1*1).$rusmonth[$mth1*1]." - "); print($row["lastname"]); print(" ".$row["firstname"]." ".$class_names[$row['class_abs']].""); print("
"); }; mysql_free_result($result); }; }; ?>