aktuelle änderungen

git-svn-id: svn://svn.cccv.de/engel-system@230 29ba0400-6e00-0410-a75a-ca02368028f8
This commit is contained in:
cookie 2007-08-09 16:33:38 +00:00
parent 577a5a3423
commit d5845ab74c
6 changed files with 85 additions and 63 deletions

5
README
View File

@ -7,6 +7,10 @@ DIRS:
./www-ssl ./www-ssl
daten für https verbindung daten für https verbindung
Anfordeungen:
-------------
PHP 4.xx
Systemconfig: Systemconfig:
------------- -------------
./www-ssl/inc/config.php ./www-ssl/inc/config.php
@ -19,3 +23,4 @@ php.ini:
-------- --------
add: add:
allow_url_fopen = On allow_url_fopen = On
date.timezone = Europe/Berlin

View File

@ -12,7 +12,7 @@ include ("./inc/funktion_cron.php");
$StartTimeBeforEvent = (60/4)*60; $StartTimeBeforEvent = (60/4)*60;
$AnrufDelay = -5; $AnrufDelay = -5;
$DebugDECT = FALSE; $DebugDECT = FALSE;
//$DebugDECT = TRUE; #$DebugDECT = TRUE;
//Timeout erhöhen; //Timeout erhöhen;
set_time_limit(50000); set_time_limit(50000);
@ -21,11 +21,11 @@ set_time_limit(50000);
$SQL = "SELECT Shifts.DateS, Shifts.RID, ShiftEntry.UID, ShiftEntry.TID ". $SQL = "SELECT Shifts.DateS, Shifts.RID, ShiftEntry.UID, ShiftEntry.TID ".
"FROM `Shifts` INNER JOIN `ShiftEntry` ON `Shifts`.`SID` = `ShiftEntry`.`SID` "; "FROM `Shifts` INNER JOIN `ShiftEntry` ON `Shifts`.`SID` = `ShiftEntry`.`SID` ";
if( $DebugDECT) if( $DebugDECT)
$SQL .= "WHERE (Shifts.DateS>'2004-12-27 10:45:00' AND ". $SQL .= "WHERE (Shifts.DateS>'2007-07-09 09:45:00' AND ".
"Shifts.DateS<='2004-12-27 11:00:00');"; "Shifts.DateS<='2007-07-09 11:00:00');";
else else
$SQL .= "WHERE ((`Shifts`.`DateS`>'". gmdate("Y-m-d H:i:s", time()+3600+120). "') AND ". $SQL .= "WHERE ((`Shifts`.`DateS`>'". gmdate("Y-m-d H:i:s", time()+3600+120+3600). "') AND ".
"(`Shifts`.`DateS`<='". gmdate("Y-m-d H:i:s", time()+3600+120+$StartTimeBeforEvent). "') );"; "(`Shifts`.`DateS`<='". gmdate("Y-m-d H:i:s", time()+3600+120+3600+$StartTimeBeforEvent). "') );";
$Erg = mysql_query($SQL, $con); $Erg = mysql_query($SQL, $con);
echo mysql_error($con); echo mysql_error($con);

View File

