4 |
andreas |
1 |
<?php
|
|
|
2 |
/*
|
|
|
3 |
Copyright (C) 2003-2004 MJG/04-Inconceivable.org
|
|
|
4 |
See file LICENSE for licensing details.
|
|
|
5 |
See file VERSION for versioning/author/source details
|
|
|
6 |
See file CHANGELOG for changes from version to version
|
|
|
7 |
*/
|
|
|
8 |
|
|
|
9 |
/* Configuration Notes
|
|
|
10 |
===================
|
|
|
11 |
- Comments leading with a '(*)' are for internal use only.
|
|
|
12 |
Do not change.
|
|
|
13 |
*/
|
|
|
14 |
|
|
|
15 |
// Before we do anything, set what errors to report
|
|
|
16 |
error_reporting (E_ALL ^ E_NOTICE);
|
|
|
17 |
|
|
|
18 |
// Init var/arrays
|
|
|
19 |
$CONF = array(); // (*) Hold configuration info
|
|
|
20 |
$E = array(); // (*) Hold error info
|
|
|
21 |
$TODAY = array(); // (*) Hold today's events data
|
|
|
22 |
$EVENT = array(); // (*) Hold event data
|
|
|
23 |
|
|
|
24 |
// Setup $CONF
|
|
|
25 |
// + Appt! specific
|
|
|
26 |
$CONF['__version'] = "1.35"; // (*) Appt! version
|
|
|
27 |
// + Database
|
|
|
28 |
$CONF['dbConn'] = ""; // (*) Database connection resource
|
|
|
29 |
$CONF['dbDB'] = ""; // Database name
|
|
|
30 |
$CONF['dbHost'] = "localhost"; // Database host
|
|
|
31 |
$CONF['dbUser'] = ""; // Database user
|
|
|
32 |
$CONF['dbPass'] = ""; // Database user's password
|
|
|
33 |
$CONF['tbl_cal'] = "calendar"; // Table for events
|
|
|
34 |
// + Paths, URLs, files
|
|
|
35 |
$CONF['path_base'] = "/home/andreas/public_html/pm"; // Absolute path to base directory
|
|
|
36 |
$CONF['path_site'] = $CONF['path_base'] . "/site"; // Absolute path to /site directory
|
|
|
37 |
$CONF['path_include'] = $CONF['path_site'] . "/include"; // Absolute path to /site/include directory
|
|
|
38 |
$CONF['path_lib'] = $CONF['path_site'] . "/lib"; // Absolute path to /site/lib directory
|
|
|
39 |
// $CONF['url_base'] = "http://62.178.157.104:1081/~andreas/pm/"; // Absolute URL to Appt!'s location
|
|
|
40 |
$CONF['url_base'] = "."; // Absolute URL to Appt!'s location
|
|
|
41 |
$CONF['url_site'] = $CONF['url_base'] . "/site"; // Absolute or relative URL to /site directory
|
|
|
42 |
$CONF['url_images'] = $CONF['url_site'] . "/images"; // Absolute or relative url to /site/images directory
|
|
|
43 |
$CONF['url_include'] = $CONF['url_site'] . "/include"; // Absolute or relative url to /site/include directory
|
|
|
44 |
$CONF['url_admin'] = "admin"; // Relative url to admin directory
|
|
|
45 |
// + Schedule Administration
|
|
|
46 |
$CONF['adm_user'] = "admin"; // Username to allow into Schedule Administration
|
|
|
47 |
$CONF['adm_pass'] = ""; // Username's password
|
|
|
48 |
$CONF['adm_authed'] = 0; // (*) 0 - not authenticated, 1 - is authenticationed
|
|
|
49 |
$CONF['adm_authed_timeout'] = 900; // Number of seconds until authenticationtimes out
|
|
|
50 |
|
|
|
51 |
// Initialization Procedures
|
|
|
52 |
// Put all form input into a single array
|
|
|
53 |
foreach ( $_GET as $k=>$v )
|
|
|
54 |
{
|
|
|
55 |
if ( !empty($v) && !isset($FORM[$k]) ) $FORM[$k] = $v;
|
|
|
56 |
// echo "<!-- $k = $v -->";
|
|
|
57 |
}
|
|
|
58 |
foreach ( $_POST as $k=>$v )
|
|
|
59 |
{
|
|
|
60 |
if ( !empty($v) && !isset($FORM[$k]) ) $FORM[$k] = $v;
|
|
|
61 |
// echo "<!-- $k = $v -->";
|
|
|
62 |
}
|
|
|
63 |
// + Set year/month/today to defaults if not set
|
|
|
64 |
if ( !isset($FORM['year']) && !isset($FORM['month']) && !isset($FORM['today']) )
|
|
|
65 |
{
|
|
|
66 |
$FORM['year'] = date("Y", time());
|
|
|
67 |
$FORM['month'] = date("n", time());
|
|
|
68 |
$FORM['today'] = date("j", time());
|
|
|
69 |
|
|
|
70 |
}
|
|
|
71 |
// + Setup $year/$month/$today compatibility vars
|
|
|
72 |
$year = $FORM['year'];
|
|
|
73 |
$month = $FORM['month'];
|
|
|
74 |
$today = $FORM['today'];
|
|
|
75 |
$id = $_REQUEST['id'];
|
|
|
76 |
$header = $_REQUEST['header'];
|
|
|
77 |
$del = $_REQUEST['del'];
|
|
|
78 |
// + Date manipulation always done
|
|
|
79 |
$daylong = date("l",mktime(1,1,1,$month,$today,$year));
|
|
|
80 |
$monthlong = date("F",mktime(1,1,1,$month,$today,$year));
|
|
|
81 |
$dayone = date("w",mktime(1,1,1,$month,1,$year));
|
|
|
82 |
$numdays = date("t",mktime(1,1,1,$month,1,$year));
|
|
|
83 |
$alldays = array('Son','Mon','Die','Mit','Don','Fre','Sam');
|
|
|
84 |
$next_year = $year + 1;
|
|
|
85 |
$last_year = $year - 1;
|
|
|
86 |
if ($today > $numdays) { $today--; }
|
|
|
87 |
?>
|