Exemple #1
0
        $num = $i;
    } else {
        $font = "<font class='message'>";
        $num = $i;
    }
    if ($day == $i) {
        $style = "style=\"border : 1px solid #FF0000;\"";
    } else {
        $style = "";
    }
    if (mysql_num_rows($result) != 0) {
        $style .= " class='tumma'";
    }
    echo "  <td align='center' {$style}><a href='{$PHP_SELF}?session={$session}&year={$year}&month={$month}&day={$i}&toim={$toim}'>{$font} {$num}</font></a></td>\n";
    // jos kyseessä on sunnuntai, tehdään rivinvaihto..
    if (weekday_number($i, $month, $year) == 6) {
        // kirjotetaan viikon numero jos seuraava viikko on olemassa
        if (days_in_month($month, $year) != $i) {
            $weeknro = date("W", mktime(0, 0, 0, $month, $i + 1, $year));
            echo "</tr><tr><th>{$weeknro}</th>";
        }
    }
}
//kirjoitetaan loppuun tyhjiä soluja
for ($i = 0; $i < 6 - weekday_number(days_in_month($month, $year), $month, $year); $i++) {
    echo "<td>&nbsp;</td>";
}
echo "</tr>";
echo "<tr><td class='back' align='center' colspan='8'><a href='{$PHP_SELF}?day=1&month={$backmmonth}&year={$backymonth}&toim={$toim}'>" . t("Edellinen") . "</a>  - <a href='{$PHP_SELF}?day=1&month={$nextmmonth}&year={$nextymonth}&toim={$toim}'>" . t("Seuraava") . "</a></td></tr>\n";
echo "</table></th></tr></table>";
require "../inc/footer.inc";
Exemple #2
0
    $result = pupe_query($query);
    while ($row = mysql_fetch_array($result)) {
        echo "<tr><td width='35'>{$row['alanimi']}</td><td></td>";
        for ($i = 1; $i <= days_in_month($month, $year); $i++) {
            $pva = $i;
            $query = "SELECT kalenteri.tunnus tunnus, pvmalku, pvmloppu, kalenteri.yhtio, if(kuka.nimi!='', kuka.nimi, kuka.kuka) nimi, replace(kentta01,'\r\n',' ') kentta01,\n                date_format(pvmalku,'%H:%i') kello, date_format(pvmloppu,'%H:%i') lkello\n                FROM kalenteri, kuka\n                WHERE kalenteri.tyyppi = 'varauskalenteri'\n                and pvmalku            <= '{$year}-{$mymonth}-{$pva} 23:59:00'\n                and pvmloppu           >= '{$year}-{$mymonth}-{$pva} 00:00:00'\n                and kalenteri.tapa     = '{$row['alanimi']}'\n                and kalenteri.yhtio    = kuka.yhtio\n                and kalenteri.kuka     = kuka.kuka\n                {$konsernit2}\n                order by pvmalku";
            $kresult = pupe_query($query);
            $krow = mysql_fetch_array($kresult);
            if ($krow["nimi"] == '') {
                echo "<td align='center' width='35'><a class='td' href='../varauskalenteri/varauskalenteri.php?lopetus={$lopetus}&tee=SYOTA&year={$year}&month={$month}&day={$pva}&toim={$row['alanimi']}'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>";
            } else {
                echo "<div id='div_{$krow['tunnus']}' class='popup' style='width:200px;'>";
                if (mysql_num_rows($kresult) > 0) {
                    mysql_data_seek($kresult, 0);
                    while ($krow2 = mysql_fetch_array($kresult)) {
                        echo "{$krow2['kello']}-{$krow2['lkello']} {$krow2['nimi']}<br>{$row['alanimi']}.<br>{$krow2['kentta01']}<br><br>";
                    }
                }
                echo "</div>";
                echo "<td align='center' width='35' class='tooltip' id='{$krow['tunnus']}'><a class='td' href='../varauskalenteri/varauskalenteri.php?lopetus={$lopetus}&tee=NAYTA&year={$year}&month={$month}&day={$pva}&tunnus={$krow['tunnus']}&toim={$row['alanimi']}'>{$krow['nimi']}</a></td>";
            }
            if (weekday_number($i, $month, $year) == 6) {
                echo "<td class='back'></td>";
            }
            echo "\n";
        }
        echo "</tr>";
    }
}
echo "</table>";
require "inc/footer.inc";
Exemple #3
0
                echo "</td>";
            }
            $solu++;
        }
        if (count($ASENTAJA_ARRAY_TARK) < 5 and weekday_number($i, $month, $year) == 6 and $solu > 0) {
            // Rivinvaihto jos seuraava viikko on olemassa
            if (days_in_month($month, $year) != $i) {
                echo "</tr><tr>";
                echo "<td class='back' style='vertical-align: bottom;'>\n            <table style='width: 100%; height: 100%;'>\n            <tr><td class='back' style='height: {$korkeus};'>&nbsp;</td></tr>\n            <tr><td class='back' style='height: {$korkeus};'>&nbsp;</td></tr>";
                foreach ($AIKA_ARRAY as $a) {
                    if ($toim == 'TYOMAARAYS_ASENTAJA') {
                        $a = '&nbsp;';
                    }
                    echo "<tr><td class='back' style='height: {$korkeus};'>{$a}</td></tr>";
                }
                echo "</table>";
                echo "</td>";
            }
        }
    }
    // Kirjotetaan loppuun tyhjiä soluja
    if (count($ASENTAJA_ARRAY_TARK) < 5 and weekday_number($i, $month, $year) < count($DAY_ARRAY) and weekday_number($i, $month, $year) > 0) {
        for ($a = weekday_number($i, $month, $year); $a <= count($DAY_ARRAY) - 1; $a++) {
            echo "<td class='back'>&nbsp;</td>";
        }
    }
    echo "</tr>";
    echo "</table>";
    echo "</div>";
}
require "inc/footer.inc";