1. PHP / Говнокод #6626

    +165

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    $date = $_POST['date2'];
    if($_POST['1']!="") $r1=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[1]', '$lesson1', '$classID', '$date')");
    if($_POST['2']!="") $r2=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[2]', '$lesson2', '$classID', '$date')");
    if($_POST['3']!="") $r3=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[3]', '$lesson3', '$classID', '$date')");
    if($_POST['4']!="") $r4=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[4]', '$lesson4', '$classID', '$date')");
    if($_POST['5']!="") $r5=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[5]', '$lesson5', '$classID', '$date')");
    if($_POST['6']!="") $r6=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[6]', '$lesson6', '$classID', '$date')");
    if($_POST['7']!="") $r7=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[7]', '$lesson7', '$classID', '$date')");
    if($_POST['8']!="") $r8=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[8]', '$lesson8', '$classID', '$date')");
    }
    
    
    
    
    $Sunday = date("Y-m-d", mktime (0,0,0,date("m") ,date("d")+0-$todayis,$year));
    $Monday = date("Y-m-d", mktime (0,0,0,date("m") ,date("d")+1-$todayis,$year));
    $Tuesday = date("Y-m-d", mktime (0,0,0,date("m") ,date("d")+2-$todayis,$year));
    $Wednesday = date("Y-m-d", mktime (0,0,0,date("m") ,date("d")+3-$todayis,$year));
    $Thursday = date("Y-m-d", mktime (0,0,0,date("m") ,date("d")+4-$todayis,$year));
    $Friday = date("Y-m-d", mktime (0,0,0,date("m") ,date("d")+5-$todayis,$year));
    $Saturday = date("Y-m-d", mktime (0,0,0,date("m") ,date("d")+6-$todayis,$year));

    С песочницы хабра
    http://habrahabr.ru/sandbox/28776/

    Запостил: rO_ot, 11 Мая 2011

    Комментарии (37) RSS

    Добавить комментарий