-
Notifications
You must be signed in to change notification settings - Fork 3
/
backup-make.php
executable file
·87 lines (77 loc) · 1.82 KB
/
backup-make.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?
#This program is copyright by Andre Coetzee email: ac@main.me
#and is licensed under the GPL v3
#
#
#
#
#Please add yourself to: http://www.accounting-123.com
#Developers, Software Vendors, Support, Accountants, Users
#
#
#The full software license can be found here:
#http://www.accounting-123.com/a.php?a=153/GPLv3
#
#
#
#
#
#
#
#
#
#
#
require ("settings.php");
header("Location: company-export.php");
exit;
# decide what to do
if (isset ($_POST["key"])) {
switch ($_POST["key"]) {
case "backup":
$OUTPUT = backup ($_POST);
break;
default:
$OUTPUT = comfirm ();
}
} else {
$OUTPUT = confirm ();
}
require("template.php");
# confirms
function confirm ()
{
$confirm =
"<h3>Making a new Backup will delete the previous backup.</h3>
<br>
<table cellpadding='".TMPL_tblCellPadding."' cellspacing='".TMPL_tblCellSpacing."'>
<form action='".SELF."' method=post>
<input type=hidden name=key value=backup>
<tr><td colspan=2 align=right><input type=submit value='Backup »'></td></tr>
</form>
</table> <p>
<table border=0 cellpadding='".TMPL_tblCellPadding."' cellspacing='".TMPL_tblCellSpacing."'>
<tr><th>Quick Links</th></tr>
<script>document.write(getQuicklinkSpecial());</script>
<tr class='bg-odd'><td><a href='main.php'>Main Menu</a></td></tr>
</table>
";
return $confirm;
}
# Select Month
function backup ()
{
$Ex =`/usr/local/pgsql/bin/pg_dumpall -U postgres -c > backup/db.sql`;
$back =
"<h3>Backup Done</h3>
<br>
<p>
<table border=0 cellpadding='".TMPL_tblCellPadding."' cellspacing='".TMPL_tblCellSpacing."'>
<tr><th>Quick Links</th></tr>
<script>document.write(getQuicklinkSpecial());</script>
<tr class='bg-odd'><td><a href='main.php'>Main Menu</a></td></tr>
</table>
";
return $back;
}
?>