diff --git a/cis/testtool/frage.php b/cis/testtool/frage.php
index 84b064540..ee88abbe9 100644
--- a/cis/testtool/frage.php
+++ b/cis/testtool/frage.php
@@ -26,17 +26,16 @@
header("Content-type: application/xhtml+xml");
-require_once('../../../config/cis.config.inc.php');
- require_once('../../../include/basis_db.class.php');
- if (!$db = new basis_db())
- die('Fehler beim Oeffnen der Datenbankverbindung');
-
+require_once('../../config/cis.config.inc.php');
require_once('../../include/functions.inc.php');
require_once('../../include/frage.class.php');
require_once('../../include/vorschlag.class.php');
require_once('../../include/antwort.class.php');
require_once('../../include/gebiet.class.php');
+if (!$db = new basis_db())
+ die('Fehler beim Oeffnen der Datenbankverbindung');
+
$PHP_SELF=$_SERVER["PHP_SELF"];
session_start();
diff --git a/include/antwort.class.php b/include/antwort.class.php
index f1917eb79..ba50ef7da 100644
--- a/include/antwort.class.php
+++ b/include/antwort.class.php
@@ -41,7 +41,7 @@ class antwort extends basis_db
{
parent::__construct();
- if(!is_null(antwort_id))
+ if(!is_null($antwort_id))
$this->load($antwort_id);
}
diff --git a/system/hextobase64.php b/system/hextobase64.php
index 72b8f2617..2ae686c3d 100644
--- a/system/hextobase64.php
+++ b/system/hextobase64.php
@@ -32,79 +32,27 @@ header('Cache-Control: no-store, no-cache, must-revalidate' );
header('Pragma: no-cache' );
header('Content-Type: text/html;charset=UTF-8');
-#define("DB_NAME","-devvilesci");
require_once('../config/system.config.inc.php');
-
-echo "
\nStart Host:".DB_HOST.' DB:'.DB_NAME .' line '. __LINE__ .' ; file ' . __FILE__."
\n";
-flush();
-
-error_reporting (E_ALL);
require_once('../include/basis_db.class.php');
-
-//Hexcode in String umwandeln
-function hexstr($hex)
-{
- $string='';
- if (!$len=mb_strlen($hex,'UTF-8'))
- return $string;
-
- for ($i=0;$i\n";
-flush();
$db = new basis_db();
if (!$db->db_query('BEGIN'))
- die('Error:'.$db->db_last_error()."
\n".$qry."
\n".' line '. __LINE__ .' ; file ' . __FILE__);
+ die('Error bei begin');
echo "tbl_akte...".date('Y-m-d H:i:s')."
\n";
flush();
//Akte
-$qry = "SELECT akte_id, inhalt FROM public.tbl_akte where inhalt is not null and inhalt>''; \n";
-if($result = $db->db_query($qry))
+$qry = "UPDATE public.tbl_akte SET inhalt = encode(decode(inhalt, 'hex'),'base64')";
+if(!$db->db_query($qry))
{
- echo "
\nRecords...".$db->db_num_rows($result)."
\n";
- flush();
- $i=0;
- while($row = $db->db_fetch_object($result))
- {
- $row->inhalt=convert($row->inhalt);
- $qry = "UPDATE public.tbl_akte SET inhalt='".$row->inhalt."' WHERE akte_id='".addslashes($row->akte_id)."'; ";
- $res=$db->db_query($qry);
- if(!$rows=$db->db_affected_rows($res))
- {
- $err=$db->db_last_error();
- $db->db_query('ROLLBACK');
- die("Error :" .$err."
\n".$qry."
\n".' line '. __LINE__ .' ; file ' . __FILE__);
- }
- if ($i>0 && !$i%$next_row_counter)
- {
- echo "
\n";
- flush();
- }
- echo $row->akte_id.", ";
- flush();
- $i++;
- }
+ $db->db_query('ROLLBACK');
+ die('Fehler:'.$db->db_last_error());
}
-#$db->db_free_result($result);
-echo "
\ntbl_akte...".date('Y-m-d H:i:s')." ENDE ".$db->db_last_error()."
\n";
+
+echo "
\ntbl_akte...".date('Y-m-d H:i:s')." ENDE
\n";
flush();
echo "
\n";
@@ -112,116 +60,69 @@ echo "
\n";
echo "tbl_person...".date('Y-m-d H:i:s')."
\n";
flush();
-$qry = "SELECT foto, person_id FROM public.tbl_person WHERE foto is not null and foto>'' ; \n";
-if($result = $db->db_query($qry))
+$qry = "UPDATE public.tbl_person SET foto = encode(decode(foto, 'hex'),'base64') WHERE foto is not null";
+if(!$db->db_query($qry))
{
- echo "
\nRecords...".$db->db_num_rows($result)."
\n";
- flush();
-
- $i=0;
- while($row = $db->db_fetch_object($result))
- {
- $row->foto=convert($row->foto);
- $qry = "UPDATE public.tbl_person SET foto='".$row->foto."' WHERE person_id='".addslashes($row->person_id)."'; \n";
- $res=$db->db_query($qry);
- if(!$rows=$db->db_affected_rows($res))
- {
- $err=$db->db_last_error();
- $db->db_query('ROLLBACK');
- die("Error :" .$err."
\n".$qry."
\n".' line '. __LINE__ .' ; file ' . __FILE__);
- }
- if ($i>0 && !$i%$next_row_counter)
- {
- echo "
\n";
- flush();
- }
- echo $row->person_id.", ";
- flush();
- $i++;
- }
+ $db->db_query('ROLLBACK');
+ die('Fehler:'.$db->db_last_error());
}
-#$db->db_free_result($result);
echo "
\ntbl_person...".date('Y-m-d H:i:s')." ENDE ".$db->db_last_error()."
\n";
flush();
echo "
\n";
+//Testtool - tbl_frage_sprache.bild
+echo "tbl_frage_sprache bild...".date('Y-m-d H:i:s')."
\n";
+flush();
+
+$qry = "UPDATE testtool.tbl_frage_sprache SET bild = encode(decode(bild, 'hex'),'base64') WHERE bild is not null and bild<>''";
+if(!$db->db_query($qry))
+{
+ $db->db_query('ROLLBACK');
+ die('Fehler:'.$db->db_last_error());
+}
+echo "
\ntbl_frage_sprache bild...".date('Y-m-d H:i:s')." ENDE
\n";
+flush();
//Testtool - tbl_frage_sprache.bild
-echo "tbl_frage_sprache bild+audio...".date('Y-m-d H:i:s')."
\n";
+echo "tbl_frage_sprache audio...".date('Y-m-d H:i:s')."
\n";
flush();
-$qry = "SELECT bild,audio, frage_id, sprache FROM testtool.tbl_frage_sprache WHERE (bild is not null and bild >'') or (audio is not null and audio >'') ; \n";
-if($result = $db->db_query($qry))
+$qry = "UPDATE testtool.tbl_frage_sprache SET audio = encode(decode(audio, 'hex'),'base64') WHERE audio is not null AND audio<>''";
+if(!$db->db_query($qry))
{
- echo "
\nRecords...".$db->db_num_rows($result)."
\n";
- flush();
-
- $i=0;
- while($row = $db->db_fetch_object($result))
- {
-
- $row->bild=convert($row->bild);
- $row->audio=convert($row->audio);
- $qry = "UPDATE testtool.tbl_frage_sprache SET audio=".($row->audio?"'".$row->audio."'":'null')." ,bild=".($row->bild?"'".$row->bild."'":'null')." WHERE frage_id='".addslashes($row->frage_id)."' AND sprache='".addslashes($row->sprache)."'; \n";
- $res=$db->db_query($qry);
- if(!$rows=$db->db_affected_rows($res))
- {
- $err=$db->db_last_error();
- $db->db_query('ROLLBACK');
- die("Error :" .$err."
\n".$qry."
\n".' line '. __LINE__ .' ; file ' . __FILE__);
- }
- if ($i>0 && !$i%$next_row_counter)
- {
- echo "
\n";
- flush();
- }
- echo $row->frage_id.", ";
- flush();
- $i++;
- }
+ $db->db_query('ROLLBACK');
+ die('Fehler:'.$db->db_last_error());
}
-#$db->db_free_result($result);
-echo "
\ntbl_frage_sprache bild+audio...".date('Y-m-d H:i:s')." ENDE ".$db->db_last_error()."
\n";
+echo "
\ntbl_frage_sprache audio...".date('Y-m-d H:i:s')." ENDE
\n";
flush();
-
echo "
\n";
//Testtool - tbl_vorschlag_sprache.bild
-echo "testtool.tbl_vorschlag_sprache bild+audio...".date('Y-m-d H:i:s')."
\n";
+echo "testtool.tbl_vorschlag_sprache bild...".date('Y-m-d H:i:s')."
\n";
flush();
-$qry = "SELECT bild,audio, vorschlag_id, sprache FROM testtool.tbl_vorschlag_sprache WHERE (bild is not null and bild>'') or (audio is not null and audio>'') ; \n";
-# --->$qry = "SELECT bild, frage_id, sprache FROM testtool.tbl_vorschlag_sprache WHERE bild is not null and bild>''";
-if($result = $db->db_query($qry))
+$qry = "UPDATE testtool.tbl_vorschlag_sprache SET bild = encode(decode(bild, 'hex'),'base64') WHERE bild is not null AND bild<>''";
+if(!$db->db_query($qry))
{
- echo "
\nRecords...".$db->db_num_rows($result)."
\n";
- flush();
-
- $i=0;
- while($row = $db->db_fetch_object($result))
- {
- $row->bild=convert($row->bild);
- $row->audio=convert($row->audio);
- $qry = "UPDATE testtool.tbl_vorschlag_sprache SET bild=".($row->bild?"'".$row->bild."'":'null').", audio=".($row->audio?"'".$row->audio."'":'null')." WHERE vorschlag_id='".addslashes($row->vorschlag_id)."' AND sprache='".addslashes($row->sprache)."'; \n";
- $res=$db->db_query($qry);
- if(!$rows=$db->db_affected_rows($res))
- {
- $err=$db->db_last_error();
- $db->db_query('ROLLBACK');
- die("Error :" .$err."
\n".$qry."
\n".' line '. __LINE__ .' ; file ' . __FILE__);
- }
- if ($i>0 && !$i%$next_row_counter)
- {
- echo "
\n";
- flush();
- }
- echo $row->vorschlag_id.", ";
- flush();
- $i++;
- }
+ $db->db_query('ROLLBACK');
+ die('Fehler:'.$db->db_last_error());
}
-echo "
\ntesttool.tbl_vorschlag_sprache bild + audio...".date('Y-m-d H:i:s')." ENDE ".date('Y-m-d H:i:s')." ".$db->db_last_error()."
\n";
+echo "
\ntesttool.tbl_vorschlag_sprache bild...".date('Y-m-d H:i:s')." ENDE
\n";
+flush();
+
+echo "
\n";
+//Testtool - tbl_vorschlag_sprache.audio
+echo "testtool.tbl_vorschlag_sprache audio...".date('Y-m-d H:i:s')."
\n";
+flush();
+
+$qry = "UPDATE testtool.tbl_vorschlag_sprache SET audio = encode(decode(audio, 'hex'),'base64') WHERE audio is not null AND audio<>''";
+if(!$db->db_query($qry))
+{
+ $db->db_query('ROLLBACK');
+ die('Fehler:'.$db->db_last_error());
+}
+echo "
\ntesttool.tbl_vorschlag_sprache audio...".date('Y-m-d H:i:s')." ENDE
\n";
flush();
echo "
\n";
@@ -229,76 +130,28 @@ echo "
\n";
//Kommune tbl_wettbewerb
echo "kommune.tbl_wettbewerb icon...".date('Y-m-d H:i:s')."
\n";
flush();
-
-$qry = "SELECT icon, wettbewerb_kurzbz FROM kommune.tbl_wettbewerb WHERE icon is not null and icon>''; \n";
-if($result = $db->db_query($qry))
+$qry = "UPDATE kommune.tbl_wettbewerb SET icon = encode(decode(icon, 'hex'),'base64') WHERE icon is not null AND icon<>''";
+if(!$db->db_query($qry))
{
-
- echo "
\nRecords...".$db->db_num_rows($result)."
\n";
- flush();
-
- $i=0;
- while($row = $db->db_fetch_object($result))
- {
- $row->icon=convert($row->icon);
- $qry = "UPDATE kommune.tbl_wettbewerb SET icon='".$row->icon."' WHERE wettbewerb_kurzbz='".addslashes($row->wettbewerb_kurzbz)."'; \n";
- $res=$db->db_query($qry);
- if(!$rows=$db->db_affected_rows($res))
- {
- $err=$db->db_last_error();
- $db->db_query('ROLLBACK');
- die("Error :" .$err."
\n".$qry."
\n".' line '. __LINE__ .' ; file ' . __FILE__);
- }
- if ($i>0 && !$i%$next_row_counter)
- {
- echo "
\n";
- flush();
- }
- echo $row->wettbewerb_kurzbz.", ";
- flush();
- $i++;
- }
+ $db->db_query('ROLLBACK');
+ die('Fehler:'.$db->db_last_error());
}
-#$db->db_free_result($result);
-echo "
\nkommune.tbl_wettbewerb icon...".date('Y-m-d H:i:s')." ENDE ".date('Y-m-d H:i:s')." ".$db->db_last_error()."
\n";
+echo "
\nkommune.tbl_wettbewerb icon...".date('Y-m-d H:i:s')." ENDE
\n";
flush();
echo "
\n";
//Kommune tbl_team
-echo "kommune.tbl_wettbewerb logo...".date('Y-m-d H:i:s')."
\n";
+echo "kommune.tbl_team.logo...".date('Y-m-d H:i:s')."
\n";
flush();
-$qry = "SELECT logo, team_kurzbz FROM kommune.tbl_team WHERE logo is not null and logo>''; \n";
-if($result = $db->db_query($qry))
+$qry = "UPDATE kommune.tbl_team SET logo = encode(decode(logo, 'hex'),'base64') WHERE logo is not null AND logo<>''";
+if(!$db->db_query($qry))
{
-
- echo "
\nRecords...".$db->db_num_rows($result)."
\n";
- flush();
-
- $i=0;
- while($row = $db->db_fetch_object($result))
- {
- $row->logo=convert($row->logo);
- $qry = "UPDATE kommune.tbl_team SET logo='".$row->logo."' WHERE team_kurzbz='".addslashes($row->team_kurzbz)."'";
- $res=$db->db_query($qry);
- if(!$rows=$db->db_affected_rows($res))
- {
- $err=$db->db_last_error();
- $db->db_query('ROLLBACK');
- die("Error :" .$err."
\n".$qry."
\n".' line '. __LINE__ .' ; file ' . __FILE__);
- }
- if ($i>0 && !$i%$next_row_counter)
- {
- echo "
\n";
- flush();
- }
- echo $row->team_kurzbz.", ";
- flush();
- $i++;
- }
+ $db->db_query('ROLLBACK');
+ die('Fehler:'.$db->db_last_error());
}
-echo "
\nkommune.tbl_wettbewerb logo...".date('Y-m-d H:i:s')." ENDE ".$db->db_last_error()."
\n";
+echo "
\nkommune.tbl_team logo...".date('Y-m-d H:i:s')." ENDE
\n";
flush();
echo "
\n";
@@ -307,36 +160,13 @@ echo "
\n";
echo "public.tbl_sprache flagge ...".date('Y-m-d H:i:s')."
\n";
flush();
-$qry = "SELECT flagge, sprache FROM public.tbl_sprache WHERE flagge is not null and flagge>''; \n";
-if($result = $db->db_query($qry))
+$qry = "UPDATE public.tbl_sprache SET flagge = encode(decode(flagge, 'hex'),'base64') WHERE flagge is not null AND flagge<>''";
+if(!$db->db_query($qry))
{
- echo "
\nRecords...".$db->db_num_rows($result)."
\n";
- flush();
-
- $i=0;
- while($row = $db->db_fetch_object($result))
- {
- $row->flagge=convert($row->flagge);
- $qry = "UPDATE public.tbl_sprache SET flagge='".$row->flagge."' WHERE sprache='".addslashes($row->sprache)."'; \n";
- $res=$db->db_query($qry);
- if(!$rows=$db->db_affected_rows($res))
- {
- $err=$db->db_last_error();
- $db->db_query('ROLLBACK');
- die("Error :" .$err."
\n".$qry."
\n".' line '. __LINE__ .' ; file ' . __FILE__);
- }
-
- if ($i>0 && !$i%$next_row_counter)
- {
- echo "
\n";
- flush();
- }
- echo $row->sprache.", ";
- flush();
- $i++;
- }
+ $db->db_query('ROLLBACK');
+ die('Fehler:'.$db->db_last_error());
}
-echo "
\npublic.tbl_sprache flagge...".date('Y-m-d H:i:s')." ENDE ".$db->db_last_error()."
\n";
+echo "
\npublic.tbl_sprache flagge...".date('Y-m-d H:i:s')." ENDE
\n";
flush();
echo "
\n";
@@ -345,69 +175,25 @@ echo "
\n";
echo "public.tbl_erhalter logo ...".date('Y-m-d H:i:s')."
\n";
flush();
-$qry = "SELECT logo, erhalter_kz FROM public.tbl_erhalter WHERE logo is not null and logo>''; \n";
-if($result = $db->db_query($qry))
+$qry = "UPDATE public.tbl_erhalter SET logo = encode(decode(logo, 'hex'),'base64') WHERE logo is not null AND logo<>''";
+if(!$db->db_query($qry))
{
- echo "
\nRecords...".$db->db_num_rows($result)."
\n";
- flush();
-
- $i=0;
- while($row = $db->db_fetch_object($result))
- {
- $row->logo=convert($row->logo);
- $qry = "UPDATE public.tbl_erhalter SET logo='".$row->logo."' WHERE erhalter_kz='".addslashes($row->erhalter_kz)."'";
- $res=$db->db_query($qry);
- if(!$rows=$db->db_affected_rows($res))
- {
- $err=$db->db_last_error();
- $db->db_query('ROLLBACK');
- die("Error :" .$err."
\n".$qry."
\n".' line '. __LINE__ .' ; file ' . __FILE__);
- }
-
- if ($i>0 && !$i%$next_row_counter)
- {
- echo "
\n";
- flush();
- }
- echo $row->erhalter_kz.", ";
- flush();
- $i++;
- }
+ $db->db_query('ROLLBACK');
+ die('Fehler:'.$db->db_last_error());
}
-echo "
\npublic.tbl_erhalter logo...".date('Y-m-d H:i:s')." ENDE ".$db->db_last_error()."
\n";
+
+echo "
\npublic.tbl_erhalter logo...".date('Y-m-d H:i:s')."
\n";
flush();
echo "
\n";
-$qry = "SELECT bild, veranstaltungskategorie_kurzbz FROM campus.tbl_veranstaltungskategorie WHERE bild is not null and bild>''; \n";
-if($result = $db->db_query($qry))
+$qry = "UPDATE campus.tbl_veranstaltungskategorie SET bild = encode(decode(bild, 'hex'),'base64') WHERE bild is not null AND bild<>''";
+if(!$db->db_query($qry))
{
- echo "
\nRecords...".$db->db_num_rows($result)."
\n";
- flush();
-
- $i=0;
- while($row = $db->db_fetch_object($result))
- {
- $row->bild=convert($row->bild);
- $qry = "UPDATE campus.tbl_veranstaltungskategorie SET bild='".$row->bild."' WHERE veranstaltungskategorie_kurzbz='".addslashes($row->veranstaltungskategorie_kurzbz)."'";
- $res=$db->db_query($qry);
- if(!$rows=$db->db_affected_rows($res))
- {
- $err=$db->db_last_error();
- $db->db_query('ROLLBACK');
- die("Error :" .$err."
\n".$qry."
\n".' line '. __LINE__ .' ; file ' . __FILE__);
- }
- if ($i>0 && !$i%$next_row_counter)
- {
- echo "
\n";
- flush();
- }
- echo $row->veranstaltungskategorie_kurzbz.", ";
- flush();
- $i++;
- }
+ $db->db_query('ROLLBACK');
+ die('Fehler:'.$db->db_last_error());
}
-echo "
\npublic.tbl_erhalter logo...".date('Y-m-d H:i:s')." ENDE ".$db->db_last_error()."
\n";
+echo "
\ncampus.tbl_veranstaltungskategorie bild...".date('Y-m-d H:i:s')." ENDE
\n";
flush();
echo "
\n";
@@ -415,8 +201,5 @@ echo "
\n";
if(!$db->db_query('COMMIT'))
echo "
\n".date('Y-m-d H:i:s')." ERROR :".$db->db_last_error()."
\n".' line '. __LINE__ .' ; file ' . __FILE__;
else
- echo "
\nAktualisierung abgeschlossen ".date('Y-m-d H:i:s')."";
-
-#$db->db_query('ROLLBACK');
-
+ echo "
\nAktualisierung abgeschlossen ".date('Y-m-d H:i:s')."";
?>
\ No newline at end of file