/*************************************************************************** * Copyright (C) 2006 Artur Wiebe * * wibix@gmx.de * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ require_once("../../maincore.php"); require_once(BASEDIR."subheader.php"); require_once(BASEDIR."side_left.php"); if(isset($_GET['id']) && isNum($_GET['id'])) { $id = $_GET['id']; } else { fallback("calendar.php"); } require_once("include/common.php"); if(iGUEST) { $userdata['user_id']="0"; } /* * GET */ if(ec_check_access($ec_settings['edit_group'])) { $user_access = ""; } else { $user_access = " AND ((ev_status='0' AND ev_private='0')" ." OR user_id='".$userdata['user_id']."')"; } $query_id = dbquery("SELECT * FROM ".DB_PREFIX."aw_ec_events" ." WHERE ev_id='$id' $user_access"); if(dbrows($query_id)==0) { fallback("calendar.php"); } $event = dbarray($query_id); if(!empty($user_access) && !ec_check_access($event['ev_access'])) { fallback("calendar.php"); } if($event['ev_allow_logins']) { $can_login = iMEMBER; $cur_logins = dbcount("(*)", "aw_ec_logins", "(ev_id='$id' AND login_status='1')"); $max_logins = $event['ev_max_logins']; } else { $can_login = false; $max_logins = 1; $cur_logins = 0; } // who am i? $is_admin = (ec_check_access($ec_settings['edit_group']) || (iMEMBER && $event['user_id']==$userdata['user_id'])); /* * ACTION */ //FIXME if(isset($_GET['errno']) && isNum($_GET['errno'])) { $errno = $_GET['errno']; if($errno>=1 && $errno<=4) { ec_msg(false, $locale['EC115'][$errno]); } } /* * GUI */ //eec_show_menu(); if($event['ev_status']) { ec_msg(false, $locale['EC301']); } opentable($locale['EC300']); $query_id = dbquery("SELECT user_name" ." FROM ".DB_PREFIX."users" ." WHERE user_id='".$event['user_id']."'"); if(dbrows($query_id)) { $username = array_shift(dbarray($query_id)); } else { echo "
".$locale['EC302']; $username = $locale['EC303']; } echo "
".$event['ev_start']." ".$event['ev_title']." |
"; if($event['ev_private']) { echo ""; } else { echo "".$locale['EC116'].": " .getgroupname($event['ev_access']); } echo " | \n
".nl2br(parseubb($body)); echo "
$username"." - " .showdate("shortdate", $event['ev_timestamp'])." | "; if($is_admin) { echo "" ."".$locale['EC304'] ." | " .$locale['EC305'].""; echo " | "; } echo "\n