-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstnewfunc.php
executable file
·60 lines (53 loc) · 1.99 KB
/
instnewfunc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
include("config.php");
function abfrageupdate() {
echo "<form class='form-horizontal' method='post' action='instnew.php?instnew=1'>";
echo "ACHTUNG! Datensicherung anlegen! Die Datenbank wird jetzt aktualisiert.<br>";
echo "Einige Tabellen werden neu erzeugt.<br>";
echo "Installation jetzt durchführen?";
echo " <div class='form-actions'>";
echo " <button type='submit' name='submit' class='btn btn-primary'>OK</button>";
echo " <button class='btn'>Abbruch</button>";
echo " </div>";
echo "</form>";
}
function updateabbruch() {
include("config.php");
$dbFile="instnew.sql";
if ( @ unlink ( $dbFile ) ) {
echo 'Die Datei ' . $dbFile . ' wurde gelöscht!<br>';
} else {
echo "<div class='alert alert-warning'>";
echo 'Konnte die Datei ' . $dbFile . ' nicht löschen! Bitte händisch löschen!<br>';
echo "</div>";
}
echo "<a class='btn btn-primary' href='index.php'>Fertig</a>";
}
function updateausfuehren() {
include("config.php");
$dbFile="instnew.sql";
//echo $dbFile."updatewp<br>";
$lines = file($dbFile);
$newquery="";
foreach ($lines as $line_num => $query) {
if (trim($query)=="" || substr($query,0,2)=="--" || substr($query,0,2)=="/*") {
} else {
$newquery=$newquery.$query;
//echo $query."<br>";
if (substr(trim($query),-1)==";") {
//echo "query:".$newquery."<br>";
$result = @mysql_query($newquery) or die(mysql_error());
$newquery="";
}
//$result = @mysql_query($query) or die(mysql_error());
}
}
echo "Database successful updated.<br>";
if ( @ unlink ( $dbFile ) ) {
echo 'Die Datei ' . $dbFile . ' wurde gelöscht!<br>';
} else {
echo 'Konnte die Datei ' . $dbFile . ' nicht löschen! Bitte händisch löschen!<br>';
}
echo "<a href='index.php'>Fertig</a>";
}
?>