if (!isset($phpc_jq_file)) { $phpc_jq_file = "//ajax.googleapis.com/ajax/libs/jquery/{$jquery_version}/jquery{$phpc_min}.js"; } /* * Do not modify anything under this point */ define('IN_PHPC', true); require_once "{$phpc_includes_path}/calendar.php"; try { require_once "{$phpc_includes_path}/setup.php"; } catch (Exception $e) { header("Content-Type: text/html; charset=UTF-8"); echo "<!DOCTYPE html>\n"; echo display_exception($e)->toString(); exit; } if ($vars["content"] == "json") { header("Content-Type: application/json; charset=UTF-8"); echo do_action(); } else { header("Content-Type: text/html; charset=UTF-8"); // This sets global variables that determine the title in the header $content = display_phpc(); $embed_script = ''; if ($vars["content"] == "embed") { $underscore_version = "1.5.2"; $embed_script = array(tag("script", attrs('src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/' . "{$underscore_version}/underscore-min.js\""), ''), tag('script', attrs('src="static/embed.js"'), '')); } $html = tag('html', attrs("lang=\"{$phpc_lang}\""), tag('head', tag('title', $phpc_title), tag('link', attrs('rel="icon"', "href=\"{$phpc_url_path}/static/office-calendar.png\"")), tag('meta', attrs('http-equiv="Content-Type"', 'content="text/html; charset=UTF-8"')), tag('link', attrs('rel="stylesheet"', "href=\"{$phpc_static_path}/phpc.css\"")), tag('link', attrs('rel="stylesheet"', "href=\"{$phpc_jqui_path}/themes/{$phpc_theme}/jquery-ui{$phpc_min}.css\"")), tag('link', attrs('rel="stylesheet"', "href=\"{$phpc_static_path}/jquery-ui-timepicker.css\"")), tag('link', attrs('rel="stylesheet"', "href=\"{$phpc_fa_path}/css/font-awesome{$phpc_min}.css\"")), tag("script", attrs("src=\"{$phpc_jq_file}\""), ''), tag("script", attrs("src=\"{$phpc_jqui_path}/jquery-ui{$phpc_min}.js\""), ''), tag('script', attrs("src=\"{$phpc_static_path}/phpc.js\""), ''), tag("script", attrs("src=\"{$phpc_static_path}/jquery.ui.timepicker.js\""), ''), tag("script", attrs("src=\"{$phpc_static_path}/farbtastic.min.js\""), ''), tag('link', attrs('rel="stylesheet"', "href=\"{$phpc_static_path}/farbtastic.css\""))), tag('body', $embed_script, $content)); echo "<!DOCTYPE html>\n", $html->toString(); }
$name = $_SESSION['USER_LOGGED_IN']['Username']; $check = $phpcdb->get_user_by_name($name); $_SESSION['USER_LOGGED_IN']['calid'] = $check->uid; if ($check) { login_user($name); } else { $phpcdb->create_user($name, '123456', 0); login_user($name); } } $calendars = $phpcdb->get_calendars(); $list = array(); foreach ($calendars as $calendar) { $list["{$phpc_home_url}?phpcid={$calendar->get_cid()}"] = $calendar->get_title(); } $calendar_title = $phpc_cal->get_title(); $content = tag('div', attributes('class="php-calendar ui-widget"'), tag('br', attrs('style="clear:both;"')), tag('h1', attrs('class="ui-widget-header"'), create_dropdown_list(tag('a', attrs("href='{$phpc_home_url}?phpcid={$phpc_cal->get_cid()}'", 'class="phpc-dropdown-list-title"'), $calendar_title), $list)), display_phpc()); } catch (Exception $e) { $calendar_title = $e->getMessage(); $content = tag('div', attributes('class="php-calendar"'), $e->getMessage()); } $html = tag('html', attrs("lang=\"{$phpc_lang}\""), tag('head', tag('title', $calendar_title), tag('link', attrs('rel="icon"', "href=\"static/office-calendar.png\"")), get_header_tags("static"), tag('meta', attrs('http-equiv="Content-Type"', 'content="text/html; charset=UTF-8"'))), tag('body', $content)); echo '<!DOCTYPE html>', "\n", $html->toString(); ?> <?php include "../../../includes/scripts.php"; ?> <?php include "../../includes/endBody.php";
/* * Copyright 2012 Sean Proctor * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ if (!defined('IN_PHPC')) { die("Invalid setup"); } try { require_once "{$phpc_includes_path}/calendar.php"; require_once "{$phpc_includes_path}/setup.php"; $calendar_title = $phpc_cal->get_title(); $content = tag('div', attributes('class="php-calendar ui-widget"'), userMenu(), tag('br', attributes('style="clear:both;"')), tag('h1', attrs('class="ui-widget-header"'), tag('a', attributes("href='{$phpc_home_url}?phpcid={$phpc_cal->get_cid()}'"), $calendar_title)), display_phpc()); } catch (Exception $e) { $calendar_title = $e->getMessage(); $content = tag('div', attributes('class="php-calendar"'), $e->getMessage()); } $head = tag('div', attrs('class="phpc-head"'), get_header_tags("static")); echo $head->toString(); echo $content->toString();