mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-30 18:39:28 +00:00
This commit is contained in:
@@ -381,7 +381,7 @@ function show(id)
|
||||
echo "<p>Stellvertreter:<br>";
|
||||
|
||||
//Studiengangsleiter Stellvertreter auselesen
|
||||
$sql_query = "SELECT * FROM campus.vw_mitarbeiter WHERE campus.vw_mitarbeiter.aktiv and uid=(SELECT uid FROM public.tbl_benutzerfunktion WHERE studiengang_kz='$studiengang_kz' AND funktion_kurzbz='stglstv' LIMIT 1)";
|
||||
$sql_query = "SELECT * FROM campus.vw_mitarbeiter WHERE campus.vw_mitarbeiter.aktiv and uid=(SELECT uid FROM public.tbl_benutzerfunktion WHERE oe_kurzbz=(SELECT oe_kurzbz FROM public.tbl_studiengang WHERE studiengang_kz='$studiengang_kz' LIMIT 1) AND funktion_kurzbz='stglstv' LIMIT 1)";
|
||||
|
||||
if($result_course_leader_deputy = $db->db_query($sql_query))
|
||||
{
|
||||
|
||||
@@ -73,6 +73,7 @@ function ConfirmFile(handle)
|
||||
echo "<tr><td class='tdwidth10'> </td><td>";
|
||||
if(isset($_POST['inhalt']))
|
||||
{
|
||||
$inhalt = $_POST['inhalt'];
|
||||
if($inhalt!="____Ordnerinhalt____")
|
||||
{
|
||||
if(!mb_strstr($inhalt,'..'))
|
||||
@@ -100,9 +101,10 @@ function ConfirmFile(handle)
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($userfile))
|
||||
if(isset($_POST['upload']))
|
||||
{
|
||||
if(is_uploaded_file($userfile))
|
||||
echo "UPLOAD";
|
||||
if(is_uploaded_file($_FILES['userfile']['tmp_name']))
|
||||
{
|
||||
$fn = $_FILES['userfile']['name']; //Original Dateiname
|
||||
|
||||
@@ -110,7 +112,7 @@ function ConfirmFile(handle)
|
||||
!stristr($fn,'.php4') && !stristr($fn, '.php5') &&
|
||||
!stristr($fn, '.cgi') && !stristr($fn, '.pl'))
|
||||
{
|
||||
if(move_uploaded_file($userfile,$openpath . $fn))
|
||||
if(move_uploaded_file($_FILES['userfile']['tmp_name'],$openpath . $fn))
|
||||
echo "<center>Das File wurde erfolgreich hochgeladen</center>";
|
||||
else
|
||||
echo "<center>Fehler beim Upload! Bitte Versuchen Sie es erneut</center>";
|
||||
@@ -126,7 +128,7 @@ function ConfirmFile(handle)
|
||||
|
||||
echo "</tr></td>";
|
||||
|
||||
echo "<tr><td class='tdwidth10'> </td><td><form accept-charset="UTF-8" name=\"form1\" method=\"POST\" action=\"semupload.php?lvid=".$lvid."\" onSubmit=\"return ConfirmFile(this);\">";
|
||||
echo "<tr><td class='tdwidth10'> </td><td><form accept-charset='UTF-8' name=\"form1\" method=\"POST\" action=\"semupload.php?lvid=".$lvid."\" onSubmit=\"return ConfirmFile(this);\">";
|
||||
echo "<select name=\"inhalt\" size=5>";
|
||||
echo "<option selected>____Ordnerinhalt____</option>";
|
||||
//Inhalt des Semesterplan Ordners Auslesen
|
||||
@@ -144,7 +146,7 @@ function ConfirmFile(handle)
|
||||
echo "</form></td><td>";
|
||||
|
||||
//FileAuswahlfeld
|
||||
echo '<tr><td class="tdwidth10"> </td><td><br><form accept-charset="UTF-8" enctype="multipart/form-data" method="POST" action="semupload.php?lvid='.$lvid.'">';
|
||||
echo '<tr><td class="tdwidth10"> </td><td><br><form enctype="multipart/form-data" method="POST" action="semupload.php?lvid='.$lvid.'">';
|
||||
echo ' <input type="file" name="userfile" size="30">';
|
||||
echo ' <input type="submit" name="upload" value="Upload">';
|
||||
echo '</form></td><td>';
|
||||
|
||||
@@ -47,7 +47,27 @@
|
||||
if(isset($_GET['short']))
|
||||
$short = $_GET['short'];
|
||||
|
||||
|
||||
if(isset($_GET['subdir']))
|
||||
$subdir = $_GET['subdir'];
|
||||
if(isset($_POST['overwrite']))
|
||||
$overwrite = $_POST['overwrite'];
|
||||
if(isset($_POST['create_dir']))
|
||||
$create_dir = $_POST['create_dir'];
|
||||
if(isset($_POST['new_dir_name_text']))
|
||||
$new_dir_name_text = $_POST['new_dir_name_text'];
|
||||
if(isset($_POST['rename_dir']))
|
||||
$rename_dir = $_POST['rename_dir'];
|
||||
if(isset($_POST['confirm_rename']))
|
||||
$confirm_rename = $_POST['confirm_rename'];
|
||||
if(isset($_POST['link_cut']))
|
||||
$link_cut = $_POST['link_cut'];
|
||||
if(isset($_POST['delete_dir']))
|
||||
$delete_dir = $_POST['delete_dir'];
|
||||
if(isset($_POST['rename_file']))
|
||||
$rename_file = $_POST['rename_file'];
|
||||
if(isset($_POST['delete_file']))
|
||||
$delete_file = $_POST['delete_file'];
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
|
||||
$rechte->getBerechtigungen($user);
|
||||
@@ -115,6 +135,8 @@
|
||||
|
||||
return confirm("Wollen Sie die ausgewaehlten Verzeichnisse wirklich loeschen? Dieser Vorgang ist unwiderruflich!");
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
function ConfirmFile(handle)
|
||||
@@ -125,6 +147,8 @@
|
||||
|
||||
return confirm("Wollen Sie die ausgewaehlten Dateien wirklich loeschen? Dieser Vorgang ist unwiderruflich!");
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
function checkvz(id)
|
||||
@@ -140,6 +164,8 @@
|
||||
alert('Der Verzeichnisname darf kein "&" beinhalten');
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -571,29 +597,30 @@ A:hover {
|
||||
|
||||
$numoffile = 5;
|
||||
|
||||
if(isset($upload) && $upload == "Upload")
|
||||
if(isset($_POST['upload']) && $_POST['upload'] == "Upload")
|
||||
{
|
||||
for($i = 0; $i < $numoffile; $i++)
|
||||
{
|
||||
$file = "userfile_$i";
|
||||
|
||||
if(isset($$file))
|
||||
|
||||
if(isset($_FILES[$file]))
|
||||
{
|
||||
$file_name = $file.'_name';
|
||||
$file_name = $_FILES[$file]['name'];
|
||||
|
||||
if($$file_name != "")
|
||||
if($file_name != "")
|
||||
{
|
||||
if(isset($subdir) && $subdir != "")
|
||||
{
|
||||
$uploadfile = $upload_root.'/'.$uploaddir.'/'.$subdir.'/'.$$file_name;
|
||||
$uploadfile = $upload_root.'/'.$uploaddir.'/'.$subdir.'/'.$file_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$uploadfile = $upload_root.'/'.$uploaddir.'/'.$$file_name;
|
||||
$uploadfile = $upload_root.'/'.$uploaddir.'/'.$file_name;
|
||||
}
|
||||
|
||||
|
||||
if(!file_exists($uploadfile))
|
||||
{
|
||||
|
||||
if(isset($subdir) && $subdir != "")
|
||||
{
|
||||
if(!@is_dir($upload_root.'/'.$uploaddir.'/'.$subdir))
|
||||
@@ -604,7 +631,7 @@ A:hover {
|
||||
{
|
||||
if(!stristr($uploadfile, '.php') && !stristr($uploadfile, '.cgi') && !stristr($uploadfile, '.pl'))
|
||||
{
|
||||
if(copy($$file, $uploadfile))
|
||||
if(copy($_FILES[$file]['tmp_name'], $uploadfile))
|
||||
{
|
||||
exec('chmod 644 "'.$uploadfile.'"');
|
||||
if($islector)
|
||||
@@ -627,7 +654,7 @@ A:hover {
|
||||
{
|
||||
if(!stristr($uploadfile, '.php') && !stristr($uploadfile, '.cgi') && !stristr($uploadfile, '.pl'))
|
||||
{
|
||||
if(copy($$file, $uploadfile))
|
||||
if(copy($_FILES[$file]['tmp_name'], $uploadfile))
|
||||
{
|
||||
exec('chmod 644 "'.$uploadfile.'"');
|
||||
if($islector)
|
||||
@@ -660,7 +687,7 @@ A:hover {
|
||||
{
|
||||
if(!stristr($uploadfile, '.php') && !stristr($uploadfile, '.cgi') && !stristr($uploadfile, '.pl'))
|
||||
{
|
||||
if(copy($$file, $uploadfile))
|
||||
if(copy($_FILES[$file]['tmp_name'], $uploadfile))
|
||||
{
|
||||
exec('chmod 644 "'.$uploadfile.'"');
|
||||
if($islector)
|
||||
@@ -683,7 +710,7 @@ A:hover {
|
||||
{
|
||||
if(!stristr($uploadfile, '.php') && !stristr($uploadfile, '.cgi') && !stristr($uploadfile, '.pl'))
|
||||
{
|
||||
if(copy($$file, $uploadfile))
|
||||
if(copy($_FILES[$file]['tmp_name'], $uploadfile))
|
||||
{
|
||||
exec('chmod 644 "'.$uploadfile.'"');
|
||||
if($islector)
|
||||
@@ -999,9 +1026,10 @@ A:hover {
|
||||
if($entry != "." && $entry != ".." && @is_dir($dest_dir->path.'/'.$entry))
|
||||
{
|
||||
$dir_empty = false;
|
||||
$check_state = '_check_state_'.$dir_count;
|
||||
if(isset($_POST['_check_state_'.$dir_count]))
|
||||
$check_state = $_POST['_check_state_'.$dir_count];
|
||||
|
||||
if(isset($$check_state))
|
||||
if(isset($check_state))
|
||||
{
|
||||
echo "<tr><td align=\"middle\" class='MarkLine'><b><font face=\"Arial,Helvetica,sans-serif\" color=\"#000000\" size=\"2\"> <input type=\"checkbox\" name=\"_check_state_$dir_count\" checked> </font>";
|
||||
}
|
||||
@@ -1044,27 +1072,29 @@ A:hover {
|
||||
}
|
||||
}
|
||||
|
||||
$new_dir_name_ = "new_dir_name".$dir_count;
|
||||
|
||||
if(isset($_POST["new_dir_name".$dir_count]))
|
||||
$new_dir_name_ = $_POST["new_dir_name".$dir_count];
|
||||
|
||||
if(isset($rename_dir) && isset($$check_state))
|
||||
if(isset($rename_dir) && isset($check_state))
|
||||
{
|
||||
echo "</b></td><td align=\"middle\" class='MarkLine'><b><font face=\"Arial,Helvetica,sans-serif\" color=\"#000000\" size=\"2\"><input type=\"text\" name=\"new_dir_name$dir_count\" id='dir_rename_text' value=\"$entry\"> <input type=\"submit\" name=\"confirm_rename\" value=\"OK\" onclick=\"return checkvz('dir_rename_text')\"></font>";
|
||||
}
|
||||
else if(isset($confirm_rename) && isset($$check_state))
|
||||
else if(isset($confirm_rename) && isset($check_state))
|
||||
{
|
||||
if(isset($$new_dir_name_) && $$new_dir_name_ != "")
|
||||
if(isset($new_dir_name_) && $new_dir_name_ != "")
|
||||
{
|
||||
if(!@is_dir($dest_dir->path.'/'.$$new_dir_name_) && !@file_exists($dest_dir->path.'/'.$$new_dir_name_))
|
||||
if(!@is_dir($dest_dir->path.'/'.$new_dir_name_) && !@file_exists($dest_dir->path.'/'.$new_dir_name_))
|
||||
{
|
||||
rename($dest_dir->path.'/'.$entry, $dest_dir->path.'/'.$$new_dir_name_);
|
||||
rename($dest_dir->path.'/'.$entry, $dest_dir->path.'/'.$new_dir_name_);
|
||||
|
||||
$b_refresh_dir = true;
|
||||
|
||||
unset($$check_state);
|
||||
unset($check_state);
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($$check_state);
|
||||
unset($check_state);
|
||||
|
||||
$b_refresh_dir = true;
|
||||
}
|
||||
@@ -1072,7 +1102,7 @@ A:hover {
|
||||
|
||||
echo "</b></td><td align=\"middle\" class='MarkLine'><b><font face=\"Arial,Helvetica,sans-serif\" color=\"#000000\" size=\"2\"><input type=\"submit\" name=\"rename_dir\" value=\"Umbenennen\"> <input type=\"submit\" name=\"delete_dir\" value=\"Löschen\" onClick=\"del=true;\"></font>";
|
||||
}
|
||||
else if(isset($delete_dir) && isset($$check_state))
|
||||
else if(isset($delete_dir) && isset($check_state))
|
||||
{
|
||||
if(@is_dir($dest_dir->path.'/'.$entry))
|
||||
{
|
||||
@@ -1080,7 +1110,7 @@ A:hover {
|
||||
exec('rm -r "'.$dest_dir->path.'/'.$entry.'"');
|
||||
}
|
||||
|
||||
unset($$check_state);
|
||||
unset($check_state);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1264,9 +1294,10 @@ A:hover {
|
||||
if(!@is_dir($dest_dir->path.'/'.$entry) && substr($entry,0,1)!=".")
|
||||
{
|
||||
$null_file = false;
|
||||
$check_state = '_check_state_'.$file_count;
|
||||
if(isset($_POST['_check_state_'.$file_count]))
|
||||
$check_state = $_POST['_check_state_'.$file_count];
|
||||
|
||||
if(isset($$check_state))
|
||||
if(isset($check_state))
|
||||
{
|
||||
echo "<tr><td align=\"middle\" class='MarkLine'><b><font face=\"Arial,Helvetica,sans-serif\" color=\"#000000\" size=\"2\"> <input type=\"checkbox\" name=\"_check_state_$file_count\" checked> </font>";
|
||||
}
|
||||
@@ -1281,25 +1312,26 @@ A:hover {
|
||||
$link_path = str_replace("+","%20",$link_path);
|
||||
echo "</b></td><td align=\"left\" class='MarkLine'><b><font face=\"Arial,Helvetica,sans-serif\" color=\"#000000\" size=\"2\"><a href=\"$link_path\" target=\"_blank\"> <img src=\"../../../skin/images/file.gif\" border=\"0\"> $entry </a></font>";
|
||||
|
||||
$new_file_name_ = "new_file_name".$file_count;
|
||||
if(isset($_POST['new_file_name'.$file_count]))
|
||||
$new_file_name_ = $_POST['new_file_name'.$file_count];
|
||||
|
||||
if(isset($rename_file) && isset($$check_state))
|
||||
if(isset($rename_file) && isset($check_state))
|
||||
{
|
||||
echo "</b></td><td align=\"middle\" class='MarkLine'><b><font face=\"Arial,Helvetica,sans-serif\" color=\"#000000\" size=\"2\"><input type=\"text\" name=\"new_file_name$file_count\" value=\"$entry\"> <input type=\"submit\" name=\"confirm_rename\" value=\"OK\"></font>";
|
||||
}
|
||||
else if(isset($confirm_rename) && isset($$check_state))
|
||||
else if(isset($confirm_rename) && isset($check_state))
|
||||
{
|
||||
if(isset($$new_file_name_) && $$new_file_name_ != "")
|
||||
if(isset($new_file_name_) && $new_file_name_ != "")
|
||||
{
|
||||
if(!@file_exists($dest_dir->path.'/'.$$new_file_name_) && !@is_dir($dest_dir->path.'/'.$$new_file_name_))
|
||||
if(!@file_exists($dest_dir->path.'/'.$new_file_name_) && !@is_dir($dest_dir->path.'/'.$new_file_name_))
|
||||
{
|
||||
if(!stristr($$new_file_name_, '.php') && !stristr($$new_file_name_, '.cgi') && !stristr($$new_file_name_, '.pl'))
|
||||
if(!stristr($new_file_name_, '.php') && !stristr($new_file_name_, '.cgi') && !stristr($new_file_name_, '.pl'))
|
||||
{
|
||||
rename($dest_dir->path.'/'.$entry, $dest_dir->path.'/'.$$new_file_name_);
|
||||
rename($dest_dir->path.'/'.$entry, $dest_dir->path.'/'.$new_file_name_);
|
||||
|
||||
$b_refresh_files = true;
|
||||
|
||||
unset($$check_state);
|
||||
unset($check_state);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1308,7 +1340,7 @@ A:hover {
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($$check_state);
|
||||
unset($check_state);
|
||||
|
||||
$b_refresh_files = true;
|
||||
}
|
||||
@@ -1316,7 +1348,7 @@ A:hover {
|
||||
|
||||
echo "</b></td><td align=\"middle\" class='MarkLine'><b><font face=\"Arial,Helvetica,sans-serif\" color=\"#000000\" size=\"2\"><input type=\"submit\" name=\"rename_file\" value=\"Umbenennen\"> <input type=\"submit\" name=\"delete_file\" value=\"Löschen\" onClick=\"del=true;\"></font>";
|
||||
}
|
||||
else if(isset($delete_file) && isset($$check_state))
|
||||
else if(isset($delete_file) && isset($check_state))
|
||||
{
|
||||
if(!@is_dir($dest_dir->path.'/'.$entry))
|
||||
{
|
||||
@@ -1324,7 +1356,7 @@ A:hover {
|
||||
exec('rm -r "'.$dest_dir->path.'/'.$entry.'"');
|
||||
}
|
||||
|
||||
unset($$check_state);
|
||||
unset($check_state);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -331,7 +331,7 @@ class lehrveranstaltung extends basis_db
|
||||
* Prueft die Gueltigkeit der Variablen
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function validates()
|
||||
public function validate()
|
||||
{
|
||||
//Laenge Pruefen
|
||||
if(mb_strlen($this->bezeichnung)>128)
|
||||
|
||||
+480
-247
@@ -1,248 +1,481 @@
|
||||
<?php
|
||||
/* Copyright (C) 2009 Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>,
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at> and
|
||||
* Gerald Simane-Sequens <gerald.simane-sequens@technikum-wien.at>
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Dieses Script veraendert die Datenbank, damit die Dokumente (PDFs, Bilder, etc) die in
|
||||
* der Datenbank gespeichert sind, nicht mehr HEX codiert, sondern base64 Codiert sind
|
||||
*
|
||||
* !!! Dieses Script muss von der CommandLine gestartet werden da es sonst zu einem Timeout kommt !!!
|
||||
*/
|
||||
|
||||
require_once('../config/system.config.inc.php');
|
||||
require_once('../include/basis_db.class.php');
|
||||
|
||||
$db = new basis_db();
|
||||
|
||||
//Hexcode in String umwandeln
|
||||
function hexstr($hex)
|
||||
{
|
||||
$string="";
|
||||
for ($i=0;$i<mb_strlen($hex)-1;$i+=2)
|
||||
$string.=chr(hexdec(mb_substr($hex,$i,1).mb_substr($hex,$i+1,1)));
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
function convert($string)
|
||||
{
|
||||
return base64_encode(hexstr($string));
|
||||
}
|
||||
|
||||
$db->db_query('BEGIN');
|
||||
|
||||
echo 'tbl_akte...<br>';
|
||||
flush();
|
||||
//Akte
|
||||
$qry = "SELECT akte_id, inhalt FROM public.tbl_akte";
|
||||
$i=0;
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$i++;
|
||||
$qry = "UPDATE public.tbl_akte SET inhalt='".convert($row->inhalt)."' WHERE akte_id='".$row->akte_id."'";
|
||||
|
||||
if($i==10)
|
||||
{
|
||||
echo'<br>';
|
||||
$i=0;
|
||||
}
|
||||
echo $row->akte_id,', ';
|
||||
flush();
|
||||
|
||||
$db->db_query($qry);
|
||||
}
|
||||
}
|
||||
|
||||
echo 'tbl_person...<br>';
|
||||
flush();
|
||||
//Person
|
||||
$qry = "SELECT foto, person_id FROM public.tbl_person WHERE foto is not null";
|
||||
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$qry = "UPDATE public.tbl_person SET foto='".convert($row->foto)."' WHERE person_id='".$row->person_id."'";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
{
|
||||
die('Error:'.$db->db_last_error().$qry);
|
||||
$db->db_query('ROLLBACK');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo 'tbl_frage_sprache.bild...<br>';
|
||||
flush();
|
||||
//Testtool - tbl_frage_sprache.bild
|
||||
$qry = "SELECT bild, frage_id, sprache FROM testtool.tbl_frage_sprache WHERE bild is not null";
|
||||
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$qry = "UPDATE testtool.tbl_frage_sprache SET bild='".convert($row->bild)."' WHERE frage_id='".$row->frage_id."' AND sprache='".$row->sprache."'";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
{
|
||||
die('Error:'.$db->db_last_error().$qry);
|
||||
$db->db_query('ROLLBACK');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo 'tbl_frage_sprache.audio...<br>';
|
||||
flush();
|
||||
//Testtool - tbl_frage_sprache.audio
|
||||
$qry = "SELECT audio, frage_id, sprache FROM testtool.tbl_frage_sprache WHERE audio is not null";
|
||||
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$qry = "UPDATE testtool.tbl_frage_sprache SET audio='".convert($row->audio)."' WHERE frage_id='".$row->frage_id."' AND sprache='".$row->sprache."'";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
{
|
||||
die('Error:'.$db->db_last_error().$qry);
|
||||
$db->db_query('ROLLBACK');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo 'tbl_vorschlag_sprache.bild...<br>';
|
||||
flush();
|
||||
//Testtool - tbl_vorschlag_sprache.bild
|
||||
$qry = "SELECT bild, frage_id, sprache FROM testtool.tbl_vorschlag_sprache WHERE bild is not null";
|
||||
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$qry = "UPDATE testtool.tbl_vorschlag_sprache SET bild='".convert($row->bild)."' WHERE frage_id='".$row->frage_id."' AND sprache='".$row->sprache."'";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
{
|
||||
die('Error:'.$db->db_last_error().$qry);
|
||||
$db->db_query('ROLLBACK');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo 'tbl_vorschlag_sprache.audio...<br>';
|
||||
flush();
|
||||
//Testtool - tbl_vorschlag_sprache.audio
|
||||
$qry = "SELECT audio, frage_id, sprache FROM testtool.tbl_vorschlag_sprache WHERE audio is not null";
|
||||
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$qry = "UPDATE testtool.tbl_vorschlag_sprache SET audio='".convert($row->audio)."' WHERE frage_id='".$row->frage_id."' AND sprache='".$row->sprache."'";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
{
|
||||
die('Error:'.$db->db_last_error().$qry);
|
||||
$db->db_query('ROLLBACK');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo 'tbl_wettbewerb...<br>';
|
||||
flush();
|
||||
//Kommune tbl_wettbewerb
|
||||
$qry = "SELECT icon, wettbewerb_kurzbz FROM kommune.tbl_wettbewerb WHERE icon is not null";
|
||||
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$qry = "UPDATE kommune.tbl_wettbewerb SET icon='".convert($row->icon)."' WHERE wettbewerb_kurzbz='".$row->wettbewerb_kurzbz."'";
|
||||
if(!$db->db_query($qry))
|
||||
{
|
||||
die('Error:'.$db->db_last_error().$qry);
|
||||
$db->db_query('ROLLBACK');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo 'tbl_team...<br>';
|
||||
flush();
|
||||
//Kommune tbl_team
|
||||
$qry = "SELECT logo, team_kurzbz FROM kommune.tbl_team WHERE logo is not null";
|
||||
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$qry = "UPDATE kommune.tbl_team SET logo='".convert($row->logo)."' WHERE team_kurzbz='".$row->team_kurzbz."'";
|
||||
if(!$db->db_query($qry))
|
||||
{
|
||||
die('Error:'.$db->db_last_error().$qry);
|
||||
$db->db_query('ROLLBACK');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo 'tbl_sprache...<br>';
|
||||
flush();
|
||||
//tbl_sprache
|
||||
$qry = "SELECT flagge, sprache FROM public.tbl_sprache WHERE flagge is not null";
|
||||
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$qry = "UPDATE public.tbl_sprache SET flagge='".convert($row->flagge)."' WHERE sprache='".$row->sprache."'";
|
||||
if(!$db->db_query($qry))
|
||||
{
|
||||
die('Error:'.$db->db_last_error().$qry);
|
||||
$db->db_query('ROLLBACK');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo 'tbl_erhalter...<br>';
|
||||
flush();
|
||||
//tbl_erhalter
|
||||
$qry = "SELECT logo, erhalter_kz FROM public.tbl_erhalter WHERE logo is not null";
|
||||
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$qry = "UPDATE public.tbl_erhalter SET logo='".convert($row->logo)."' WHERE erhalter_kz='".$row->erhalter_kz."'";
|
||||
if(!$db->db_query($qry))
|
||||
{
|
||||
die('Error:'.$db->db_last_error().$qry);
|
||||
$db->db_query('ROLLBACK');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$db->db_query('COMMIT'))
|
||||
echo 'ERROR:'.$db->db_last_error();
|
||||
else
|
||||
echo '<b>Aktualisierung abgeschlossen</b>';
|
||||
<?php
|
||||
/* Copyright (C) 2009 Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Cbristian Paminger <cbristian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>,
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at> and
|
||||
* Gerald Simane-Sequens <gerald.simane-sequens@technikum-wien.at>
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Dieses Script veraendert die Datenbank, damit die Dokumente (PDFs, Bilder, etc) die in
|
||||
* der Datenbank gespeichert sind, nicht mebr HEX codiert, sondern base64 Codiert sind
|
||||
*
|
||||
* !!! Dieses Script muss von der CommandLine gestartet werden da es sonst zu einem Timeout kommt !!!
|
||||
*/
|
||||
header('Expires: -1');
|
||||
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 "<br>\nStart Host:".DB_HOST.' DB:'.DB_NAME .' line '. __LINE__ .' ; file ' . __FILE__."<br>\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<strlen($hex)-1;$i+=2)
|
||||
$string.=chr(hexdec(mb_substr($hex,$i,1,'UTF-8').mb_substr($hex,$i+1,1,'UTF-8')));
|
||||
return $string;
|
||||
}
|
||||
|
||||
function convert($string)
|
||||
{
|
||||
if (!$len=mb_strlen($string,'UTF-8'))
|
||||
return $string;
|
||||
$ret=base64_encode(hexstr($string));
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$next_row_counter=10;
|
||||
|
||||
echo "Records je Zeile $next_row_counter <br>\n";
|
||||
flush();
|
||||
|
||||
|
||||
$db = new basis_db();
|
||||
if (!$db->db_query('BEGIN'))
|
||||
die('Error:'.$db->db_last_error()."<br>\n".$qry."<br>\n".' line '. __LINE__ .' ; file ' . __FILE__);
|
||||
|
||||
echo "tbl_akte...".date('Y-m-d H:i:s')."<br>\n";
|
||||
flush();
|
||||
|
||||
//Akte
|
||||
$beg=microtime(true);
|
||||
$beg1=$beg;
|
||||
$qry = "SELECT akte_id, inhalt FROM public.tbl_akte where inhalt is not null and inhalt>''; \n";
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
echo "<br>\nRecords...".$db->db_num_rows($result)."<br>\n";
|
||||
flush();
|
||||
|
||||
$i=0;
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$beg2=microtime(true);
|
||||
|
||||
$row->inhalt=convert($row->inhalt);
|
||||
$qry = "UPDATE public.tbl_akte SET inhalt='".$row->inhalt."' WHERE akte_id='".$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."<br>\n".$qry."<br>\n".' line '. __LINE__ .' ; file ' . __FILE__);
|
||||
}
|
||||
$db->db_free_result($res);
|
||||
|
||||
$rest=$i%$next_row_counter;
|
||||
if ($i>0 && !$rest)
|
||||
{
|
||||
$erg=number_format( (microtime(true) - $beg1 ),3);
|
||||
$beg1=microtime(true);
|
||||
echo " $i : $erg sec<br>\n";
|
||||
flush();
|
||||
}
|
||||
$erg=number_format( (microtime(true) - $beg2 ),3);
|
||||
echo $row->akte_id."($erg sec), ";
|
||||
flush();
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$db->db_free_result($result);
|
||||
$erg=number_format( (microtime(true) - $beg ),3);
|
||||
echo "<br>\ntbl_akte...ENDE $erg sec ".$db->db_last_error()."<br>\n";
|
||||
flush();
|
||||
echo "<hr>\n";
|
||||
|
||||
//Person
|
||||
echo "tbl_person...".date('Y-m-d H:i:s')."<br>\n";
|
||||
flush();
|
||||
|
||||
$beg=microtime(true);
|
||||
$beg1=$beg;
|
||||
$qry = "SELECT foto, person_id FROM public.tbl_person WHERE foto is not null and foto>''; \n";
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
|
||||
echo "<br>\nRecords...".$db->db_num_rows($result)."<br>\n";
|
||||
flush();
|
||||
|
||||
$i=0;
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$beg2=microtime(true);
|
||||
|
||||
$row->foto=convert($row->foto);
|
||||
$qry = "UPDATE public.tbl_person SET foto='".$row->foto."' WHERE person_id='".$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."<br>\n".$qry."<br>\n".' line '. __LINE__ .' ; file ' . __FILE__);
|
||||
}
|
||||
$db->db_free_result($res);
|
||||
|
||||
$rest=$i%$next_row_counter;
|
||||
if ($i>0 && !$rest)
|
||||
{
|
||||
$erg=number_format( (microtime(true) - $beg1 ),3);
|
||||
$beg1=microtime(true);
|
||||
echo " $i : $erg sec<br>\n";
|
||||
flush();
|
||||
}
|
||||
$erg=number_format( (microtime(true) - $beg2 ),3);
|
||||
echo $row->person_id."($erg sec), ";
|
||||
flush();
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$db->db_free_result($result);
|
||||
$erg=number_format( (microtime(true) - $beg ),3);
|
||||
echo "<br>\ntbl_person...ENDE $erg sec ".$db->db_last_error()."<br>\n";
|
||||
flush();
|
||||
|
||||
echo "<hr>\n";
|
||||
|
||||
|
||||
//Testtool - tbl_frage_sprache.bild
|
||||
echo "tbl_frage_sprache bild+audio...".date('Y-m-d H:i:s')."<br>\n";
|
||||
flush();
|
||||
|
||||
$beg=microtime(true);
|
||||
$beg1=$beg;
|
||||
$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))
|
||||
{
|
||||
echo "<br>\nRecords...".$db->db_num_rows($result)."<br>\n";
|
||||
flush();
|
||||
|
||||
$i=0;
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$beg2=microtime(true);
|
||||
|
||||
$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='".$row->frage_id."' AND sprache='".$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."<br>\n".$qry."<br>\n".' line '. __LINE__ .' ; file ' . __FILE__);
|
||||
}
|
||||
$db->db_free_result($res);
|
||||
|
||||
$rest=$i%$next_row_counter;
|
||||
if ($i>0 && !$rest)
|
||||
{
|
||||
$erg=number_format( (microtime(true) - $beg1 ),3);
|
||||
$beg1=microtime(true);
|
||||
echo " $i : $erg sec<br>\n";
|
||||
flush();
|
||||
}
|
||||
$erg=number_format( (microtime(true) - $beg2 ),3);
|
||||
# echo $row->frage_id."($erg sec), ";
|
||||
# flush();
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$db->db_free_result($result);
|
||||
$erg=number_format( (microtime(true) - $beg ),3);
|
||||
echo "<br>\ntbl_frage_sprache bild+audio...ENDE $erg sec ".$db->db_last_error()."<br>\n";
|
||||
flush();
|
||||
|
||||
echo "<hr>\n";
|
||||
|
||||
//Testtool - tbl_vorschlag_sprache.bild
|
||||
echo "testtool.tbl_vorschlag_sprache bild+audio...".date('Y-m-d H:i:s')."<br>\n";
|
||||
flush();
|
||||
|
||||
$beg=microtime(true);
|
||||
$beg1=$beg;
|
||||
$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))
|
||||
{
|
||||
echo "<br>\nRecords...".$db->db_num_rows($result)."<br>\n";
|
||||
flush();
|
||||
|
||||
$i=0;
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$beg2=microtime(true);
|
||||
|
||||
$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='".$row->vorschlag_id."' AND sprache='".$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."<br>\n".$qry."<br>\n".' line '. __LINE__ .' ; file ' . __FILE__);
|
||||
}
|
||||
$db->db_free_result($res);
|
||||
|
||||
$rest=$i%$next_row_counter;
|
||||
if ($i>0 && !$rest)
|
||||
{
|
||||
$erg=number_format( (microtime(true) - $beg1 ),3);
|
||||
$beg1=microtime(true);
|
||||
echo " $i : $erg sec<br>\n";
|
||||
flush();
|
||||
}
|
||||
$erg=number_format( (microtime(true) - $beg2 ),3);
|
||||
# echo $row->vorschlag_id."($erg sec), ";
|
||||
# flush();
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$db->db_free_result($result);
|
||||
$erg=number_format( (microtime(true) - $beg ),3);
|
||||
echo "<br>\ntesttool.tbl_vorschlag_sprache bild + audio...ENDE $erg sec ".$db->db_last_error()."<br>\n";
|
||||
flush();
|
||||
|
||||
echo "<hr>\n";
|
||||
|
||||
//Kommune tbl_wettbewerb
|
||||
echo "kommune.tbl_wettbewerb icon...".date('Y-m-d H:i:s')."<br>\n";
|
||||
flush();
|
||||
|
||||
|
||||
$beg=microtime(true);
|
||||
$beg1=$beg;
|
||||
$qry = "SELECT icon, wettbewerb_kurzbz FROM kommune.tbl_wettbewerb WHERE icon is not null and icon>''; \n";
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
|
||||
echo "<br>\nRecords...".$db->db_num_rows($result)."<br>\n";
|
||||
flush();
|
||||
|
||||
$i=0;
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$beg2=microtime(true);
|
||||
|
||||
$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."<br>\n".$qry."<br>\n".' line '. __LINE__ .' ; file ' . __FILE__);
|
||||
}
|
||||
$db->db_free_result($res);
|
||||
|
||||
$rest=$i%$next_row_counter;
|
||||
if ($i>0 && !$rest)
|
||||
{
|
||||
$erg=number_format( (microtime(true) - $beg1 ),3);
|
||||
$beg1=microtime(true);
|
||||
echo " $i : $erg sec<br>\n";
|
||||
flush();
|
||||
}
|
||||
$erg=number_format( (microtime(true) - $beg2 ),3);
|
||||
# echo $row->wettbewerb_kurzbz."($erg sec), ";
|
||||
# flush();
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$db->db_free_result($result);
|
||||
$erg=number_format( (microtime(true) - $beg ),3);
|
||||
echo "<br>\nkommune.tbl_wettbewerb icon...ENDE $erg sec ".$db->db_last_error()."<br>\n";
|
||||
flush();
|
||||
|
||||
echo "<hr>\n";
|
||||
|
||||
//Kommune tbl_team
|
||||
echo "kommune.tbl_wettbewerb logo...".date('Y-m-d H:i:s')."<br>\n";
|
||||
flush();
|
||||
|
||||
$beg=microtime(true);
|
||||
$beg1=$beg;
|
||||
$qry = "SELECT logo, team_kurzbz FROM kommune.tbl_team WHERE logo is not null and logo>''; \n";
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
|
||||
echo "<br>\nRecords...".$db->db_num_rows($result)."<br>\n";
|
||||
flush();
|
||||
|
||||
$i=0;
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$beg2=microtime(true);
|
||||
|
||||
$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."<br>\n".$qry."<br>\n".' line '. __LINE__ .' ; file ' . __FILE__);
|
||||
}
|
||||
$db->db_free_result($res);
|
||||
|
||||
$rest=$i%$next_row_counter;
|
||||
if ($i>0 && !$rest)
|
||||
{
|
||||
$erg=number_format( (microtime(true) - $beg1 ),3);
|
||||
$beg1=microtime(true);
|
||||
echo " $i : $erg sec<br>\n";
|
||||
flush();
|
||||
}
|
||||
$erg=number_format( (microtime(true) - $beg2 ),3);
|
||||
# echo $row->team_kurzbz."($erg sec), ";
|
||||
# flush();
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$db->db_free_result($result);
|
||||
$erg=number_format( (microtime(true) - $beg ),3);
|
||||
echo "<br>\nkommune.tbl_wettbewerb logo...ENDE $erg sec ".$db->db_last_error()."<br>\n";
|
||||
flush();
|
||||
|
||||
echo "<hr>\n";
|
||||
|
||||
//tbl_sprache
|
||||
echo "public.tbl_sprache flagge ...".date('Y-m-d H:i:s')."<br>\n";
|
||||
flush();
|
||||
|
||||
$beg=microtime(true);
|
||||
$beg1=$beg;
|
||||
$qry = "SELECT flagge, sprache FROM public.tbl_sprache WHERE flagge is not null and flagge>''; \n";
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
echo "<br>\nRecords...".$db->db_num_rows($result)."<br>\n";
|
||||
flush();
|
||||
|
||||
$i=0;
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$beg2=microtime(true);
|
||||
|
||||
$row->flagge=convert($row->flagge);
|
||||
$qry = "UPDATE public.tbl_sprache SET flagge='".$row->flagge."' WHERE sprache='".$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."<br>\n".$qry."<br>\n".' line '. __LINE__ .' ; file ' . __FILE__);
|
||||
}
|
||||
$db->db_free_result($res);
|
||||
|
||||
$rest=$i%$next_row_counter;
|
||||
if ($i>0 && !$rest)
|
||||
{
|
||||
$erg=number_format( (microtime(true) - $beg1 ),3);
|
||||
$beg1=microtime(true);
|
||||
echo " $i : $erg sec<br>\n";
|
||||
flush();
|
||||
}
|
||||
|
||||
$erg=number_format( (microtime(true) - $beg2 ),3);
|
||||
# echo $row->sprache."($erg sec), ";
|
||||
# flush();
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$db->db_free_result($result);
|
||||
$erg=number_format( (microtime(true) - $beg ),3);
|
||||
echo "<br>\npublic.tbl_sprache flagge...ENDE $erg sec ".$db->db_last_error()."<br>\n";
|
||||
flush();
|
||||
|
||||
echo "<hr>\n";
|
||||
|
||||
//tbl_erhalter
|
||||
echo "public.tbl_erhalter logo ...".date('Y-m-d H:i:s')."<br>\n";
|
||||
flush();
|
||||
|
||||
$beg=microtime(true);
|
||||
$beg1=$beg;
|
||||
$qry = "SELECT logo, erhalter_kz FROM public.tbl_erhalter WHERE logo is not null and logo>''; \n";
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
echo "<br>\nRecords...".$db->db_num_rows($result)."<br>\n";
|
||||
flush();
|
||||
|
||||
$i=0;
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$beg2=microtime(true);
|
||||
|
||||
$row->logo=convert($row->logo);
|
||||
$qry = "UPDATE public.tbl_erhalter SET logo='".$row->logo."' WHERE erhalter_kz='".$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."<br>\n".$qry."<br>\n".' line '. __LINE__ .' ; file ' . __FILE__);
|
||||
}
|
||||
$db->db_free_result($res);
|
||||
|
||||
$rest=$i%$next_row_counter;
|
||||
if ($i>0 && !$rest)
|
||||
{
|
||||
$erg=number_format( (microtime(true) - $beg1 ),3);
|
||||
$beg1=microtime(true);
|
||||
echo " : $next_row_counter Anederungen : $erg sec<br>\n";
|
||||
flush();
|
||||
}
|
||||
$erg=number_format( (microtime(true) - $beg2 ),3);
|
||||
# echo $row->erhalter_kz."($erg sec), ";
|
||||
# flush();
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$db->db_free_result($result);
|
||||
$erg=number_format( (microtime(true) - $beg ),3);
|
||||
echo "<br>\npublic.tbl_erhalter logo...ENDE $erg sec ".$db->db_last_error()."<br>\n";
|
||||
flush();
|
||||
|
||||
echo "<hr>\n";
|
||||
|
||||
if(!$db->db_query('COMMIT'))
|
||||
echo "<br>\n".date('Y-m-d H:i:s')." ERROR :".$db->db_last_error()."<br>\n".' line '. __LINE__ .' ; file ' . __FILE__;
|
||||
else
|
||||
echo "<br>\n<b>Aktualisierung abgeschlossen ".date('Y-m-d H:i:s')."</b>";
|
||||
|
||||
#$db->db_query('ROLLBACK');
|
||||
|
||||
?>
|
||||
@@ -173,8 +173,8 @@ if(isset($_GET['lvid']) && is_numeric($_GET['lvid']))
|
||||
//Fachbereichskoordinatoren holen
|
||||
if($stg_kz!='')
|
||||
{
|
||||
$where = "studiengang_kz='$stg_kz'";
|
||||
$where2=$where;
|
||||
$where = "oe_kurzbz=(SELECT oe_kurzbz FROM public.tbl_studiengang WHERE studiengang_kz='$stg_kz' LIMIT 1)";
|
||||
$where2="studiengang_kz='$stg_kz'";
|
||||
$tables='lehre.tbl_lehrveranstaltung';
|
||||
}
|
||||
else
|
||||
@@ -196,7 +196,7 @@ FROM
|
||||
campus.vw_mitarbeiter JOIN
|
||||
(SELECT uid FROM public.tbl_benutzerfunktion WHERE funktion_kurzbz='fbk' AND $where
|
||||
UNION
|
||||
SELECT koordinator as uid from $tables WHERE $where2) as a USING(uid) ORDER BY nachname, vorname";
|
||||
SELECT koordinator as uid FROM $tables WHERE $where2) as a USING(uid) ORDER BY nachname, vorname";
|
||||
|
||||
$fbk = array();
|
||||
if($result = $db->db_query($qry))
|
||||
|
||||
Reference in New Issue
Block a user