Example #1
0
 *
 *  Client apps must use the same authentication as the web browser. If
 *  WebCalendar is setup to use web-based authentication, then the login.php
 *  found in this directory should be used to obtain a session cookie.
 */
// How many days ahead should we look for events?
// To handle case of an event 30 days from now where the user asked
// for a reminder 30 days before the event.
$DAYS_IN_ADVANCE = 30;
// $DAYS_IN_ADVANCE = 365;
// Show reminders for the next N days.
$CUTOFF = 7;
$WS_DEBUG = false;
require_once 'ws.php';
// Initialize...
ws_init();
header('Content-type: text/xml');
// header ( "Content-type: text/plain" );
echo '<?xml version="1.0" encoding="UTF-8"?' . ">\n";
$out = '
<reminders>';
// If login is public user, make sure public can view others...
if ($login == '__public__' && $login != $user) {
    if ($PUBLIC_ACCESS_OTHERS != 'Y') {
        echo '
  <error>' . translate('Not authorized') . '</error>
</reminders>
';
        exit;
    }
    $out .= '
Example #2
0
File: function.php Project: vsuh/ss
function get_mv_content($currDep, $post)
{
    if (empty($post['rep-period-from'])) {
        die('Неверная дата начала периода отчета: ' . $post['rep-period-from'] . '<a href="/?mode=mv">Назад</a>');
    }
    $from = strtotime($post['rep-period-from']);
    if (empty($post['rep-period-to'])) {
        die('Неверная дата завершения периода отчета: ' . $post['rep-period-to'] . '<a href="/?mode=mv">Назад</a>');
    }
    $to = strtotime($post['rep-period-to']);
    if ($to < $from) {
        die("Дата начала периода отчета " . $post['rep-period-from'] . " больше даты завершения " . $post['rep-period-to'] . '<a href="/?mode=mv">Назад</a>');
    }
    if (0 + $post["rep-purp"] < 0 || 0 + $post["rep-purp"] > 3) {
        die("Указана неверная причина перемещения");
    }
    $client = ws_init();
    if ($client == null) {
        die("Не удалось получить данные по перемещениям");
    }
    $param["dcode"] = $currDep == "000000000" ? NULL : $currDep;
    $param["PeriodBeg"] = $from;
    $param["PeriodEnd"] = $to;
    $param["EventType"] = $post["rep-purp"];
    try {
        $result = $client->getMoved($param);
    } catch (SoapFault $E) {
        echo "<b>" . __LINE__ . "-> " . $E->faultstring . "</b><br/><br/>";
    }
    return normalizeMovings($result);
}