@ -5,14 +5,20 @@ function UID2DECT($UID)
global $con; global $con;
$SQL = "SELECT DECT FROM `User` WHERE UID='$UID'"; $SQL = "SELECT DECT FROM `User` WHERE UID='$UID'";
$Erg = mysql_query($SQL, $con); $Erg = mysql_query($SQL, $con);
if( mysql_num_rows( $Erg) == 1)
return mysql_result($Erg, 0); return mysql_result($Erg, 0);
else
return "";
} }
function RID2Room($RID) function RID2Room($RID)
{ {
global $con; global $con;
$SQL = "SELECT Name FROM `Room` WHERE RID='$RID'"; $SQL = "SELECT Name FROM `Room` WHERE RID='$RID'";
$Erg = mysql_query($SQL, $con); $Erg = mysql_query($SQL, $con);
if( mysql_num_rows( $Erg) == 1)
return mysql_result($Erg, 0); return mysql_result($Erg, 0);
else
return "";
} }
function TID2Engeltype($TID) function TID2Engeltype($TID)
@ -20,7 +26,10 @@ function TID2Engeltype($TID)
global $con; global $con;
$SQL = "SELECT Name FROM `EngelType` WHERE TID='$TID'"; $SQL = "SELECT Name FROM `EngelType` WHERE TID='$TID'";
$Erg = mysql_query($SQL, $con); $Erg = mysql_query($SQL, $con);
if( mysql_num_rows( $Erg) == 1)
return mysql_result($Erg, 0); return mysql_result($Erg, 0);
else
return "";
} }
@ -44,6 +53,8 @@ function DialNumberIAX( $DECTnumber, $Time, $RID, $TID)
$TimeH = "0".$TimeH; $TimeH = "0".$TimeH;
if( $IAXenable) if( $IAXenable)
{ $Message="die-nee shisht beh-kinned , in where-neegin me-nooten . . . your shift beginns in a few minutes";
if (isset($SetHttpIAX))
{ {
$post_data = array(); $post_data = array();
$post_data['code'] = "89o8eu9cg4"; $post_data['code'] = "89o8eu9cg4";
@ -69,9 +80,9 @@ function DialNumberIAX( $DECTnumber, $Time, $RID, $TID)
$result = curl_exec($ch); $result = curl_exec($ch);
echo curl_error($ch); echo curl_error($ch);
curl_close($ch); curl_close($ch);
}
else
/* {
// IAX file Schareiebn // IAX file Schareiebn
$CallFile = "/tmp/call_". date("Ymd_His"). "_$DECTnumber"; $CallFile = "/tmp/call_". date("Ymd_His"). "_$DECTnumber";
@ -79,21 +90,26 @@ function DialNumberIAX( $DECTnumber, $Time, $RID, $TID)
$file = fopen( $CallFile, 'w' ); $file = fopen( $CallFile, 'w' );
if( $file != FALSE) if( $file != FALSE)
{ {
fputs( $file, "Channel: IAX2/$IAXserver/Engelserver@$IAXcontent\n"); fputs( $file, "Channel: SIP/$DECTnumber@$IAXserver\n"); //Ziel nummer
fputs( $file, "Callerid: $IAXcontent\n"); fputs( $file, "Callerid: Engelserver\n");
fputs( $file, "Context: $IAXcontent\n"); // fputs( $file, "Callerid: $IAXcontent\n");
// fputs( $file, "Context: $DECTnumber@$IAXserver\n");
fputs( $file, "Extension: s\n"); fputs( $file, "Extension: s\n");
fputs( $file, "MaxRetries: 3\n"); fputs( $file, "MaxRetries: 1\n");
fputs( $file, "RetryTime: 10\n"); fputs( $file, "RetryTime: 10\n");
fputs( $file, "SetVar: TimeH=$TimeH\n"); fputs( $file, "SetVar: msg=$Message\n");
fputs( $file, "SetVar: TimeM=$TimeM\n"); // fputs( $file, "SetVar: TimeH=$TimeH\n");
fputs( $file, "SetVar: DECTnumber=$DECTnumber\n"); // fputs( $file, "SetVar: TimeM=$TimeM\n");
fputs( $file, "SetVar: Room=". RID2Room( $RID). "\n"); // fputs( $file, "SetVar: DECTnumber=$DECTnumber\n");
fputs( $file, "SetVar: Engeltype=". TID2Engeltype( $TID). "\n"); // fputs( $file, "SetVar: Room=". RID2Room( $RID). "\n");
// fputs( $file, "SetVar: Engeltype=". TID2Engeltype( $TID). "\n");
fclose($file); fclose($file);
system( "chmod 777 $CallFile"); system( "chmod 777 $CallFile");
system( "mv $CallFile /var/spool/asterisk/outgoing"); system( "mv $CallFile /var/spool/asterisk/outgoing");
}*/ }
else
echo "error: $CallFile not created";
}
} }
else else
if($DebugDECT) echo "IAX is disable\n"; if($DebugDECT) echo "IAX is disable\n";

View File

