section
**********************************************************************/
function printHeader()
{
global $conf;
echo "\n";
echo "\n";
echo "\n";
printf("%s\n",$conf["title"]);
printf("\n",$conf["cssfile"]);
echo "\n";
printf("\n",$conf["jsfile"]);
echo "\n";
echo "\n";
}
/**********************************************************************
* printFooter()
*
* Prints a page footer and the final html tags
*
* $text: the text displayed in the footer
* $firefox: flag, indicating whether the "Get Firefox", "Valid HTML",
* and "Valid CSS" logos are displayed
*
* Change config.php to set a costum footer!
**********************************************************************/
function printFooter($text,$firefox)
{
echo "
\n";
}
/**********************************************************************
* dbConnect()
*
* Connects to the MySQL database
**********************************************************************/
function dbConnect()
{
global $conf;
global $lang;
$link = mysql_connect($conf["hostname"],$conf["user"],$conf["passwd"]) or die($lang["noconnection"] . mysql_error());
mysql_select_db($conf["database"]) or die($lang["selectingfailed"]);
}
/**********************************************************************
* isLeapYear()
*
* Computes, whether $year is a leap year
**********************************************************************/
function isLeapYear($year)
{
if ($year % 4 == 0) {
if ( $jahr % 100 == 0 )
return ($jahr % 400 == 0);
return true;
}
return false;
}
/**********************************************************************
* daysOfYear()
*
* Computes the number of days of $year
**********************************************************************/
function daysOfYear($year)
{
if (isLeapYear($year))
return 366;
else
return 365;
}
/**********************************************************************
* printConfInfoBox()
*
* Generates the info box. The box is initially hidden and activated by
* JavaScript.
**********************************************************************/
function printConfInfoBox()
{
global $dim;
$box = $dim["infopos"];
echo "\n";
}
/**********************************************************************
* confBox()
*
* Prints a single bar in the calendar.
* $firstday: first day of the bar
* $lastday: last day of the bar
* $year: the year
* $offset: margin on the left side
**********************************************************************/
function confBox($firstday,$lastday,$year,$offset)
{
global $MSIE;
global $dim;
$d1 = ($firstday["year"]==$year)? $firstday["yday"] : 0;
$d2 = ($lastday["year"]==$year)? $lastday["yday"] : daysofyear($year);
$x = ($d1*$dim["ppd"])+$offset;
$w = (($d2-$d1+1)*$dim["ppd"]);
if (!$MSIE) $x--;
if (!$MSIE) $w--;
return array($x,$w);
}
/**********************************************************************
* daysOfYear()
*
* Computes the number of days of $year
**********************************************************************/
function printConfBar($class,$x,$w)
{
# printf("%s\n",indent(),$class,$x,$y,$w-1);
printf("%s\n",indent(),$class,$x,$w-1);
}
/**********************************************************************
* formatDate($d)
*
* Converts a date $d which is formatted as MySQL date string, as a
* string formatted according to the specification in config.php.
* Returns "?" if there is no date given.
**********************************************************************/
function formatDate($d)
{
global $lang;
if (trim($d) != "")
return strftime($lang["dateformat"],strtotime($d));
else
return "?";
}
/**********************************************************************
* printConfRow($i,$y,$line,$year)
*
* Prints a row of the calendar, including first column,
* meta-information for JavaScript, and the bars.
**********************************************************************/
function printConfRow($i,$y,$line,$year)
{
global $dim;
global $lang;
$rowid = "r" . $year . $i;
$text = "" . htmlentities($line["shortname"],ENT_QUOTES)." " .
htmlentities($line["place"],ENT_QUOTES) . " " .
$lang["info_deadline"] . formatDate($line["deadline"]) . " ".
$lang["info_notification"] . formatDate($line["notification"]) . " " .
$lang["info_final"] . formatDate($line["final"]) . " " .
$lang["info_conf"] . formatDate($line["confstart"]) . " - " . formatDate($line["confend"]);
$highlightstring = " onMouseOver=\"highlightItem(event,'$rowid',true,'$text')\"".
" onMouseOut=\"highlightItem(event,'$rowid',false,'')\"";
$infoboxstring = " onMouseDown=\"showInfoBox(true)\" onMouseUp=\"showInfoBox(false)\" onMouseMove=\"moveInfoBox(event)\"";
printf("%s\n",
indent(),$y-2,$highlightstring,$infoboxstring);
printf("%s
\n",indent(),$rowid,$y);
// intended HTML output
incIndent();
// convert dates
$d_deadl = getdate(strtotime($line["deadline"]));
$d_deadlprv = getdate(strtotime("-2 day",strtotime($line["deadline"])));
$d_deadlnxt = getdate(strtotime("+1 day",strtotime($line["deadline"])));
$d_notif = getdate(strtotime($line["notification"]));
$d_notifnxt = getdate(strtotime("+1 day",strtotime($line["notification"])));
$d_final = getdate(strtotime($line["final"]));
$d_start = getdate(strtotime($line["confstart"]));
$d_end = getdate(strtotime($line["confend"]));
// deadline bar
if ($d_deadl["year"]==$year) {
$box = confBox($d_deadlprv,$d_deadl,$year,$dim["firstcolsize"]);
printConfBar("dlbar",$box[0],$box[1]);
}
// notification bar
if ($line["deadline"]!= "" && $line["notification"]!="" && ($d_deadlnxt["year"]==$year || $d_notif["year"]==$year)) {
$box = confBox($d_deadlnxt,$d_notif,$year,$dim["firstcolsize"]);
printConfBar("reviewbar",$box[0],$box[1]);
}
// final version bar
if ($line["notification"]!="" && $line["final"]!="" && ($d_notifnxt["year"]==$year || $d_final["year"]==$year)) {
$box = confBox($d_notifnxt,$d_final,$year,$dim["firstcolsize"]);
printConfBar("finalbar",$box[0],$box[1]);
}
// conference bar
if ($line["confstart"]!="" && $line["confend"]!="" && ($d_start["year"]==$year || $d_start["year"]==$year)) {
$box = confBox($d_start,$d_end,$year,$dim["firstcolsize"]);
printConfBar("confbar",$box[0],$box[1]);
}
// intended HTML output
decIndent();
printf("%s
\n",indent());
}
/**********************************************************************
* printLegend()
*
* Prints a little legend for the different types of bars
**********************************************************************/
function printLegend()
{
echo "
";
echo "Deadline ";
echo "Review process ";
echo "Final Version ";
echo "Conference ";
echo "
";
}
/**********************************************************************
* printMonthRow($year)
*
* Prints a headline with the month names
**********************************************************************/
function printMonthRow($year)
{
global $dim;
global $lang;
printf("%s
\n",indent());
printf("%s\n",indent(),$totalvsize + 45);
}
/**********************************************************************
* printUpcoming
*
* Prints a section with a deadline prediction of conferences
**********************************************************************/
function printUpcoming($preview,$group)
{
global $lang;
echo "
\n";
$query = "SELECT conf_instance.series,MAX(deadline) AS lastdl FROM conf_instance,conf_group_of_series WHERE conf_group_of_series.cgroup = $group AND conf_group_of_series.series = conf_instance.series GROUP BY series;";
$result = mysql_query($query) or die($lang["queryfailed"] . mysql_error());
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$query = "SELECT * FROM conf_series,conf_group_of_series WHERE conf_group_of_series.cgroup = $group AND id = " . $line["series"] . ";";
$r = mysql_query($query) or die($lang["queryfailed"] . mysql_error());
$l = mysql_fetch_array($r, MYSQL_ASSOC);
$exp = getdate(strtotime($line["lastdl"] . "+" . $l["est_period"] . " month"));
$warn = $l["est_period"] - $preview;
if (strtotime($line["lastdl"] . "+" . $warn . " month") < time()) {
echo "
\n",$lang["previewinfo"]);
}
/**********************************************************************
* printConfigArea()
*
* Prints switches to chance the display options of the calendar
**********************************************************************/
function printConfigArea()
{
global $show;
echo "
\n";
}
/**********************************************************************
* main()
*
* Main function
**********************************************************************/
function main()
{
global $conf;
global $lang;
printHeader();
printf("