Esempio n. 1
0
function listTransfers($userID)
{
    $result = mysql_query("SELECT * FROM `UCPM_appointments` WHERE (endtime > NOW()) AND (userID!={$userID}) AND (userID!=0) AND (label!='holiday') AND (DATE(endtime) = CURDATE()) ORDER BY starttime ASC");
    if (mysql_num_rows($result) == 0) {
        echo '/';
    } else {
        while ($row = mysql_fetch_array($result)) {
            echo '<article class="info_list"><div class="info_pic"><img src="img/' . getEmployee($row['userID'], 'img') . '" width="80"></div><div class="info_container"><div class="info_title">' . timestampToHours($row['endtime']) . ' till ' . timestampToHours(getNextInfo($row['userID'], $row['endtime'], 'starttime')) . '</div><div class="info_extra">From ' . $row['location'] . ' to ' . getNextInfo($row['userID'], $row['endtime'], 'location') . '</div></div></article>';
        }
    }
}
Esempio n. 2
0
function getOthersAppointments($day, $month, $year, $userID)
{
    //echo '<h1>Colleagues</h1>';
    $result = mysql_query("SELECT * FROM `UCPM_appointments` INNER JOIN `UCPM_employees` ON UCPM_appointments.userID = UCPM_employees.userID WHERE {$userID}!=inviteesID AND (DATE(starttime) = '{$year}-{$month}-{$day}') AND UCPM_appointments.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)) {
            echo '<li><div class="time">' . timestampToHours($row['starttime']) . ' till ' . timestampToHours($row['endtime']) . '</div><div class="title">' . $row['title'] . '</div><div class="location">' . $row['location'] . '</div><div class="title">' . $row['name'] . '</div></li>';
        }
    }
}
Esempio n. 3
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>';
            }
        }
    }
}
Esempio n. 4
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>';
            }
        }
    }
}