-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_export_backupqr.php
executable file
·66 lines (50 loc) · 2.19 KB
/
admin_export_backupqr.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
<?php
include 'tpl/auth.php';
include 'tpl/sql.php';
//$backup_file = "backups/" . $dbname . date("Y-m-d-H-i-s") . '.gz';
//$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass ". "$dbname | gzip > $backup_file";
//system($command);
$backup_file = $backup_dir . "qr-" . date("d-m-Y") . ".tar";
//$mime = "application/x-gzip";
//header( "Content-Type: " . $mime );
//header( 'Content-Disposition: attachment; filename="' . $filename . '"' );
$cmd = "tar cf $backup_file qrcodes/";
passthru( $cmd );
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>growTENT :: QR codes backup</title>
<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<!-- Makes your prototype chrome-less once bookmarked to your phone's home screen -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- Include the compiled Ratchet CSS -->
<link rel="stylesheet" href="ratchet-theme-ios.min.css">
<link rel="stylesheet" href="ratchet.min.css">
<link rel="stylesheet" href="app.css">
<!-- Include the compiled Ratchet JS -->
<!-- <script src="ratchet.js"></script> -->
<script src="html5-qrcode.min.js"></script>
</head>
<body>
<!-- Make sure all your bars are the first things in your <body> -->
<header class="bar bar-nav">
<a href="admin.php"><button class="btn btn-link btn-nav pull-left">
<span class="icon icon-home"></span>
Home
</button></a>
<h1 class="title">QR code backups</h1>
</header>
<!-- Wrap all non-bar HTML in the .content div (this is actually what scrolls) -->
<div class="content">
<p class="content-padded" align='center'>The QR codes have now been backed up to the server. If you want a local copy, please click the button below</p>
<?php if($savesuccess=='true'){ echo "<p class='content-padded' align='center'><font color='red'>Saved!</font></p>";} ?>
<div class="card">
<p><a href="<?php echo $backup_file; ?>"><button class="btn btn-positive btn-block">Download QR codes backup</button></a></p>
</div>
</div>
</body>
</html>