Example #1
0
function getAllOtherPlannedHolidays($day, $month, $year, $userID)
{
    $result = mysql_query("SELECT * FROM `UCPM_appointments` INNER JOIN `UCPM_employees` ON UCPM_appointments.userID = UCPM_employees.userID WHERE label='holiday' AND UCPM_appointments.userID!={$userID} ORDER BY starttime ASC");
    if (mysql_num_rows($result) == 0) {
        echo '<p class="center">Your colleagues don\'t have a holiday planned.</p>';
    } else {
        while ($row = mysql_fetch_array($result)) {
            echo '<article class="info_list"><div class="info_pic"><img src="img/' . $row['img'] . '" height="80"></div><div class="info_container"><div class="info_title">' . $row['name'] . '</div><div class="info_extra">' . $row['function'] . '</div><div class="info_extra">Goes on holiday on <b> ' . timestampToDates($row['starttime']) . '</b></div></div></article>';
        }
    }
}
Example #2
0
function getAllAppointments($day, $month, $year, $userID)
{
    $result = mysql_query("SELECT * FROM `UCPM_appointments` WHERE (DATE(starttime) <= '{$year}-{$month}-{$day}') AND (DATE(endtime) >= '{$year}-{$month}-{$day}')  AND userID={$userID} ORDER BY starttime ASC");
    if (mysql_num_rows($result) < 1) {
        echo '<li><div class="empty">Nothing planned for this day…</div></li>';
    } else {
        while ($row = mysql_fetch_array($result)) {
            if ($row['secret'] == 1) {
                $secret = '<div class="label secret">secret</div>';
            } else {
                $secret = '';
            }
            if (date('Y-m-d', strtotime($row['endtime'])) == date('Y-m-d', strtotime($row['starttime']))) {
                echo '<a href="edit.php?id=' . $row['appID'] . '"><li><div class="label ' . $row['label'] . '">' . $row['label'] . '</div>' . $secret . '<div class="time">' . timestampToHours($row['starttime']) . ' till ' . timestampToHours($row['endtime']) . '</div><div class="title">' . $row['title'] . '</div><div class="location">At ' . $row['location'] . '</div></li></a>';
            } else {
                echo '<li><a href="edit.php?id=' . $row['appID'] . '"><div class="label ' . $row['label'] . '">' . $row['label'] . '</div>' . $secret . '<div class="time">' . timestampToDates($row['starttime']) . ' <em>(' . timestampToHours($row['starttime']) . ')</em> till ' . timestampToDates($row['endtime']) . ' <em>(' . timestampToHours($row['endtime']) . ')</em></div><div class="title">' . $row['title'] . '</div><div class="location">At ' . $row['location'] . '</div></li></a>';
            }
        }
    }
}
Example #3
0
function seeBeforeDeleted($day, $month, $year, $time, $buffertime, $userID)
{
    $result = mysql_query("SELECT * FROM `UCPM_appointments` WHERE (TIME(starttime) >= '{$time}') AND (TIME(starttime) <= '{$buffertime}') AND (TIMESTAMP(endtime) > CONVERT_TZ(NOW(),'+00:00','+2:00')) AND userID={$userID} ORDER BY starttime ASC");
    if (mysql_num_rows($result) == 0) {
        echo '<li><div class="empty">Nothing planned for this day…</div></li>';
    } else {
        while ($row = mysql_fetch_array($result)) {
            if ($row['secret'] == 1) {
                $secret = '<div class="label secret">secret</div>';
            } else {
                $secret = '';
            }
            if (date('Y-m-d', strtotime($row['endtime'])) == date('Y-m-d', strtotime($row['starttime']))) {
                echo '<li><a href="edit.php?id=' . $row['appID'] . '"><div class="label ' . $row['label'] . '">' . $row['label'] . '</div>' . $secret . '<div class="time">' . timestampToHours($row['starttime']) . ' till ' . timestampToHours($row['endtime']) . '</div><div class="title">' . $row['title'] . '</div><div class="location">At ' . $row['location'] . '</div></li></a>';
            } else {
                echo '<li><a href="edit.php?id=' . $row['appID'] . '"><div class="label ' . $row['label'] . '">' . $row['label'] . '</div>' . $secret . '<div class="time">' . timestampToDates($row['starttime']) . ' <em>(' . timestampToHours($row['starttime']) . ')</em> till ' . timestampToDates($row['endtime']) . ' <em>(' . timestampToHours($row['endtime']) . ')</em></div><div class="title">' . $row['title'] . '</div><div class="location">At ' . $row['location'] . '</div></li></a>';
            }
        }
    }
}