@ -8,7 +8,7 @@ function ausgabe_Feld_Inhalt( $SID, $Man )
{ {
// gibt, nach übergabe der der SchichtID (SID) und der RaumBeschreibung, // gibt, nach übergabe der der SchichtID (SID) und der RaumBeschreibung,
// die eingetragenden und und offenden Schichteintäge zurück // die eingetragenden und und offenden Schichteintäge zurück
global $EngelType, $EngelTypeID, $TID2Name, $con, $DEBUG; global $EngelType, $EngelTypeID, $TID2Name, $con, $DEBUG, $gmdateOffset;
$Spalten = ""; $Spalten = "";
@ -130,7 +130,7 @@ function ausgabe_Feld_Inhalt( $SID, $Man )
//////////////////////////// ////////////////////////////
//in vergangenheit //in vergangenheit
$SQLtime = "SELECT `DateE` FROM `Shifts` WHERE (`SID`='$SID' AND `DateE` >= '". $SQLtime = "SELECT `DateE` FROM `Shifts` WHERE (`SID`='$SID' AND `DateE` >= '".
gmdate("Y-m-d H:i:s", time()+ 3600). "')"; gmdate("Y-m-d H:i:s", time()+ $gmdateOffset). "')";
$Ergtime = mysql_query($SQLtime, $con); $Ergtime = mysql_query($SQLtime, $con);
if( mysql_num_rows( $Ergtime) > 0) if( mysql_num_rows( $Ergtime) > 0)
{ {
@ -312,7 +312,7 @@ function CreateRoomShifts( $raum )
#######################################################*/ #######################################################*/
function showEmptyShifts( ) function showEmptyShifts( )
{ {
global $con, $DEBUG, $RoomID; global $con, $DEBUG, $RoomID, $gmdateOffset;
echo "<table border=\"1\">\n"; echo "<table border=\"1\">\n";
echo "<tr>\n"; echo "<tr>\n";
@ -323,7 +323,7 @@ function showEmptyShifts( )
echo "</tr>\n"; echo "</tr>\n";
$sql = "SELECT `SID`, `DateS`, `Man`, `RID` FROM `Shifts` ". $sql = "SELECT `SID`, `DateS`, `Man`, `RID` FROM `Shifts` ".
"WHERE (`Shifts`.`DateS`>='". gmdate("Y-m-d H:i:s", time()+3600). "') ". "WHERE (`Shifts`.`DateS`>='". gmdate("Y-m-d H:i:s", time()+$gmdateOffset). "') ".
"ORDER BY `DateS`, `RID`;"; "ORDER BY `DateS`, `RID`;";
$Erg = mysql_query($sql, $con); $Erg = mysql_query($sql, $con);

View File

@ -73,7 +73,6 @@ else
$ErrorText = "pub_index_User_more_as_one"; $ErrorText = "pub_index_User_more_as_one";
} // Ende Check, ob User angemeldet wurde } // Ende Check, ob User angemeldet wurde
} }
include ("./inc/header.php"); include ("./inc/header.php");
if( isset($ErrorText)) if( isset($ErrorText))
echo "<h2>". Get_Text($ErrorText). "</h2><br>\n"; echo "<h2>". Get_Text($ErrorText). "</h2><br>\n";

View File

@ -3,6 +3,8 @@ $title = "Himmel";
$header = "Schichtpl&auml;ne"; $header = "Schichtpl&auml;ne";
$submenus = 2; $submenus = 2;
$gmdateOffset=3600+3600;
if( isset($_GET["ausdatum"])) if( isset($_GET["ausdatum"]))
$ausdatum = $_GET["ausdatum"]; $ausdatum = $_GET["ausdatum"];
if( isset($_GET["raum"])) if( isset($_GET["raum"]))
@ -43,7 +45,7 @@ function ShowSwitchDay()
// das Datum auf den ersten Tag setzen... // das Datum auf den ersten Tag setzen...
if( !isset($ausdatum) ) if( !isset($ausdatum) )
{ {
$sql = "SELECT `DateS` FROM `Shifts` WHERE `DateS` like '". gmdate("Y-m-d", time()+3600). "%' ORDER BY `DateS`"; $sql = "SELECT `DateS` FROM `Shifts` WHERE `DateS` like '". gmdate("Y-m-d", time()+$gmdateOffset). "%' ORDER BY `DateS`";
// $sql = "SELECT `DateS` FROM `Shifts` WHERE `DateS` like '2004-12-29%' ORDER BY `DateS`"; // $sql = "SELECT `DateS` FROM `Shifts` WHERE `DateS` like '2004-12-29%' ORDER BY `DateS`";
$Erg = mysql_query($sql, $con); $Erg = mysql_query($sql, $con);
if( mysql_num_rows( $Erg ) == 0 ) if( mysql_num_rows( $Erg ) == 0 )
@ -54,7 +56,7 @@ if( !isset($ausdatum) )
if( mysql_num_rows( $Erg ) > 0 ) if( mysql_num_rows( $Erg ) > 0 )
$ausdatum = substr(mysql_result($Erg,0,"DateS"),0,10); $ausdatum = substr(mysql_result($Erg,0,"DateS"),0,10);
else else
$ausdatum = gmdate("Y-m-d", time()+3600); $ausdatum = gmdate("Y-m-d", time()+$gmdateOffset);
} }
@ -122,7 +124,7 @@ else
$SpaltenTemp.= ($TempMinuten<10)? "0$TempMinuten": "$TempMinuten"; $SpaltenTemp.= ($TempMinuten<10)? "0$TempMinuten": "$TempMinuten";
//aktuelle stunde markieren //aktuelle stunde markieren
if( ($j==0) && ($i == gmdate("H", time()+3600)) && (gmdate("Y-m-d", time()+ 3600) == $ausdatum) ) if( ($j==0) && ($i == gmdate("H", time()+$gmdateOffset)) && (gmdate("Y-m-d", time()+ $gmdateOffset) == $ausdatum) )
$SpaltenTemp = "<h1>$SpaltenTemp</h1>"; $SpaltenTemp = "<h1>$SpaltenTemp</h1>";
$SpaltenTemp = "<td>$SpaltenTemp</td>\n"; $SpaltenTemp = "<td>$SpaltenTemp</td>\n";