From d49556b05b7223dc098939b9f04550a297ec04f4 Mon Sep 17 00:00:00 2001 From: cookie Date: Tue, 15 Nov 2005 23:13:35 +0000 Subject: [PATCH] es wird jetzt die PSID (penterbarf SID) an statt FormPentabarf git-svn-id: svn://svn.cccv.de/engel-system@57 29ba0400-6e00-0410-a75a-ca02368028f8 --- DB/Himmel.sql | 2 +- www-ssl/admin/schichtplan.php | 4 --- www-ssl/inc/funktion_xml_schudle.php | 47 +++++++++++++++------------- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/DB/Himmel.sql b/DB/Himmel.sql index 6f2b9add..0c9d3eaa 100755 --- a/DB/Himmel.sql +++ b/DB/Himmel.sql @@ -158,8 +158,8 @@ CREATE TABLE IF NOT EXISTS `Shifts` ( `Len` float NOT NULL default '0', `RID` int(11) NOT NULL default '0', `Man` text, - `FromPentabarf` char(1) NOT NULL default 'N', `URL` text, + `PSID` text, PRIMARY KEY (`SID`) ) TYPE=MyISAM AUTO_INCREMENT=1 ; diff --git a/www-ssl/admin/schichtplan.php b/www-ssl/admin/schichtplan.php index 4bdbb73f..72cc0cac 100755 --- a/www-ssl/admin/schichtplan.php +++ b/www-ssl/admin/schichtplan.php @@ -115,9 +115,6 @@ case 'change': echo " Beschreibung". "\n"; - echo " FromPentabarf". - "\n"; echo " URL". "\n"; @@ -282,7 +279,6 @@ case 'changesave': "`RID`='". $_GET["eRID"]. "', ". "`Len`='". $_GET["eDauer"]. "', ". "`Man`='". $_GET["eName"]. "', ". - "`FromPentabarf`='". $_GET["eFromPentabarf"]. "', ". "`URL`='". $_GET["eURL"]. "' ". "WHERE `SID`=". $_GET["SID"]; SetHeaderGo2Back(); diff --git a/www-ssl/inc/funktion_xml_schudle.php b/www-ssl/inc/funktion_xml_schudle.php index 05727127..4fd750fd 100755 --- a/www-ssl/inc/funktion_xml_schudle.php +++ b/www-ssl/inc/funktion_xml_schudle.php @@ -11,7 +11,7 @@ function SaveSchedule() global $RoomID, $RoomName; include ("./inc/db.php"); - if( isset($_GET["SIDXML"]) && + if( isset($_GET["PSIDXML"]) && isset($_GET["DateXML"]) && isset($_GET["RIDXML"]) && isset($_GET["LenXML"]) && @@ -37,18 +37,17 @@ function SaveSchedule() $_GET["RIDXML"] = $RoomName[$_GET["RIDXML"]]; //Update OR insert ? - $SQL1 = "Select `SID` FROM `Shifts` WHERE `SID`='". $_GET["SIDXML"]. "';"; + $SQL1 = "Select `SID` FROM `Shifts` WHERE `PSID`='". $_GET["PSIDXML"]. "';"; $Erg1 = mysql_query($SQL1, $con); if( mysql_num_rows($Erg1)==0) - $SQL= "INSERT INTO `Shifts` (`SID`, `DateS`, `DateE`, `Len`, `RID`, `Man`, `FromPentabarf`, `URL`) ". - "VALUES ('". $_GET["SIDXML"]. "', ". + $SQL= "INSERT INTO `Shifts` (`PSID`, `DateS`, `DateE`, `Len`, `RID`, `Man`, `URL`) ". + "VALUES ('". $_GET["PSIDXML"]. "', ". "'". $_GET["DateXML"]. "', ". "'". $DateEnd. "', ". "'". $_GET["LenXML"]. "', ". "'". $_GET["RIDXML"]. "', ". "'". mysql_escape_string($_GET["ManXML"]). "', ". - "'Y', ". "'". $_GET["URLXML"]. "'". ");"; else @@ -58,16 +57,19 @@ function SaveSchedule() "`Len` = '". $_GET["LenXML"]. "', ". "`RID` = '". $_GET["RIDXML"]. "', ". "`Man` = '". mysql_escape_string($_GET["ManXML"]). "', ". - "`FromPentabarf`= 'Y', ". "`URL`= '". $_GET["URLXML"]. "' ". - "WHERE `SID` = '". $_GET["SIDXML"]. "' LIMIT 1;"; + "WHERE `PSID` = '". $_GET["PSIDXML"]. "' LIMIT 1;"; $Erg = mysql_query($SQL, $con); if( $Erg ) { - echo "Aenderung, am Schedule '". $_GET["SIDXML"]. "', war erfogreich
\n"; + echo "Aenderung, am Schedule '". $_GET["PSIDXML"]. "', war erfogreich
\n"; if( mysql_num_rows($Erg1)==0) { echo "-->Create Shifts:
\n"; + + //SID auslesen + $SQL1 = "Select `SID` FROM `Shifts` WHERE `PSID`='". $_GET["PSIDXML"]. "';"; + $Erg1 = mysql_query($SQL1, $con); // erstellt ein Array der Reume $sql2 = "SELECT * FROM `Room` ". @@ -83,7 +85,7 @@ function SaveSchedule() for( $i=0; $i < mysql_result($Erg2, 0, $j); $i++ ) { $SQL3 = "INSERT INTO `ShiftEntry` (`SID`, `TID`) VALUES (". - "'". $_GET["SIDXML"]. "', ". + "'". mysql_result($Erg1, 0, 0). "', ". "'". substr( mysql_field_name($Erg2, $j), 12). "');"; $Erg3 = mysql_query($SQL3, $con); @@ -100,7 +102,7 @@ function SaveSchedule() } } else - echo "Aenderung, am Schedule '". $_GET["SIDXML"]. "', war nicht erfogreich.(". + echo "Aenderung, am Schedule '". $_GET["PSIDXML"]. "', war nicht erfogreich.(". mysql_error($con). ")
[$SQL]
\n"; } else @@ -117,7 +119,7 @@ $Where = ""; //ausgabe echo "\n"; -echo "". +echo "". "\n"; echo "". "\n"; @@ -130,7 +132,7 @@ foreach($XMLmain->sub as $EventKey => $Event) echo "\n"; echo "\t\n"; - $SIDXML = substr( getXMLsubData( $Event, "UID"), 0, strpos( getXMLsubData( $Event, "UID"), "@" )); + $PSIDXML = getXMLsubData( $Event, "UID"); $DateXML = substr( getXMLsubData( $Event, "DTSTART"), 0, 4). "-". substr( getXMLsubData( $Event, "DTSTART"), 4, 2). "-". @@ -144,7 +146,7 @@ foreach($XMLmain->sub as $EventKey => $Event) if( isset($_GET["UpdateALL"])) { - $_GET["SIDXML"] = $SIDXML; + $_GET["PSIDXML"] = $PSIDXML; $_GET["DateXML"] = $DateXML; $_GET["LenXML"] = $LenXML; $_GET["RIDXML"] = $RIDXML; @@ -153,11 +155,12 @@ foreach($XMLmain->sub as $EventKey => $Event) SaveSchedule(); } - $SQL = "SELECT * FROM `Shifts` WHERE SID=$SIDXML"; + $SQL = "SELECT * FROM `Shifts` WHERE PSID='$PSIDXML'"; $Erg = mysql_query($SQL, $con); if(mysql_num_rows($Erg)>0) { $SIDDB = mysql_result($Erg, 0, "SID"); + $PSIDDB = mysql_result($Erg, 0, "PSID"); $TimeDB = mysql_result($Erg, 0, "DateS"); $LenDB = mysql_result($Erg, 0, "Len"); if( isset($RoomID[mysql_result($Erg, 0, "RID")])) @@ -169,9 +172,9 @@ foreach($XMLmain->sub as $EventKey => $Event) $URLDB = mysql_result($Erg, 0, "URL"); } else - $SIDDB = $TimeDB = $LenDB = $RIDDB = $ManDB = $URLDB = ""; + $SIDDB = $PSIDDB = $TimeDB = $LenDB = $RIDDB = $ManDB = $URLDB = ""; - echo "\t\n"; + echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; - echo "\t\n"; echo "\t\n"; - if( !( $SIDXML==$SIDDB && + if( !( $PSIDXML==$PSIDDB && $DateXML==$TimeDB && $RIDXML==$RIDDB && $LenXML==$LenDB && @@ -195,12 +197,12 @@ foreach($XMLmain->sub as $EventKey => $Event) } else { - echo "\t\n"; + echo "\t\n"; $DS_OK++; } echo "\t\n"; echo "\n"; - $Where.= " OR SID=$SIDXML"; + $Where.= " OR `PSID`='$PSIDXML'"; } } echo "\n"; @@ -208,11 +210,12 @@ echo "\n"; //Anzeige von nicht im XML File vorkommende entraege if( $Where =="") - $SQL2 = "SELECT * FROM `Shifts` WHERE FromPentabarf = 'Y';"; + $SQL2 = "SELECT * FROM `Shifts` WHERE NOT PSID = '';"; else - $SQL2 = "SELECT * FROM `Shifts` WHERE NOT (".substr( $Where, 4). ") AND FromPentabarf = 'Y';"; + $SQL2 = "SELECT * FROM `Shifts` WHERE NOT (".substr( $Where, 4). ") AND NOT PSID = '';"; $Erg2 = mysql_query($SQL2, $con); +echo mysql_error($con); if(mysql_num_rows($Erg2)>0 && $EnableSchudleDB ) for( $i=0; $i
SIDDate
PSIDDateRoomLenNamestate
XML - DBXML - DBXML - DBXML - DBXML - DB
\n\t\t". "\n\t\t". @@ -180,10 +183,9 @@ foreach($XMLmain->sub as $EventKey => $Event) "\n\t\t". "editedit
status: $DS_KO/$DS_OK nicht Aktuel.
status: $DS_KO/$DS_OK nicht Aktuel.