Chore: Verschiebe Git-Repository in das Hauptverzeichnis und richte .gitignore ein
This commit is contained in:
commit
96d0545193
502 files changed
+176027
No files matched your search
@@ -0,0 +1,409 @@
|
||||
<?php
|
||||
/*
|
||||
****************************************************************
|
||||
CREATOR: Hermann Salam Telser
|
||||
DATE: Samstag, 13. J�nner 2007
|
||||
E-Mail: premsalam@gmx.net
|
||||
FILE NAME: configuration.php
|
||||
PURBOSE: include ADODB, connect to DB, register session, define lang,LAST CHANGE: Freitag, 03. Dezember 2004 : enable session vars set to off
|
||||
****************************************************************
|
||||
*/
|
||||
function quote_smart($value)
|
||||
{
|
||||
// Stripslashes
|
||||
if (get_magic_quotes_gpc()) {
|
||||
$value = stripslashes(trim($value));
|
||||
}
|
||||
// Quote if not a number or a numeric string
|
||||
if (!is_numeric($value)) {
|
||||
$value = "'" . mysql_real_escape_string(trim($value)) . "'";
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
###########################################
|
||||
########### INCLUDES ############
|
||||
###########################################
|
||||
require_once("_functions/_display_functions.php");
|
||||
###########################################
|
||||
########### CONSTANTS ############
|
||||
###########################################
|
||||
define("BASEIMAGEDIR",'_images/');
|
||||
###########################################
|
||||
########### DB ############
|
||||
###########################################
|
||||
include("mysql_server.php");
|
||||
|
||||
###########################################
|
||||
########### TESTIMG #############
|
||||
###########################################
|
||||
/*
|
||||
require_once("_functions/_sql_functions.php");
|
||||
updateSummeUndBewertung(34);
|
||||
*/
|
||||
###########################################
|
||||
########### SESSIONS #############
|
||||
###########################################
|
||||
|
||||
#if((rand()%10) == 0) { adodb_session_regenerate_id(); }
|
||||
/*
|
||||
session_start();
|
||||
session_register("user_id");
|
||||
session_register("table");
|
||||
session_register("offset");
|
||||
session_register("edit_user_id");
|
||||
session_register("fullname");
|
||||
*/
|
||||
###########################################
|
||||
########### REGISTER VARIABLE ############
|
||||
###########################################
|
||||
|
||||
$regGetVar = array('logout','table','xaction','offset','postarray','onoff','edit','add','pid','xid');
|
||||
while(list ($k, $v) = each($regGetVar)) {
|
||||
if(isset($_GET[$v])) {
|
||||
$$v = $_GET[$v];
|
||||
}
|
||||
}
|
||||
$regPostVar = array('table','xaction','offset','postarray','onoff','add','edit_user_id','pid','mehrfachauswahl');
|
||||
while(list ($k, $v) = each($regPostVar)) {
|
||||
if(isset($_POST[$v])) {
|
||||
$$v = $_POST[$v];
|
||||
}
|
||||
}
|
||||
$_POST = array();
|
||||
$_GET = array();
|
||||
|
||||
###########################################
|
||||
########### USER AUTHENTICATION ###########
|
||||
###########################################
|
||||
if(isset($logout)) {
|
||||
session_destroy();
|
||||
$loginMessage = -4;
|
||||
loginFunction();
|
||||
exit;
|
||||
}
|
||||
if(isset($postarray['loginusername']) AND isset($postarray['loginpassword'])) {
|
||||
controlValidLogin();
|
||||
}
|
||||
else if(!isset($_SESSION['user_id']) || $_SESSION['user_id']==0) {
|
||||
//session_destroy();
|
||||
loginFunction();
|
||||
exit;
|
||||
}
|
||||
###########################################
|
||||
########### SESSION VARIABLE ############
|
||||
###########################################
|
||||
if(!isset($_SESSION['offset'])) {
|
||||
$_SESSION['offset'] = 0;
|
||||
}
|
||||
if(!isset($_SESSION['limit'])) {
|
||||
$_SESSION['limit'] = 10;
|
||||
}
|
||||
if(isset($pid)) { ## project to edit id
|
||||
$_SESSION['pid'] = $pid;
|
||||
}
|
||||
if(isset($offset)) {
|
||||
$_SESSION['offset'] = $offset;
|
||||
}
|
||||
if(isset($table)) {
|
||||
$_SESSION['table'] = $table;
|
||||
$_SESSION['offset'] = 0;
|
||||
}
|
||||
if(isset($edit_user_id)) {
|
||||
$_SESSION['edit_user_id'] = $edit_user_id;
|
||||
}
|
||||
$regSessiontVar = array('user_id','offset','table','edit_user_id','pid','fullname');
|
||||
while(list ($k, $v) = each($regSessiontVar)) {
|
||||
if(isset($_SESSION[$v])) {
|
||||
$$v = $_SESSION[$v];
|
||||
}
|
||||
}
|
||||
|
||||
###########################################
|
||||
########### PERMISSIONS ############
|
||||
###########################################
|
||||
$sql = "SELECT rechte.name, rechte.rechte_id
|
||||
FROM rechte, users_rechte
|
||||
WHERE users_rechte.user_id = $user_id
|
||||
AND rechte.rechte_id = users_rechte.rechte_id
|
||||
AND users_rechte.onoff LIKE 'on' ";
|
||||
$rechte_array = $connection->GetASSOC($sql);
|
||||
###########################################
|
||||
###################################################################
|
||||
########### STANDART ARRAYS AND VARIABLE ############
|
||||
###################################################################
|
||||
// ARRAY background alternate BackGroundColors ##
|
||||
$backgroundPointer = array("#eeeeee","#f5f5f5","#eeeeee");
|
||||
$backgroundDetailPointer = array("#eeeeee","#f5f5f5","#eeeeee");
|
||||
$colorOver = "#ffffff";
|
||||
$colorHighlight = "#D2D8E1";
|
||||
$colorSubTable = "#f5f5f5";
|
||||
$colorSubTableBorder = "#666666";
|
||||
|
||||
$sonderZeichenFrom = array("�","�","�");
|
||||
$sonderZeichenTo = array("�","�","�");
|
||||
|
||||
$limit = 30;
|
||||
###########################################
|
||||
########### FILE UPLOAD ############
|
||||
###########################################
|
||||
if(!empty($_FILES["allgemeineTabelle"])){
|
||||
$uploaddir = $_SERVER['DOCUMENT_ROOT']."/temp/allgemeineTabelle.txt";
|
||||
move_uploaded_file($_FILES["allgemeineTabelle"]["tmp_name"], $uploaddir);
|
||||
|
||||
$file = get_file("temp/allgemeineTabelle.txt");
|
||||
|
||||
$file = preg_replace("'\t'","|",$file);
|
||||
$t = explode("
|
||||
",$file);
|
||||
if(count($t)<=1) {
|
||||
$file = preg_replace("'\r'","#",$file);
|
||||
$t = explode("#",$file);
|
||||
}
|
||||
if(count($t)<=1) {
|
||||
$file = preg_replace("'\n'","#",$file);
|
||||
$t = explode("#",$file);
|
||||
}
|
||||
$data = array();
|
||||
$zeile=0;
|
||||
while(list ($k, $v) = each($t)) {
|
||||
$zeile++;
|
||||
$q = explode("|",$v);
|
||||
if(count($q)!=4) {
|
||||
$error = "fehler in der hochgeladenen tabelle!<br><br><u>zeile: $zeile</u><br>";
|
||||
$error .= "anzahl der spalten ist ".count($q)." m��te aber 4 sein";
|
||||
} else {
|
||||
##STR REPALCE F�R SONDERZEICHEN
|
||||
for($i=0;$i<count($q);$i++){
|
||||
$q[$i] = trim($q[$i]);
|
||||
$q[$i] = str_replace("�","�",$q[$i]);
|
||||
$q[$i] = str_replace("�","�",$q[$i]);
|
||||
$q[$i] = str_replace("�","�",$q[$i]);
|
||||
#$q[$i] = str_replace("???","�",$q[$i]);
|
||||
}
|
||||
unset($q[0]);
|
||||
$q[3] = str_replace(",",".",$q[3]);
|
||||
$data[] = $q;
|
||||
}
|
||||
}
|
||||
if(!isset($error)) {
|
||||
$now = time();
|
||||
$sql = "DELETE FROM tt_allgemein WHERE pid = $pid";
|
||||
$connection->Execute($sql);
|
||||
while(list ($k, $v) = each($data)) {
|
||||
$sql = "INSERT INTO tt_allgemein (pid,geschoss,typ,qm,ersteller,erstelldatum,editor) VALUE ($pid,'".$v[1]."','".$v[2]."','".$v[3]."','".$fullname."',$now,'".$fullname."')";
|
||||
$connection->Execute($sql);
|
||||
}
|
||||
$sql = " UPDATE uebersicht SET allgemeinupload = 1 WHERE uebersicht_id=$pid";
|
||||
$connection->Execute($sql);
|
||||
}
|
||||
}
|
||||
if(!empty($_FILES["uploadBasisTabelle"])){
|
||||
$uploaddir = $_SERVER['DOCUMENT_ROOT']."/temp/basisTabelle.txt";
|
||||
move_uploaded_file($_FILES["uploadBasisTabelle"]["tmp_name"], $uploaddir);
|
||||
|
||||
$file = get_file("temp/basisTabelle.txt");
|
||||
$file = preg_replace("'\t'","|",$file);
|
||||
$t = explode("
|
||||
",$file);
|
||||
if(count($t)<=1) {
|
||||
$file = preg_replace("'\r'","#",$file);
|
||||
$t = explode("#",$file);
|
||||
}
|
||||
if(count($t)<=1) {
|
||||
$file = preg_replace("'\n'","#",$file);
|
||||
$t = explode("#",$file);
|
||||
}
|
||||
$data = array();
|
||||
$top = "undefined";
|
||||
$zeile=0;
|
||||
while(list ($k, $v) = each($t)) {
|
||||
$zeile++;
|
||||
$q = explode("|",$v);
|
||||
if(count($q)!=4) {
|
||||
$error = "fehler in der hochgeladenen tabelle!<br><br><u>zeile: $zeile</u><br>";
|
||||
$error .= "anzahl der spalten ist ".count($q)." m��te aber 4 sein";
|
||||
} else {
|
||||
##STR REPALCE F�R SONDERZEICHEN
|
||||
for($i=0;$i<count($q);$i++){
|
||||
$q[$i] = trim($q[$i]);
|
||||
$q[$i] = str_replace("�","�",$q[$i]);
|
||||
$q[$i] = str_replace("�","�",$q[$i]);
|
||||
$q[$i] = str_replace("�","�",$q[$i]);
|
||||
#$q[$i] = str_replace("???","�",$q[$i]);
|
||||
}
|
||||
$top = trim($q[0]);
|
||||
unset($q[0]);
|
||||
$data[$top][] = $q;
|
||||
}
|
||||
}
|
||||
if(!isset($error)) {
|
||||
$collectRaume = array();
|
||||
$now = time();
|
||||
while(list ($topNr, $top) = each($data)) {
|
||||
$sql = sprintf("INSERT INTO tt_raume_basis ( pid, topNr, ersteller, erstelldatum, editor ) VALUES ( %s, %s, %s, %s, %s )",
|
||||
quote_smart($pid),
|
||||
quote_smart($topNr),
|
||||
quote_smart($fullname),
|
||||
quote_smart($now),
|
||||
quote_smart($fullname));
|
||||
$connection->Execute($sql);
|
||||
$tt_raume_basis_id = $connection->Insert_ID();
|
||||
while(list ($k, $v) = each($top)) {
|
||||
$collectRaume[] = trim($v[2]);
|
||||
$geschoss = trim($v[1]);
|
||||
$raum = trim($v[2]);
|
||||
$qm = str_replace(",",".",trim($v[3]));
|
||||
$sql = sprintf("INSERT INTO tt_raume_all ( tt_raume_basis_id, pid, geschoss, raum, qm, ersteller, erstelldatum, editor ) VALUES ( %s, %s, %s, %s, %s, %s, %s, %s )",
|
||||
quote_smart($tt_raume_basis_id),
|
||||
quote_smart($pid),
|
||||
quote_smart($geschoss),
|
||||
quote_smart($raum),
|
||||
quote_smart($qm),
|
||||
quote_smart($fullname),
|
||||
quote_smart($now),
|
||||
quote_smart($fullname));
|
||||
$connection->Execute($sql);
|
||||
}
|
||||
}
|
||||
$t = array_unique($collectRaume);
|
||||
while(list ($k, $v) = each($t)) {
|
||||
$sql = sprintf("INSERT INTO tt_raume_generell ( pid, raum, ersteller, erstelldatum, editor ) VALUES ( %s, %s, %s, %s, %s )",
|
||||
quote_smart($pid),
|
||||
quote_smart($v),
|
||||
quote_smart($fullname),
|
||||
quote_smart($now),
|
||||
quote_smart($fullname));
|
||||
$connection->Execute($sql);
|
||||
}
|
||||
$sql = sprintf("UPDATE uebersicht SET upload=1 WHERE uebersicht_id=%s",
|
||||
quote_smart($pid));
|
||||
$connection->Execute($sql);
|
||||
}
|
||||
}
|
||||
if(!empty($_FILES["ueberschreibeBasisTabelle"])){
|
||||
$now = time();
|
||||
#$connection->debug=true;
|
||||
$uploaddir = $_SERVER['DOCUMENT_ROOT']."/temp/overWriteBasisTabelle.txt";
|
||||
move_uploaded_file($_FILES["ueberschreibeBasisTabelle"]["tmp_name"], $uploaddir);
|
||||
|
||||
$file = get_file("temp/overWriteBasisTabelle.txt");
|
||||
$file = preg_replace("'\t'","|",$file);
|
||||
$t = explode("
|
||||
",$file);
|
||||
if(count($t)<=1) {
|
||||
$file = preg_replace("'\r'","#",$file);
|
||||
$t = explode("#",$file);
|
||||
}
|
||||
if(count($t)<=1) {
|
||||
$file = preg_replace("'\n'","#",$file);
|
||||
$t = explode("#",$file);
|
||||
}
|
||||
$data = array();
|
||||
$top = "undefined";
|
||||
$zeile=0;
|
||||
while(list ($k, $v) = each($t)) {
|
||||
$zeile++;
|
||||
$q = explode("|",$v);
|
||||
if(count($q)!=4) {
|
||||
$error = "fehler in der hochgeladenen tabelle!<br><br><u>zeile: $zeile</u><br>";
|
||||
$error .= "anzahl der spalten ist ".count($q)." m��te aber 4 sein";
|
||||
} else {
|
||||
##STR REPALCE F�R SONDERZEICHEN
|
||||
for($i=0;$i<count($q);$i++){
|
||||
$q[$i] = trim($q[$i]);
|
||||
$q[$i] = str_replace("�","�",$q[$i]);
|
||||
$q[$i] = str_replace("�","�",$q[$i]);
|
||||
$q[$i] = str_replace("�","�",$q[$i]);
|
||||
#$q[$i] = str_replace("???","�",$q[$i]);
|
||||
}
|
||||
$top = trim($q[0]);
|
||||
unset($q[0]);
|
||||
$data[$top][] = $q;
|
||||
}
|
||||
}
|
||||
#print_r($data);
|
||||
if(!isset($error)) {
|
||||
include_once "header.php";
|
||||
$new = count($t);
|
||||
$old = $connection->GetONE("SELECT COUNT(tt_raume_all_id) FROM tt_raume_all WHERE pid=$pid");
|
||||
if($old!=$new){
|
||||
?>
|
||||
<script>
|
||||
var uploadstate = window.confirm("die neuen daten stimmen mit den bestehenden nicht �berein!\n bestehende daten: <?PHP echo $old; ?> eintr�ge \n neue daten: <?PHP echo $new; ?> eintr�ge \n sollen die bestehende daten �berschrieben werden?")
|
||||
if (uploadstate) {
|
||||
alert("daten werden �berschrieben!");
|
||||
}
|
||||
else {
|
||||
location.replace("http://gutachten.vogl-fernheim.eu")
|
||||
}
|
||||
</script>
|
||||
<?PHP
|
||||
}
|
||||
$changes = array();
|
||||
$i=0;
|
||||
while(list ($topNr, $top) = each($data)) {
|
||||
$sql = "SELECT tt_raume_basis_id FROM tt_raume_basis WHERE pid=$pid AND topNr LIKE '".$topNr."'";
|
||||
$tt_raume_basis_id = $connection->GetONE($sql);
|
||||
if($tt_raume_basis_id==false) {
|
||||
$sql = sprintf("INSERT INTO tt_raume_basis ( pid, topNr, ersteller, erstelldatum, editor ) VALUES ( %s, %s, %s, %s, %s )",
|
||||
quote_smart($pid),
|
||||
quote_smart($topNr),
|
||||
quote_smart($fullname),
|
||||
quote_smart($now),
|
||||
quote_smart($fullname));
|
||||
$connection->Execute($sql);
|
||||
$tt_raume_basis_id = $connection->Insert_ID();
|
||||
}
|
||||
while(list ($k, $v) = each($top)) {
|
||||
$geschoss = trim($v[1]);
|
||||
$raum = trim($v[2]);
|
||||
$qm = str_replace(",",".",trim($v[3]));
|
||||
$sql = "UPDATE tt_raume_all SET qm='$qm', geschoss='$geschoss',editor='$fullname' WHERE raum LIKE '$raum' AND pid=$pid AND tt_raume_basis_id=$tt_raume_basis_id";
|
||||
$connection->Execute($sql);
|
||||
#SEE IF NEW ROOM IS ADDED
|
||||
$sql = "SELECT tt_raume_basis_id FROM tt_raume_all WHERE raum = '".$raum."' AND pid=$pid AND tt_raume_basis_id=$tt_raume_basis_id";
|
||||
#echo $sql."<br>\n";
|
||||
if($connection->GetONE($sql)==0) {
|
||||
$i++;
|
||||
$sql = sprintf("INSERT INTO tt_raume_all ( tt_raume_basis_id, pid, geschoss, raum, qm, ersteller, editor ) VALUES ( %s, %s, %s, %s, %s, %s, %s )",
|
||||
quote_smart($tt_raume_basis_id),
|
||||
quote_smart($pid),
|
||||
quote_smart($geschoss),
|
||||
quote_smart($raum),
|
||||
quote_smart($qm),
|
||||
quote_smart($fullname),
|
||||
quote_smart($fullname));
|
||||
#echo $sql."<br>\n";
|
||||
$connection->Execute($sql);
|
||||
|
||||
#R�UME GENERELL ZU METHODEN ZUWEISUNG
|
||||
$sql = "SELECT tt_raume_generell_id FROM tt_raume_generell WHERE pid=$pid AND raum = '".$raum."'";
|
||||
#echo $sql."<br>\n";
|
||||
if(!$connection->GetONE($sql)) {
|
||||
$now = time();
|
||||
$sql = sprintf("INSERT INTO tt_raume_generell ( pid, raum, ersteller, erstelldatum, editor ) VALUES ( %s, %s, %s, %s, %s )",
|
||||
quote_smart($pid),
|
||||
quote_smart($raum),
|
||||
quote_smart($fullname),
|
||||
quote_smart($now),
|
||||
quote_smart($fullname));
|
||||
$connection->Execute($sql);
|
||||
}
|
||||
$changes[$i][] = $raum;
|
||||
$changes[$i][] = $qm;
|
||||
}
|
||||
}
|
||||
}
|
||||
$sql = sprintf("UPDATE uebersicht SET upload=1, recalculate=1 WHERE uebersicht_id=%s",
|
||||
quote_smart($pid));
|
||||
$connection->Execute($sql);
|
||||
$msg = "datenbank erfolgreich �berschrieben";
|
||||
if(count($changes)>0) {
|
||||
$msg .= "<br><br>folgende daten wurden hinzugef�gt:<br><br>";
|
||||
while(list ($k, $v) = each($changes)) {
|
||||
$msg .= $k.' | '.$v[0].' | '.$v[1].'<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in new issue
Block a user