alte unbenoetigte datei entfernt
git-svn-id: svn://svn.cccv.de/engel-system@12 29ba0400-6e00-0410-a75a-ca02368028f8
This commit is contained in:
parent
95fb776263
commit
65214f378f
|
@ -1,380 +0,0 @@
|
||||||
<?php
|
|
||||||
$title = "Schichtplan";
|
|
||||||
$header = "Neue Schichten erfassen";
|
|
||||||
$submenus = 1;
|
|
||||||
include ("./inc/header.php");
|
|
||||||
include ("./inc/funktion_user.php");
|
|
||||||
|
|
||||||
if (!IsSet($action)) {
|
|
||||||
echo "Hallo ".$_SESSION['Nick'].",<br>\n";
|
|
||||||
echo "hier kannst du Schichten anlegen, ändern oder löschen.<br><br>";
|
|
||||||
echo "<a href=\"./schichtplan.php?action=new\">Neue Schicht einplanen</a><br><br>\n\n";
|
|
||||||
?>
|
|
||||||
<table width="100%" class="border" cellpadding="2" cellspacing="1">
|
|
||||||
<tr class="contenttopic">
|
|
||||||
<td>Datum</td>
|
|
||||||
<td>Raum</td>
|
|
||||||
<td>Dauer</td>
|
|
||||||
<td>Beschreibung</td>
|
|
||||||
<td>Ändern</td>
|
|
||||||
</tr>
|
|
||||||
<?
|
|
||||||
$sql = "Select * from Schichtplan ORDER BY RID, Date";
|
|
||||||
$Erg = mysql_query($sql, $con);
|
|
||||||
$rowcount = mysql_num_rows($Erg);
|
|
||||||
for ($i=0; $i<$rowcount; $i++){
|
|
||||||
echo "\t<tr class=\"content\">\n";
|
|
||||||
echo "\t\t<td>".mysql_result($Erg, $i, "Date")."</td>\n";
|
|
||||||
$sql2= "Select * from Raeume where RID=\"".mysql_result($Erg, $i, "RID")."\"";
|
|
||||||
$Erg2 = mysql_query($sql2, $con);
|
|
||||||
|
|
||||||
echo "\t\t<td>".mysql_result($Erg2, 0, "Name")."</td>\n";
|
|
||||||
|
|
||||||
echo "\t\t<td>".mysql_result($Erg, $i, "Dauer")." Std. </td>\n";
|
|
||||||
echo "\t\t<td>".mysql_result($Erg, $i, "Name")."</td>\n";
|
|
||||||
echo "\t\t<td><a href=\"./schichtplan.php?action=change&SID=".mysql_result($Erg, $i, "SID")."\">XXX</a></td>\n";
|
|
||||||
echo "\t</tr>\n";
|
|
||||||
}
|
|
||||||
echo "</table>";
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
switch ($action){
|
|
||||||
|
|
||||||
case 'new':
|
|
||||||
?>
|
|
||||||
Hier kannst du neue Schichten eintragen. Dazu musst du den Anfang und das Ende der Schichten eintragen.
|
|
||||||
Über die Länge der Schichten errechnet sich dadurch die Anzahl dieser. Dadurch können gleich
|
|
||||||
mehrere Schichten auf einmal erfasst werden:
|
|
||||||
|
|
||||||
<? /* <form action="<? echo basename (getenv ("PATH_INFO")) ; ?>" method="post"> */ ?>
|
|
||||||
<form action="<? echo $_SERVER['SCRIPT_NAME']; ?>" >
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td align="right">Name:</td>
|
|
||||||
<td><input type="text" name="SchichtName" size="50" value="Engel Schicht X"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">Month.Jahr:</td>
|
|
||||||
<td><input type="ext" name="MonthJahr" size="7" value="2003-12"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">Beginn:</td>
|
|
||||||
<td>Date<input type="text" name="SDatum" size="5" value="27">
|
|
||||||
Time<input type="text" name="STime" size="5" value="10"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">More then One</td>
|
|
||||||
<td><input type="checkbox" name="MoreThenOne" value="ON" checked></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">End:</td>
|
|
||||||
<td>Date<input type="text" name="EDatum" size="5" value="29">
|
|
||||||
Time<input type="text" name="ETime" size="5" value="12"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">Länge in h:</td>
|
|
||||||
<td><input type="text" name="len" size="5" value="2"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">Ort:</td>
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<select name="RID">
|
|
||||||
<?
|
|
||||||
$sql = "select * from Raeume";
|
|
||||||
$Erg = mysql_query($sql, $con);
|
|
||||||
|
|
||||||
$rowcount = mysql_num_rows($Erg);
|
|
||||||
|
|
||||||
for ($i=0; $i<$rowcount; $i++) {
|
|
||||||
echo " <option value=\"".mysql_result($Erg, $i, "RID")."\">";
|
|
||||||
echo mysql_result($Erg, $i, "Name")."</option>\n";
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">Nacht-Sonderschichten ein:</td>
|
|
||||||
<td><input type="checkbox" name="NachtON" value="ON"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">Länge bei Nacht in h (Time;Time):</td>
|
|
||||||
<td><input type="text" name="len_night" size="50" value="0;4;8;10;12;14;16;18;20;22;24"></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<br>
|
|
||||||
<input type="hidden" name="OnlyShow" value="ON">
|
|
||||||
<input type="hidden" name="action" value="newsave">
|
|
||||||
<input type="submit" value="zeig mal Gabriel!">
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<?
|
|
||||||
break; // Ende new
|
|
||||||
|
|
||||||
case 'newsave':
|
|
||||||
if (isset($SDatum) && ($len > 0)) {
|
|
||||||
$lenOrg = $len;
|
|
||||||
if( $NachtON == "ON" )
|
|
||||||
{
|
|
||||||
$lenPos = 0;
|
|
||||||
$lenArrayDummy = explode( ";", $len_night);
|
|
||||||
$i = -1;
|
|
||||||
foreach ( $lenArrayDummy as $Temp )
|
|
||||||
{
|
|
||||||
$i++;
|
|
||||||
if( $i == 0 )
|
|
||||||
$lenArray[$i] = $Temp;
|
|
||||||
else
|
|
||||||
$lenArray[$i] = $Temp- $lenArrayDummy[$i-1];
|
|
||||||
|
|
||||||
if( $Temp==$STime )
|
|
||||||
$lenPos = $i;
|
|
||||||
}//foreach
|
|
||||||
$lenPosMax = $i;
|
|
||||||
}//IF( $NachtON == "ON" )
|
|
||||||
|
|
||||||
echo "<table border=\"1\">\n";
|
|
||||||
echo "<tr>\n";
|
|
||||||
echo "\t<td valign=\"top\" align=\"center\">Start</td>\n";
|
|
||||||
echo "\t<td valign=\"top\" align=\"center\">End</td>\n";
|
|
||||||
echo "\t<td valign=\"top\" align=\"center\">RID</td>\n";
|
|
||||||
echo "\t<td valign=\"top\" align=\"center\">len</td>\n";
|
|
||||||
echo "\t<td valign=\"top\" align=\"center\">Beschreibung</td>\n";
|
|
||||||
echo "\t<td valign=\"top\" align=\"center\">OK?</td>\n";
|
|
||||||
echo "</tr>\n";
|
|
||||||
|
|
||||||
$DateEnd = $SDatum;
|
|
||||||
$TimeEnd = $STime;
|
|
||||||
do {
|
|
||||||
// define Start time
|
|
||||||
$Date = $DateEnd;
|
|
||||||
$Time = $TimeEnd;
|
|
||||||
$_DateS = $MonthJahr. "-". $Date. " ". $Time. ":00:00";
|
|
||||||
|
|
||||||
// define End time
|
|
||||||
if( $NachtON == "ON" )
|
|
||||||
{
|
|
||||||
$len = $lenArray[$lenPos++];
|
|
||||||
if( $lenPos == $lenPosMax )
|
|
||||||
$lenPos = 0;
|
|
||||||
}
|
|
||||||
$TimeEnd = $Time+ $len;
|
|
||||||
|
|
||||||
//Tagesüberschreitung
|
|
||||||
while( $TimeEnd >= 24 )
|
|
||||||
{
|
|
||||||
$TimeEnd -= 24;
|
|
||||||
$DateEnd += 1;
|
|
||||||
}
|
|
||||||
//ist schischt zu lang dan verkürzen
|
|
||||||
if( $DateEnd > $EDatum || ($DateEnd == $EDatum && $TimeEnd >= $ETime) )
|
|
||||||
{
|
|
||||||
$len -= ($DateEnd- $EDatum)*24;
|
|
||||||
$len -= ($TimeEnd- $ETime); // -(-) ->> +
|
|
||||||
$DateEnd = $EDatum;
|
|
||||||
$TimeEnd = $ETime;
|
|
||||||
}
|
|
||||||
$_DateE = $MonthJahr. "-". $DateEnd. " ". $TimeEnd. ":00:00";
|
|
||||||
|
|
||||||
if( $_DateS != $_DateE )
|
|
||||||
CreateNewEntry();
|
|
||||||
|
|
||||||
if( $MoreThenOne!="ON" ) break;
|
|
||||||
if( $DateEnd == $EDatum && $TimeEnd >= $ETime ) break;
|
|
||||||
} while( true );
|
|
||||||
echo "</table>";
|
|
||||||
|
|
||||||
if( $OnlyShow!="" )
|
|
||||||
{
|
|
||||||
echo "<form action=\"". $_SERVER['SCRIPT_NAME']. "\">";
|
|
||||||
echo "\n\t<Input type=\"hidden\" name=\"SchichtName\" value=\"$SchichtName\">";
|
|
||||||
echo "\n\t<input type=\"hidden\" name=\"MonthJahr\" value=\"$MonthJahr\">";
|
|
||||||
echo "\n\t<input type=\"hidden\" name=\"SDatum\" value=\"$SDatum\">";
|
|
||||||
echo "\n\t<input type=\"hidden\" name=\"STime\" value=\"$STime\">";
|
|
||||||
echo "\n\t<input type=\"hidden\" name=\"MoreThenOne\" value=\"$MoreThenOne\">";
|
|
||||||
echo "\n\t<input type=\"hidden\" name=\"EDatum\" value=\"$EDatum\">";
|
|
||||||
echo "\n\t<input type=\"hidden\" name=\"ETime\" value=\"$ETime\">";
|
|
||||||
echo "\n\t<input type=\"hidden\" name=\"len\" value=\"$lenOrg\">";
|
|
||||||
echo "\n\t<input type=\"hidden\" name=\"RID\" value=\"$RID\">";
|
|
||||||
echo "\n\t<input type=\"hidden\" name=\"NachtON\" value=\"$NachtON\">";
|
|
||||||
echo "\n\t<input type=\"hidden\" name=\"len_night\" value=\"$len_night\">";
|
|
||||||
echo "\n\t<input type=\"hidden\" name=\"OnlyShow\" value=\"\">";
|
|
||||||
|
|
||||||
echo "\n\t<input type=\"hidden\" name=\"action\" value=\"newsave\">";
|
|
||||||
echo "\n\t<input type=\"submit\" value=\"mach mal Gabriel!\">";
|
|
||||||
echo "\n</form>";
|
|
||||||
} //if
|
|
||||||
} //IF
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
case 'change':
|
|
||||||
if (! IsSet($SID)){
|
|
||||||
echo "Fehlerhafter Aufruf!";
|
|
||||||
} else {
|
|
||||||
$sql = "select * from Schichtplan where (SID = $SID)";
|
|
||||||
$Erg = mysql_query($sql, $con);
|
|
||||||
|
|
||||||
echo "Schicht abändern: <br>\n";
|
|
||||||
echo "<form action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"POST\" >";
|
|
||||||
//echo "<form action=\"./schichtplan.php\" method=\"POST\">\n";
|
|
||||||
echo "<table>\n";
|
|
||||||
echo " <tr><td>Schichtbeginn</td><td><input value=\"".mysql_result($Erg, 0, "Date")."\" type=\"text\" size=\"40\" name=\"eDate\"></td></tr>\n";
|
|
||||||
echo " <tr><td>Raum</td><td>\n";
|
|
||||||
echo " <select name=\"eRID\">\n";
|
|
||||||
|
|
||||||
$sql2 = "select * from Raeume";
|
|
||||||
$Erg2 = mysql_query($sql2, $con);
|
|
||||||
$rowcount = mysql_num_rows($Erg2);
|
|
||||||
for ($i=0; $i<$rowcount; $i++){
|
|
||||||
$RID=mysql_result($Erg2, $i, "RID");
|
|
||||||
echo " <option value=\"".$RID."\"";
|
|
||||||
if ($RID == mysql_result($Erg, 0, "RID")) {
|
|
||||||
echo " selected";
|
|
||||||
}
|
|
||||||
echo ">".mysql_result($Erg2, $i, "Name")."</option>\n";
|
|
||||||
}
|
|
||||||
echo " </select>\n";
|
|
||||||
// <input value=\"".mysql_result($Erg, 0, "RID")."\" type=\"text\" size=\"40\" name=\"eRID\">
|
|
||||||
echo " </td></tr>\n";
|
|
||||||
echo " <tr><td>Dauer in h</td><td><input value=\"".mysql_result($Erg, 0, "Dauer")."\" type=\"text\" size=\"40\" name=\"eDauer\"></td></tr>\n";
|
|
||||||
echo " <tr><td>Beschreibung</td><td><input value=\"".mysql_result($Erg, 0, "Name")."\" type=\"text\" size=\"40\" name=\"eName\"></td></tr>\n";
|
|
||||||
echo "</table>\n";
|
|
||||||
echo "<input type=\"hidden\" name=\"SID\" value=\"$SID\">\n";
|
|
||||||
echo "<input type=\"hidden\" name=\"action\" value=\"changesave\">\n";
|
|
||||||
echo "<input type=\"submit\" value=\"sichern...\">\n";
|
|
||||||
echo "</form>";
|
|
||||||
echo "<form action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"POST\" >\n";
|
|
||||||
//echo "<form action=\"./schichtplan.php\" method=\"POST\">\n";
|
|
||||||
echo "<input type=\"hidden\" name=\"SID\" value=\"$SID\">\n";
|
|
||||||
echo "<input type=\"hidden\" name=\"action\" value=\"delete\">\n";
|
|
||||||
echo "<input type=\"submit\" value=\"Löschen...\">";
|
|
||||||
echo "</form>";
|
|
||||||
|
|
||||||
$sql3 = "select * from Schichtbelegung where SID=$SID";
|
|
||||||
$Erg3 = mysql_query($sql3, $con);
|
|
||||||
$rowcount = mysql_num_rows($Erg3);
|
|
||||||
if ($rowcount > 0) {
|
|
||||||
echo "<b>ACHTUNG:</b> Es haben sich bereits Engel für diese Schicht eingetragen!<br>\n";
|
|
||||||
echo "Beim Löschen werden die bisher eingetragenen Engel für diese Schicht mitgelöscht.<br>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($rowcount > 0) {
|
|
||||||
echo "<hr>";
|
|
||||||
echo "Ausserdem kannst du hier Engel aus der Schicht austragen, wenn diese nicht zu Schicht erschienen sind:<br>";
|
|
||||||
for ($j=0; $j < $rowcount; $j++) {
|
|
||||||
$userUID=mysql_result($Erg3, $j, "UID");
|
|
||||||
echo "<a href=\"./schichtplan.php?action=engeldel&SID=$SID&eUID=$userUID\">".UID2Nick($userUID)." austragen</a><br>";
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo "<hr>";
|
|
||||||
echo "Hat ein anderer Engel die Schicht übernommen, trage ihn hier bitte ein:";
|
|
||||||
echo "<form action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"POST\" >\n";
|
|
||||||
echo "<input type=\"hidden\" name=\"SID\" value=\"$SID\">\n";
|
|
||||||
echo "<input type=\"hidden\" name=\"action\" value=\"engeladd\">\n";
|
|
||||||
echo "<select name=\"eUID\">\n";
|
|
||||||
$usql="select * from User order by Nick";
|
|
||||||
$uErg = mysql_query($usql, $con);
|
|
||||||
$urowcount = mysql_num_rows($uErg);
|
|
||||||
for ($k=0; $k<$urowcount; $k++){
|
|
||||||
echo "\t<option value=\"".mysql_result($uErg, $k, "UID")."\">".mysql_result($uErg, $k, "Nick")."</option>\n";
|
|
||||||
}
|
|
||||||
echo "</select>\n";
|
|
||||||
echo " als \n";
|
|
||||||
echo "<select name=\"Art\">\n";
|
|
||||||
$SQL2 = "SELECT * FROM `Raeume` WHERE ";
|
|
||||||
$SQL2.= "(RID = '".mysql_result($Erg,0,"RID")."')";
|
|
||||||
$Erg2 = mysql_query($SQL2, $con);
|
|
||||||
for ($l = 2; $l < mysql_num_fields($Erg2); $l++) {
|
|
||||||
if (mysql_result($Erg2, 0, $l) > 0)
|
|
||||||
echo "<option value=$l>".mysql_field_name($Erg2,$l)."engel".
|
|
||||||
"</option>\n";
|
|
||||||
}
|
|
||||||
echo "</select>\n";
|
|
||||||
echo "<input type=\"submit\" value=\"eintragen...\">\n";
|
|
||||||
echo "</form>";
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'engeladd':
|
|
||||||
$chSQL="insert into Schichtbelegung values ('$SID', '$eUID', 'Schicht eingetragen durch Erzengel ".$_SESSION['Nick']."', '$Art')";
|
|
||||||
echo "Es wird folgende Schicht zusätzlich eingetragen:<br>\n";
|
|
||||||
echo "Engel: ".UID2Nick($eUID)."<br>\n";
|
|
||||||
echo "Bemerkung: Schicht eingetragen durch Erzengel ".$_SESSION['Nick']."<br>\n";
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'engeldel':
|
|
||||||
$chSQL="delete from Schichtbelegung where SID='$SID' and UID='$eUID' LIMIT 1";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'changesave':
|
|
||||||
$chSQL="update Schichtplan set Date = '$eDate', RID = '$eRID', Dauer='$eDauer', Name='$eName', ";
|
|
||||||
$query = mysql_query("SELECT DATE_ADD('".$eDate."', INTERVAL '+0 ".$eDauer."' DAY_HOUR)", $con);
|
|
||||||
$enddate = mysql_fetch_row($query);
|
|
||||||
$chSQL .= " EndDate = '".$enddate[0]."' where SID=$SID";
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
$chSQL="delete from Schichtplan where SID=$SID limit 1";
|
|
||||||
$ch2SQL="delete from Schichtbelegung where SID=$SID";
|
|
||||||
break;
|
|
||||||
|
|
||||||
} // end switch
|
|
||||||
|
|
||||||
// Update ???
|
|
||||||
|
|
||||||
if (IsSet($chSQL)){
|
|
||||||
// echo $chSQL;
|
|
||||||
// hier muesste das SQL ausgefuehrt werden...
|
|
||||||
$Erg = mysql_query($chSQL, $con);
|
|
||||||
if ($Erg == 1) {
|
|
||||||
echo "Änderung wurde gesichert...";
|
|
||||||
if (IsSet($ch2SQL)){
|
|
||||||
$Erg = mysql_query($ch2SQL, $con);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
echo "Fehler beim speichern... bitte noch ein mal probieren :)";
|
|
||||||
}
|
|
||||||
} // Ende Update
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function CreateNewEntry() {
|
|
||||||
global $con, $_DateS, $_DateE, $RID, $len, $SchichtName, $OnlyShow, $DEBUG;
|
|
||||||
|
|
||||||
echo "<tr>\n";
|
|
||||||
|
|
||||||
echo "\t<td>$_DateS</td>\n";
|
|
||||||
echo "\t<td>$_DateE</td>\n";
|
|
||||||
echo "\t<td>$RID</td>\n";
|
|
||||||
echo "\t<td>$len</td\n>";
|
|
||||||
echo "\t<td>$SchichtName</td>\n";
|
|
||||||
|
|
||||||
if( $OnlyShow == "" )
|
|
||||||
{
|
|
||||||
$SQL = "INSERT INTO `Schichtplan` (`Date`, `EndDate`, `RID`, `Dauer`, `Name`) VALUES (";
|
|
||||||
$SQL .= "'". $_DateS. "', '". $_DateE. "', ";
|
|
||||||
$SQL .= "'". $RID. "', '". $len. "', ";
|
|
||||||
$SQL .= "'". $SchichtName. "');";
|
|
||||||
$Erg = mysql_query($SQL, $con);
|
|
||||||
|
|
||||||
if( $DEBUG ) $SQLFail = "\n\t<br>[".$SQL. "]";
|
|
||||||
|
|
||||||
if ($Erg == 1) echo "\t<td>pass</td>\n";
|
|
||||||
else echo "\t<td>fail <br>\n<u>". mysql_error($con). "</u>$SQLFail</td>\n";
|
|
||||||
|
|
||||||
} else
|
|
||||||
echo "\t<td>only show</td>\n";
|
|
||||||
|
|
||||||
echo "</tr>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
include ("./inc/footer.php");
|
|
||||||
?>
|
|
|
@ -1,153 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
function Ausgabe_Feld_Inhalt($RID, $SID) {
|
|
||||||
// gibt, nach übergabe der der SchichtID (SID) und der RaumID (RID),
|
|
||||||
// die eingetragenden und und offenden Schichteintäge zurück
|
|
||||||
global $con;
|
|
||||||
include ("./inc/config.php");
|
|
||||||
//echo "####################", $Erg, "####################<br>";
|
|
||||||
|
|
||||||
$SQL2 = "SELECT * FROM `Raeume` WHERE ";
|
|
||||||
$SQL2.= "(RID = '".$RID."')";
|
|
||||||
$Erg2 = mysql_query($SQL2, $con);
|
|
||||||
|
|
||||||
|
|
||||||
if( $_SESSION['UID'] == 1 )
|
|
||||||
{}
|
|
||||||
$Temp = mysql_result( mysql_query("SELECT Name FROM `Schichtplan` WHERE (SID='$SID')", $con ), 0, "Name");
|
|
||||||
if( ($Temp-1)!=-1 )
|
|
||||||
$Spalten.="<a href=\"". $CCC_Start. $Temp. $CCC_End. "\" target=\"_black\">$Temp:</a><br>";
|
|
||||||
else
|
|
||||||
$Spalten.="<u>".$Temp.":</u><br>";
|
|
||||||
|
|
||||||
for ($Uj = 2; $Uj < mysql_num_fields($Erg2); $Uj++) {
|
|
||||||
if (mysql_result($Erg2, 0, $Uj)) {
|
|
||||||
$Spalten.= "\n\t\t\t ".mysql_field_name($Erg2,
|
|
||||||
$Uj).Get_Text("inc_schicht_engel"). " ";//.":<br> ";
|
|
||||||
|
|
||||||
$SQL3 = "SELECT * FROM `Schichtbelegung` WHERE ";
|
|
||||||
$SQL3.= "((SID = '".$SID."') AND";
|
|
||||||
$SQL3.= " (Art = '".$Uj."'))";
|
|
||||||
$Erg3 = mysql_query($SQL3, $con);
|
|
||||||
|
|
||||||
// Ausgabe bisherige Engel fuer die Schicht
|
|
||||||
for ($Ui = 0; $Ui < mysql_num_rows($Erg3); $Ui++)
|
|
||||||
{
|
|
||||||
if ($Ui!=0)
|
|
||||||
{
|
|
||||||
if ( substr($Spalten, strlen($Spalten)-4, 4 ) == "<br>" )
|
|
||||||
$Spalten = substr($Spalten, 0, strlen($Spalten)-4).",<br> ";
|
|
||||||
else
|
|
||||||
$Spalten.= ", ";
|
|
||||||
}
|
|
||||||
elseif (mysql_num_rows($Erg3) == 1)
|
|
||||||
$Spalten.= Get_Text("inc_schicht_ist"). ":<br> ";
|
|
||||||
else
|
|
||||||
$Spalten.= Get_Text("inc_schicht_sind"). ":<br> ";
|
|
||||||
|
|
||||||
$Spalten.= UID2Nick(mysql_result($Erg3, $Ui, "UID"));
|
|
||||||
// avatar anzeigen?
|
|
||||||
$Spalten.= DisplayAvatar (mysql_result($Erg3, $Ui, "UID"));
|
|
||||||
$Spalten.= "<br>";
|
|
||||||
} //FOR
|
|
||||||
|
|
||||||
//wenn noch engel benötigt werden
|
|
||||||
if( mysql_result($Erg2, 0, $Uj)-$Ui>0 ) {
|
|
||||||
if ($Ui!=0) $Spalten.= Get_Text("inc_schicht_und");
|
|
||||||
|
|
||||||
// Link zum Eintragen
|
|
||||||
$Spalten.= "\n\t\t\t<a href='".$ENGEL_ROOT.
|
|
||||||
"nonpublic/schichtplan_add.php?ausdatum=".$ausdatum.
|
|
||||||
"&newentry=".$SID.
|
|
||||||
"&newtype=".$Uj.
|
|
||||||
"'>";
|
|
||||||
$Spalten.= (mysql_result($Erg2, 0, $Uj)-$Ui);
|
|
||||||
|
|
||||||
// Wort: weiter(e)?
|
|
||||||
if (mysql_num_rows($Erg3) >= 1) {
|
|
||||||
if ((mysql_result($Erg2, 0, $Uj)-$Ui) > 1) {
|
|
||||||
$Spalten.= Get_Text("inc_schicht_weitere");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$Spalten.= Get_Text("inc_schicht_weiterer");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$Spalten.= " ".Get_Text("inc_schicht_Engel");
|
|
||||||
// mehr als 1 weiterer Engel?
|
|
||||||
if (mysql_result($Erg2, 0, $Uj)-$Ui!=1)
|
|
||||||
$Spalten.= Get_Text("inc_schicht_werden");
|
|
||||||
else
|
|
||||||
$Spalten.= Get_Text("inc_schicht_wird");
|
|
||||||
$Spalten.= Get_Text("inc_schicht_noch_gesucht");
|
|
||||||
$Spalten.= "</a><br>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $Spalten;
|
|
||||||
} // function Ausgabe_Feld_Inhalt
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
function Ausgabe_Feld_Inhalt_Druck($RID, $SID) {
|
|
||||||
// gibt, nach übergabe der der SchichtID (SID) und der RaumID (RID),
|
|
||||||
// die eingetragenden und und offenden Schichteintäge zurück
|
|
||||||
include ("./inc/db.php");
|
|
||||||
include ("./inc/config.php");
|
|
||||||
|
|
||||||
$SQL2 = "SELECT * FROM `Raeume` WHERE ";
|
|
||||||
$SQL2.= "(RID = '".$RID."')";
|
|
||||||
$Erg2 = mysql_query($SQL2, $con);
|
|
||||||
for ($Uj = 2; $Uj < mysql_num_fields($Erg2); $Uj++) {
|
|
||||||
if (mysql_result($Erg2, 0, $Uj)) {
|
|
||||||
$Spalten.= "\n\t\t\t ".mysql_field_name($Erg2,
|
|
||||||
$Uj)."engel:<br> ";
|
|
||||||
|
|
||||||
$SQL3 = "SELECT * FROM `Schichtbelegung` WHERE ";
|
|
||||||
$SQL3.= "((SID = '".$SID."') AND";
|
|
||||||
$SQL3.= " (Art = '".$Uj."'))";
|
|
||||||
$Erg3 = mysql_query($SQL3, $con);
|
|
||||||
|
|
||||||
// Ausgabe bisherige Engel fuer die Schicht
|
|
||||||
for ($Ui = 0; $Ui < mysql_num_rows($Erg3); $Ui++) {
|
|
||||||
if ($Ui!=0) $Spalten.= ", ";
|
|
||||||
elseif (mysql_num_rows($Erg3) == 1) $Spalten.= Get_Text("inc_schicht_ist");
|
|
||||||
else $Spalten.= Get_Text("inc_schicht_sind");
|
|
||||||
$Spalten.= UID2Nick(mysql_result($Erg3, $Ui, "UID"));
|
|
||||||
}
|
|
||||||
|
|
||||||
//wenn noch engel benötigt werden
|
|
||||||
if (mysql_result($Erg2, 0, $Uj)-$Ui) {
|
|
||||||
if ($Ui!=0) $Spalten.= Get_Text("inc_schicht_und");
|
|
||||||
|
|
||||||
$Spalten.= "\n\t\t\t";
|
|
||||||
$Spalten.= (mysql_result($Erg2, 0, $Uj)-$Ui);
|
|
||||||
|
|
||||||
// Wort: weiter(e)?
|
|
||||||
if (mysql_num_rows($Erg3) >= 1) {
|
|
||||||
if ((mysql_result($Erg2, 0, $Uj)-$Ui) > 1) {
|
|
||||||
$Spalten.= Get_Text("inc_schicht_weitere");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$Spalten.= Get_Text("inc_schicht_weiterer");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$Spalten.= " ".Get_Text("inc_schicht_Engel");
|
|
||||||
// mehr als 1 weiterer Engel?
|
|
||||||
if (mysql_result($Erg2, 0, $Uj)-$Ui!=1)
|
|
||||||
$Spalten.= Get_Text("inc_schicht_werden");
|
|
||||||
else
|
|
||||||
$Spalten.= Get_Text("inc_schicht_wird");
|
|
||||||
$Spalten.= Get_Text("inc_schicht_noch_gesucht");
|
|
||||||
$Spalten.= "<br>";
|
|
||||||
} else {
|
|
||||||
$Spalten.="<br>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $Spalten;
|
|
||||||
} // function Ausgabe_Feld_Inhalt
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
|
@ -1,90 +0,0 @@
|
||||||
<?php
|
|
||||||
include ("./inc/db.php");
|
|
||||||
include ("./inc/funktion_user.php");
|
|
||||||
|
|
||||||
|
|
||||||
if ( isset($text) && isset($betreff) && IsSet($date) ) {
|
|
||||||
if (!isset($treffen)) $treffen = 0;
|
|
||||||
$escaped_text = htmlescape($text);
|
|
||||||
$escaped_betreff = htmlescape($betreff);
|
|
||||||
$SQL = "INSERT INTO `News` (`Datum`, `Betreff`, `Text`, `UID`, `Treffen`) ";
|
|
||||||
$SQL.= "VALUES ('$date', '$escaped_betreff', '$escaped_text', '".$_SESSION['UID'];
|
|
||||||
$SQL.= "', '$treffen');";
|
|
||||||
$Erg = mysql_query($SQL, $con);
|
|
||||||
if ($Erg == 1) { echo "Eintrag wurde gespeichert<br><br>"; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!IsSet($news_begin)) {
|
|
||||||
$news_begin=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!IsSet($DISPLAY_NEWS)) {
|
|
||||||
$DISPLAY_NEWS = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (($news_begin-$DISPLAY_NEWS) >= 0 ) {
|
|
||||||
echo "<br><br><a href=\"./news.php?news_begin=".($news_begin-$DISPLAY_NEWS)."\">Die vorherigen $DISPLAY_NEWS News anzeigen...</a><br>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$SQL = "SELECT * FROM `News` ORDER BY 'ID' DESC LIMIT $news_begin,$DISPLAY_NEWS";
|
|
||||||
$Erg = mysql_query($SQL, $con);
|
|
||||||
|
|
||||||
// anzahl zeilen
|
|
||||||
$news_rows = mysql_num_rows($Erg);
|
|
||||||
|
|
||||||
for ($n = 0 ; $n < $news_rows ; $n++) {
|
|
||||||
echo "<p class='question'><u>".mysql_result($Erg, $n, "Betreff")."</u><br>\n";
|
|
||||||
echo " <font size=1>".mysql_result($Erg, $n, "Datum").", ";
|
|
||||||
echo UID2Nick(mysql_result($Erg, $n, "UID"))."</font>";
|
|
||||||
// avatar anzeigen?
|
|
||||||
echo DisplayAvatar (mysql_result($Erg, $n, "UID"));
|
|
||||||
echo "</p>\n";
|
|
||||||
echo "<p class='answer'>".nl2br(mysql_result($Erg, $n, "Text"))."</p>\n";
|
|
||||||
$RefID=mysql_result($Erg, $n, "ID");
|
|
||||||
$countSQL="SELECT COUNT(*) from news_comments where Refid = '$RefID'";
|
|
||||||
$countErg = mysql_query($countSQL, $con);
|
|
||||||
$countcom = mysql_result($countErg, 0, "COUNT(*)");
|
|
||||||
echo "<p class='comment' align='right'><a href=\"./news_comments.php?nid=$RefID\">$countcom comments</a></p>\n\n";
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
echo "<a href=\"./news.php?news_begin=".($news_begin+$DISPLAY_NEWS)."\">Die nächsten $DISPLAY_NEWS News anzeigen...</a>";
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<br>
|
|
||||||
<hr>
|
|
||||||
<h4>Neue News erstellen:</h4>
|
|
||||||
<a name="Neu"> </a>
|
|
||||||
|
|
||||||
<form action="<? echo $ENGEL_ROOT ?>nonpublic/news.php" method="post">
|
|
||||||
<?
|
|
||||||
// Datum mit uebergeben, um doppelte Eintraege zu verhindern
|
|
||||||
// (Reload nach dem Eintragen!)
|
|
||||||
?>
|
|
||||||
<input type="hidden" name="date" value="<? echo date("Y-m-d H:i:s"); ?>">
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td align="right">Betreff:</td>
|
|
||||||
<td><input type="text" name="betreff" size="60"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">Text:</td>
|
|
||||||
<td><textarea name="text" cols="50" rows="10"></textarea></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?
|
|
||||||
if ($_SESSION['Rechte']!= 0) {
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td align="right">Treffen:</td>
|
|
||||||
<td><input type="checkbox" name="treffen" size="1" value="1"></td>
|
|
||||||
</tr>
|
|
||||||
<?
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</table>
|
|
||||||
<br>
|
|
||||||
<input type="submit" value="sichern...">
|
|
||||||
</form>
|
|
Loading…
Reference in New Issue