Пример #1
0
    $ret['IsSuccess'] = true;
    $ret['Msg'] = 'Succefully';
    return $ret;
}
header('Content-type:text/javascript;charset=UTF-8');
$method = $_GET["method"];
switch ($method) {
    case "add":
        $ret = addCalendar($_POST["CalendarStartTime"], $_POST["CalendarEndTime"], $_POST["CalendarTitle"], $_POST["IsAllDayEvent"]);
        break;
    case "list":
        $ret = listCalendar($_POST["showdate"], $_POST["viewtype"]);
        break;
    case "update":
        $ret = updateCalendar($_POST["calendarId"], $_POST["CalendarStartTime"], $_POST["CalendarEndTime"]);
        break;
    case "remove":
        $ret = removeCalendar($_POST["calendarId"]);
        break;
    case "adddetails":
        $id = $_GET["id"];
        $st = $_POST["stpartdate"] . " " . $_POST["stparttime"];
        $et = $_POST["etpartdate"] . " " . $_POST["etparttime"];
        if ($id) {
            $ret = updateDetailedCalendar($id, $st, $et, $_POST["Subject"], $_POST["IsAllDayEvent"] ? 1 : 0, $_POST["Description"], $_POST["Location"], $_POST["colorvalue"], $_POST["timezone"]);
        } else {
            $ret = addDetailedCalendar($st, $et, $_POST["Subject"], $_POST["IsAllDayEvent"] ? 1 : 0, $_POST["Description"], $_POST["Location"], $_POST["colorvalue"], $_POST["timezone"]);
        }
        break;
}
echo json_encode($ret);
Пример #2
0
        $ret['Msg'] = $e->getMessage();
    }
    return $ret;
}
header('Content-type:text/javascript;charset=UTF-8');
$method = $_GET["method"];
switch ($method) {
    case "add":
        $ret = addCalendar($_POST["CalendarStartTime"], $_POST["CalendarEndTime"], $_POST["CalendarTitle"], $_POST["IsAllDayEvent"], $_POST["Guru"], $_POST["id_sekolah"], $_POST["id_mengajar"]);
        break;
    case "list":
        //$ret = listCalendar($_POST["showdate"], $_POST["viewtype"]);
        $ret = listCalendar('2/12/2013', 'week');
        break;
    case "update":
        $ret = updateCalendar($_POST["calendarId"], $_POST["CalendarStartTime"], $_POST["CalendarEndTime"]);
        break;
    case "remove":
        $ret = removeCalendar($_POST["calendarId"]);
        break;
    case "adddetails":
        $st = $_POST["stpartdate"] . " " . $_POST["stparttime"];
        $et = $_POST["etpartdate"] . " " . $_POST["etparttime"];
        if (isset($_GET["id"])) {
            $ret = updateDetailedCalendar($_GET["id"], $st, $et, $_POST["Subject"], isset($_POST["IsAllDayEvent"]) ? 1 : 0, $_POST["Description"], $_POST["Location"], $_POST["colorvalue"], $_POST["timezone"], $_POST["id_sekolah"], $_POST["id_kelas"], $_POST["id_mengajarpegawai"]);
        } else {
            $ret = addDetailedCalendar($st, $et, $_POST["Subject"], isset($_POST["IsAllDayEvent"]) ? 1 : 0, $_POST["Description"], $_POST["Location"], $_POST["colorvalue"], $_POST["timezone"]);
        }
        break;
}
echo json_encode($ret);
        $d2 = js2PhpTime(JRequest::getVar("enddate"));
        $d1 = mktime(0, 0, 0, date("m", $d1), date("d", $d1), date("Y", $d1));
        $d2 = mktime(0, 0, 0, date("m", $d2), date("d", $d2), date("Y", $d2)) + 24 * 60 * 60 - 1;
        $ret = listCalendarByRange($calid, $d1, $d2);
        break;
    case "update":
        $ret = updateCalendar(JRequest::getVar("calendarId"), JRequest::getVar("CalendarStartTime"), JRequest::getVar("CalendarEndTime"));
        break;
    case "remove":
        $ret = removeCalendar(JRequest::getVar("calendarId"), JRequest::getVar("rruleType"));
        break;
    case "adddetails":
        $st = JRequest::getVar("stpartdatelast") . " " . JRequest::getVar("stparttimelast");
        $et = JRequest::getVar("etpartdatelast") . " " . JRequest::getVar("etparttimelast");
        if (JRequest::getVar("id") != "") {
            $ret = updateDetailedCalendar(JRequest::getVar("id"), $st, $et, JRequest::getVar("Subject"), JRequest::getVar("IsAllDayEvent") == 1 ? 1 : 0, JRequest::getVar('Description', null, 'default', 'none', JREQUEST_ALLOWHTML), JRequest::getVar("Location"), JRequest::getVar("colorvalue"), JRequest::getVar("rrule"), JRequest::getVar("rruleType"), JRequest::getVar("timezone"));
        } else {
            $ret = addDetailedCalendar($calid, $st, $et, JRequest::getVar("Subject"), JRequest::getVar("IsAllDayEvent") == 1 ? 1 : 0, JRequest::getVar('Description', null, 'default', 'none', JREQUEST_ALLOWHTML), JRequest::getVar("Location"), JRequest::getVar("colorvalue"), JRequest::getVar("rrule"), 0, JRequest::getVar("timezone"));
        }
        break;
}
echo json_encode($ret);
function addCalendar($calid, $st, $et, $sub, $ade, $loc)
{
    eval(base64_decode('JHJldCA9IGFycmF5KCk7ICRkYiA9JiBKRmFjdG9yeTo6Z2V0REJPKCk7ICR1c2VyID0mIEpGYWN0b3J5OjpnZXRVc2VyKCk7IHRyeXsgJGEgPSBhcnJheSgic3QiPT4kc3QsImV0Ij0+JGV0LCJ0aXRsZSI9PiRzdWIsImFsbCI9PiRhZGUsImxvYyI9PiRsb2MsIm93bmVyIj0+JHVzZXItPmlkLCJwdWJsaXNoZWQiPT4xKTsgJGRhdGEgPSBzZXJpYWxpemUgKCRhKTsgJHNxbCA9ICJzZWxlY3QgKiBmcm9tIGAjX19kY19tdl9mcmVlYCI7ICRkYi0+c2V0UXVlcnkoICRzcWwgKTsgJHJvd3MgPSAkZGItPmxvYWRPYmplY3RMaXN0KCk7ICRzcWwgPSAiIjsgaWYgKCRyb3dzWzBdLT5hPT0iIikgeyAkc3FsID0gImEiOyAkaWQgPSAxOyB9IGVsc2UgaWYgKCRyb3dzWzBdLT5iPT0iIikgeyAkc3FsID0gImIiOyAkaWQgPSAyOyB9IGVsc2UgaWYgKCRyb3dzWzBdLT5jPT0iIikgeyAkc3FsID0gImMiOyAkaWQgPSAzOyB9IGVsc2UgaWYgKCRyb3dzWzBdLT5kPT0iIikgeyAkc3FsID0gImQiOyAkaWQgPSA0OyB9IGVsc2UgaWYgKCRyb3dzWzBdLT5lPT0iIikgeyAkc3FsID0gImUiOyAkaWQgPSA1OyB9IGlmICgkc3FsIT0iIikgeyAkc3FsID0gInVwZGF0ZSBgI19fZGNfbXZfZnJlZWAgc2V0ICIuJHNxbC4iPSIuJGRiLT5RdW90ZSgkZGF0YSkuIiB3aGVyZSBpZD0xIjsgJGRiLT5zZXRRdWVyeSggJHNxbCApOy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xuXG5UaGUgZXZlbnQgd2lsbCBiZSBzaG93biBub3cgaW4gdGhlIGNhbGVuZGFyIGJ1dCB3b24ndCBiZSBzYXZlZCB3aGVuIHlvdSByZWZyZXNoIHRoZSBwYWdlLlxuXG5QbGVhc2UgdXBncmFkZSB0byBnZXQgYWNjZXNzIHRvIGEgdmVyc2lvbiB0aGF0IGFsbG93cyB1bmxpbWl0ZWQgZXZlbnRzOlxuXG53d3cuSm9vbWxhQ2FsZW5kYXJzLmNvbSI7IH0gfWNhdGNoKEV4Y2VwdGlvbiAkZSl7ICRyZXRbIklzU3VjY2VzcyJdID0gZmFsc2U7ICRyZXRbIk1zZyJdID0gJGUtPmdldE1lc3NhZ2UoKTsgfQ=='));
    return $ret;
Пример #4
0
        $ret['IsSuccess'] = false;
        $ret['Msg'] = $e->getMessage();
    }
    return $ret;
}
header('Content-type:text/javascript;charset=UTF-8');
$method = $get["method"];
switch ($method) {
    case "add":
        $ret = addCalendar($post["CalendarStartTime"], $post["CalendarEndTime"], $post["CalendarTitle"], $post["IsAllDayEvent"]);
        break;
    case "list":
        $ret = listCalendar($post["showdate"], $post["viewtype"]);
        break;
    case "update":
        $ret = updateCalendar($post["calendarId"], $post["CalendarStartTime"], $post["CalendarEndTime"]);
        break;
    case "remove":
        $ret = removeCalendar($post["calendarId"]);
        break;
    case "adddetails":
        $st = $post["stpartdate"] . " " . $post["stparttime"];
        $et = $post["etpartdate"] . " " . $post["etparttime"];
        if (isset($get["id"])) {
            $ret = updateDetailedCalendar($get["id"], $st, $et, $post["Subject"], isset($post["IsAllDayEvent"]) ? 1 : 0, $post["Description"], $post["Location"], $post["colorvalue"], $post["timezone"]);
        } else {
            $ret = addDetailedCalendar($st, $et, $post["Subject"], isset($post["IsAllDayEvent"]) ? 1 : 0, $post["Description"], $post["Location"], $post["colorvalue"], $post["timezone"]);
        }
        break;
}
echo json_encode($ret);
Пример #5
0
        $ret['IsSuccess'] = false;
        $ret['Msg'] = $e->getMessage();
    }
    return $ret;
}
header('Content-type:text/javascript;charset=UTF-8');
$method = $_GET["method"];
switch ($method) {
    case "add":
        $ret = addCalendar($_POST["CalendarStartTime"], $_POST["CalendarEndTime"], $_POST["CalendarTitle"], $_POST["IsAllDayEvent"], $id);
        break;
    case "list":
        $ret = listCalendar($_POST["showdate"], $_POST["viewtype"], $id);
        break;
    case "update":
        $ret = updateCalendar($_POST["calendarId"], $_POST["CalendarStartTime"], $_POST["CalendarEndTime"]);
        break;
    case "remove":
        $ret = removeCalendar($_POST["calendarId"]);
        break;
    case "adddetails":
        $st = $_POST["stpartdate"] . " " . $_POST["stparttime"];
        $et = $_POST["etpartdate"] . " " . $_POST["etparttime"];
        if (isset($_GET["id"])) {
            $ret = updateDetailedCalendar($_GET["id"], $st, $et, $_POST["Subject"], isset($_POST["IsAllDayEvent"]) ? 1 : 0, $_POST["Description"], $_POST["Location"], $_POST["colorvalue"], $_POST["timezone"], $_POST['Program']);
        } else {
            $ret = addDetailedCalendar($st, $et, $_POST["Subject"], isset($_POST["IsAllDayEvent"]) ? 1 : 0, $_POST["Description"], $_POST["Location"], $_POST["colorvalue"], $_POST["timezone"], $id, $_POST['Program']);
        }
        break;
}
echo json_encode($ret);