<?php
session_start();
$roles = "";
$count = count($_SESSION['roles']);
for ($i=0; $i<$count; $i++)
{
if ($i!=$count-1)
{
$roles .= $_SESSION['roles'][$i].", ";
}
else
{
$roles .= $_SESSION['roles'][$i];
}
}
$clients = "";
$count = count($_SESSION['clients']);
for ($i=0; $i<$count; $i++)
{
if ($i!=$count-1)
{
$clients .= $_SESSION['clients'][$i].", ";
}
else
{
$clients .= $_SESSION['clients'][$i];
}
}
$systemstring = "";
$count = count($_SESSION['systemfield']);
for ($i=0; $i<$count; $i++)
{
if ($i!=$count-1)
{
$systemstring .= $_SESSION['systemfield'][$i].", ";
}
else
{
$systemstring .= $_SESSION['systemfield'][$i];
}
}
?>
<?php
if (isset($_POST['print']) and $_SESSION['roles']!="")
{
$antrag = file_get_contents('Muster.rtf');
$antrag = str_replace('==Start==', $_SESSION['Start'], $antrag);
$antrag = str_replace('==Ende==', $_SESSION['Ende'], $antrag);
$antrag = str_replace('==Grund==', $_SESSION['Grund'], $antrag);
$antrag = str_replace('==Name==', $_SESSION['name'], $antrag);
$antrag = str_replace('==Vorname==', $_SESSION['vorname'], $antrag);
$antrag = str_replace('==Strasse==', $_SESSION['strasse'], $antrag);
$antrag = str_replace('==PLZ==', $_SESSION['plz'], $antrag);
$antrag = str_replace('==Ort==', $_SESSION['ort'], $antrag);
$antrag = str_replace('==Telefon==', $_SESSION['telefon'], $antrag);
$antrag = str_replace('==Email==', $_SESSION['email'], $antrag);
$antrag = str_replace('==Systemlandschaft==', $_SESSION['sysenvi'], $antrag);
$antrag = str_replace('==Mandanten==', $clients, $antrag);
$antrag = str_replace('==Systeme==', $systemstring, $antrag);
$antrag = str_replace('==Rollen==', $roles, $antrag);
$antrag = str_replace('==Rollen==', $_SESSION['roles'], $antrag);
header('Content-Type: application/rtf');
header('Content-Disposition: attachment; filename="Antrag.doc"');
print $antrag;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//DE" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
<META HTTP-EQUIV="Expires" CONTENT="-1" />
<meta http-equiv="cache-control" content="no-cache" />
<link rel="stylesheet" type="text/css" href="../css/format.css" />
<link rel="stylesheet" type="text/css" href="../css/calendar.css" />
<script src="../javascript/calendar.js" type="text/javascript" language="Javascript"></script>
<script src="../javascript/inputs.js" type="text/javascript" language="Javascript"></script>
<script src="../javascript/general.js" type="text/javascript" language="Javascript"></script>
<script src="../javascript/tooltip.js" type="text/javascript" language="Javascript"></script>
<script src="../javascript/ajax.js" type="text/javascript" language="Javascript"></script>
<?php
if ($_POST['name'] != "")
{
$_SESSION['name'] = $_POST['name'];
$_SESSION['vorname'] = $_POST['vorname'];
$_SESSION['strasse'] = $_POST['strasse'];
$_SESSION['plz'] = $_POST['plz'];
$_SESSION['ort'] = $_POST['ort'];
$_SESSION['telefon'] = $_POST['telefon'];
$_SESSION['email'] = $_POST['email'];
$_SESSION['Start'] = $_POST['Start'];
$_SESSION['Ende'] = $_POST['Ende'];
$_SESSION['Grund'] = $_POST['Grund'];
};
if ($_POST['sysenvi'] != "")
{
$_SESSION['sysenvi'] = $_POST['sysenvi'];
};
if ($_POST['systemfield'] != "")
{
$_SESSION['systemfield'] = $_POST['systemfield'];
};
if ($_POST['clients'] != "")
{
$_SESSION['clients'] = $_POST['clients'];
};
if ($_POST['roles'] != "")
{
$_SESSION['roles'] = $_POST['roles'];
};
if (isset($_POST['backtoroles']))
{
$_SESSION['roles']="";
}
if (isset($_POST['backtoclients']))
{
$_SESSION['roles']="";
$_SESSION['clients']="";
}
if (isset($_POST['backtosystems']))
{
$_SESSION['roles']="";
$_SESSION['clients']="";
$_SESSION['systemfield']="";
}
if (isset($_POST['backtosysenvi']))
{
$_SESSION['roles']="";
$_SESSION['clients']="";
$_SESSION['systemfield']="";
$_SESSION['sysenvi']="";
}
if (isset($_POST['backtouserdata']))
{
$_SESSION['roles']="";
$_SESSION['clients']="";
$_SESSION['systemfield']="";
$_SESSION['sysenvi']="";
$_SESSION['name']="";
}
?>
</head>
<body onload="datewriter();">
<center>
<div class="background">
<br />
<?php
if ($_SESSION['name']=="")
include("userdata.php");
?>
<?php
if ($_SESSION['name']!="" and $_SESSION['sysenvi']=="")
include("systemenvironment.php");
?>
<?php
if ($_SESSION['name']!="" and $_SESSION['sysenvi']!="" and $_SESSION['systemfield']=="")
include("systems.php");
?>
<?php
if ($_SESSION['name']!="" and $_SESSION['sysenvi']!="" and $_SESSION['systemfield']!="" and $_SESSION['clients']=="")
include("clients.php");
?>
<?php
if ($_SESSION['name']!="" and $_SESSION['sysenvi']!="" and $_SESSION['systemfield']!="" and $_SESSION['clients']!="" and $_SESSION['roles']=="")
include("clientroles.php");
?>
<div id="entries" class="choicefield">
<div class="subtitle"> :: Daten </div>
<hr />
<div class="uservalues">
<table>
<tr>
<td style="width:230px">
Name: <?php echo $_SESSION['name']; ?><br />
Vorname: <?php echo $_SESSION['vorname']; ?><br />
</td>
<td style="width:230px">
Straße: <?php echo $_SESSION['strasse']; ?><br />
PLZ/Ort: <?php echo $_SESSION['plz']." ".$_SESSION['ort']; ?><br />
</td>
<td style="width:230px">
Telefon: <?php echo $_SESSION['telefon']; ?><br />
E-Mail: <?php echo $_SESSION['email']; ?><br />
</td>
</tr>
</table>
</div>
<hr />
<div class="uservalues">
<table>
<tr>
<td style="width:230px">
von: <?php echo $_SESSION['Start']; ?>
</td>
<td style="width:230px">
bis: <?php echo $_SESSION['Ende']; ?>
</td>
<td style="width:230px">
Grund: <?php echo $_SESSION['Grund']; ?>
</td>
</tr>
</table>
</div>
<hr />
<div class="uservalues">
<table>
<tr>
<td>
Systemlandschaft: <?php echo $_SESSION['sysenvi']; ?>
</td>
</tr>
</table>
</div>
<hr />
<div class="uservalues">
<table>
<tr>
<td>
Systeme:
<?php
$systemstring = "";
$count = count($_SESSION['systemfield']);
for ($i=0; $i<$count; $i++)
{
if ($i!=$count-1)
{
$systemstring .= $_SESSION['systemfield'][$i].", ";
}
else
{
$systemstring .= $_SESSION['systemfield'][$i];
}
}
echo $systemstring;
?>
</td>
</tr>
<tr>
<td>
Mandanten:
<?php
$clients = "";
$count = count($_SESSION['clients']);
for ($i=0; $i<$count; $i++)
{
if ($i!=$count-1)
{
$clients .= $_SESSION['clients'][$i].", ";
}
else
{
$clients .= $_SESSION['clients'][$i];
}
}
echo $clients;
?>
</td>
</tr>
<tr>
<td>
Rollen:
<?php
$roles = "";
$count = count($_SESSION['roles']);
for ($i=0; $i<$count; $i++)
{
if ($i!=$count-1)
{
$roles .= $_SESSION['roles'][$i].", ";
}
else
{
$roles .= $_SESSION['roles'][$i];
}
}
echo $roles;
?>
</td>
</tr>
</table>
</div>
</div>
<?php
if ($_SESSION['roles']!="")
{
echo"<form method='post'>";
echo"<input type='submit' name='print' value='Antrag ausfüllen und Drucken' /><br />";
echo"<input type='submit' name='backtoroles' value='zurück' />";
echo"</form>";
}
?>
<br /><br />
</div>
</center>
</body>
</html>