Exemplo n.º 1
0
<?php

include "include.php";
if ($posting) {
    langTranslatePost('title,description');
    $id = db_save('cal_events');
    if (getOption('channels')) {
        db_checkboxes('channels', 'cal_events_to_channels', 'event_id', 'channel_id', $id);
    }
    url_query_add(array("month" => $_POST['start_dateMonth'], "year" => $_POST['start_dateYear']));
}
if (!isset($_GET['month']) || !isset($_GET['year'])) {
    url_query_add(array("month" => $_josh['month'], "year" => $_josh['year']));
}
echo drawTop();
echo drawNavigationCal($_GET['month'], $_GET['year']);
//get events
$result = db_query('SELECT 
			e.id,
			DAY(e.start_date) startDay,
			e.title' . langExt() . ' title,
			t.color
		FROM cal_events e
		JOIN cal_events_types t ON e.type_id = t.id
	' . getChannelsWhere('cal_events', 'e', 'event_id') . '
			AND 
			MONTH(e.start_date) = ' . $_GET['month'] . ' AND
			YEAR(e.start_date) = ' . $_GET['year']);
while ($r = db_fetch($result)) {
    $events[$r['startDay']][$r['id']]['title'] = $r['title'];
    $events[$r['startDay']][$r['id']]['color'] = $r['color'];
Exemplo n.º 2
0
<?php

include 'include.php';
if ($posting) {
    langTranslatePost('title,description');
    $id = db_save('cal_events');
    if (getOption('channels')) {
        db_checkboxes('channels', 'cal_events_to_channels', 'event_id', 'channel_id', $id);
    }
    url_change('./event.php?id=' . $_GET['id']);
}
$e = db_grab('SELECT MONTH(e.start_date) month, YEAR(e.start_date) year FROM cal_events e WHERE e.id = ' . $_GET['id']);
echo drawTop();
echo drawNavigationCal($e['month'], $e['year'], true);
echo drawEventForm();
echo drawBottom();
Exemplo n.º 3
0
<?php

include "include.php";
$e = db_grab("SELECT \n\t\te.title, \n\t\te.description, \n\t\te.startDate, \n\t\tISNULL(u.nickname, u.firstname) first,\n\t\tu.lastname last,\n\t\te.createdBy,\n\t\te.createdOn,\n\t\tt.color,\n\t\tt.description type,\n\t\tMONTH(e.startDate) month, \n\t\tYEAR(e.startDate) year\n\tFROM calendar_events e\n\tJOIN intranet_users u ON e.createdBy = u.userID\n\tJOIN calendar_events_types t ON e.typeID = t.id\n\tWHERE e.id = " . $_GET["id"]);
if (url_action("delete")) {
    db_query("DELETE FROM calendar_events WHERE id = " . $_GET["id"]);
    url_change("/cal/?month=" . $e["month"] . "&year=" . $e["year"]);
}
drawTop();
echo drawNavigationCal($e["month"], $e["year"], true);
?>
<table class="left" cellspacing="1">
	<?php 
if ($isAdmin) {
    echo drawHeaderRow("Event Details", 2, "edit", "event_edit.php?id=" . $_GET["id"], "delete", url_query_add(array("action" => "delete"), false));
} elseif ($user["id"] == $e["createdBy"]) {
    echo drawHeaderRow("Event Details", 2, "edit", "event_edit.php?id=" . $_GET["id"], "delete", url_query_add(array("action" => "delete"), false));
} else {
    echo drawHeaderRow("Event Details", 2);
}
?>
	<tr>
		<td class="left">Title</td>
		<td class="right" bgcolor="#ffffff"><b><?php 
echo $e["title"];
?>
</b></td>
	</tr>
	<tr>
		<td class="left">Type</td>
		<td><span class="block" style="background-color:<?php 
Exemplo n.º 4
0
<?php

include "include.php";
if ($posting) {
    $_POST["isActive"] = 1;
    $id = db_enter("calendar_events", "title description *startDate typeID");
    url_query_add(array("month" => $_POST["startDateMonth"], "year" => $_POST["startDateYear"]));
}
if (!isset($_GET["month"]) || !isset($_GET["year"])) {
    url_query_add(array("month" => $_josh["month"], "year" => $_josh["year"]));
}
drawTop();
echo drawNavigationCal($_GET["month"], $_GET["year"]);
//get events
$result = db_query("SELECT \n\t\t\te.id,\n\t\t\tDAY(e.startDate) startDay,\n\t\t\te.title,\n\t\t\tt.color\n\t\tFROM calendar_events e\n\t\tJOIN calendar_events_types t ON e.typeID = t.id\n\t\tWHERE e.isActive = 1 AND \n\t\t\tMONTH(e.startDate) = {$_GET["month"]} AND\n\t\t\tYEAR(e.startDate) = " . $_GET["year"]);
while ($r = db_fetch($result)) {
    $events[$r["startDay"]][$r["id"]]["title"] = $r["title"];
    $events[$r["startDay"]][$r["id"]]["color"] = $r["color"];
}
//SET UP VARIABLES
$monthname = $_josh["months"][$_GET['month'] - 1];
$firstday = date("w", mktime(0, 0, 0, $_GET["month"], 1, $_GET["year"]));
$lastday = date("d", mktime(0, 0, 0, $_GET["month"] + 1, 0, $_GET["year"]));
$prevmonth = $_GET['month'] - 1;
$prevyear = $_GET['year'];
$nextmonth = $_GET['month'] + 1;
$nextyear = $_GET['year'];
if ($prevmonth == 0) {
    $prevmonth = 12;
    $prevyear = $_GET['year'] - 1;
} elseif ($nextmonth == 13) {