2003-02-27 20:28:25 +01:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
2004-01-27 00:53:02 +01:00
|
|
|
* eGroupWare *
|
|
|
|
* http://www.egroupware.org *
|
2003-09-22 15:57:35 +02:00
|
|
|
* Written by Mark Peters <skeeter@phpgroupware.org> *
|
2003-02-27 20:28:25 +01:00
|
|
|
* -------------------------------------------- *
|
|
|
|
* 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. *
|
|
|
|
\**************************************************************************/
|
|
|
|
/* $Id$ */
|
|
|
|
|
2003-09-22 15:57:35 +02:00
|
|
|
$send_back_to = str_replace('submit','admin',$_SERVER['HTTP_REFERER']);
|
|
|
|
if(!$_POST['locale'])
|
2003-02-27 20:28:25 +01:00
|
|
|
{
|
|
|
|
Header('Location: '.$send_back_to);
|
|
|
|
}
|
|
|
|
|
2003-09-22 15:57:35 +02:00
|
|
|
$send_back_to = str_replace('&locale='.$_POST['locale'],'',$send_back_to);
|
2003-09-22 17:29:41 +02:00
|
|
|
$file = './holidays.'.$_POST['locale'].'.csv';
|
2003-02-27 20:28:25 +01:00
|
|
|
if(!file_exists($file))
|
|
|
|
{
|
2003-09-22 15:57:35 +02:00
|
|
|
if (count($_POST['name']))
|
2003-02-27 20:28:25 +01:00
|
|
|
{
|
2003-09-22 15:57:35 +02:00
|
|
|
$c_holidays = count($_POST['name']);
|
2003-02-27 20:28:25 +01:00
|
|
|
$fp = fopen($file,'w');
|
|
|
|
for($i=0;$i<$c_holidays;$i++)
|
|
|
|
{
|
2003-09-22 15:57:35 +02:00
|
|
|
fwrite($fp,$_POST['locale']."\t".$_POST['name'][$i]."\t".$_POST['day'][$i]."\t".$_POST['month'][$i]."\t".$_POST['occurence'][$i]."\t".$_POST['dow'][$i]."\t".$_POST['observance'][$i]."\n");
|
2003-02-27 20:28:25 +01:00
|
|
|
}
|
|
|
|
fclose($fp);
|
|
|
|
}
|
|
|
|
Header('Location: '.$send_back_to);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
?>
|
2005-07-07 22:09:52 +02:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2003-02-27 20:28:25 +01:00
|
|
|
<html>
|
|
|
|
<head>
|
2003-09-22 16:04:00 +02:00
|
|
|
<title>eGroupWare.org: There is already a holiday-file for '<?php echo $_POST['locale']; ?>' !!!</title>
|
2003-02-27 20:28:25 +01:00
|
|
|
</head>
|
|
|
|
<body>
|
2003-09-22 16:04:00 +02:00
|
|
|
<h1>There is already a holiday-file for '<?php echo $_POST['locale']; ?>' !!!</h1>
|
2003-02-27 20:28:25 +01:00
|
|
|
|
2003-09-22 16:04:00 +02:00
|
|
|
<p>If you think your version of the holidays for '<?php echo $_POST['locale']; ?>' should replace
|
2003-09-22 15:57:35 +02:00
|
|
|
the existing one, please <a href="<?php echo $_SERVER['HTTP_REFERER']; ?>&download=1">download</a> the file
|
|
|
|
and <a href="mailto:egroupware-developers@lists.sourceforge.net">mail it</a> to us.</p>
|
2003-02-27 20:28:25 +01:00
|
|
|
|
2003-09-22 15:57:35 +02:00
|
|
|
<p>To get back to your own eGroupWare-install <a href="<?php echo $send_back_to; ?>">click here</a>.</p>
|
2003-02-27 20:28:25 +01:00
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|