/
backupdb.php
147 lines (126 loc) · 4.62 KB
/
backupdb.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php
// Start the session
session_start();
if((!isset($_SESSION['type'])) && $_SESSION['type'] != 0){
echo "Unauthorized access";
header("Location:index.php"); //to redirect back to "index.php" after logging out
exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Backup</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M"
crossorigin="anonymous">
<!-- Custom styles for this template -->
<link rel="stylesheet" href="/css/cssAddWords.css" />
</head>
<body>
<!-- Add Nav Bar part-->
<?php
include "topbar-header.php";
include "sidebar-header.php"
?>
<!-- Start main html-->
<main class="col-sm-9 ml-sm-auto col-md-10 pt-3 " role="main">
<div class= "container">
<h2>Data Backup And Delete</h2>
<form action="/action_page.php">
<div class="form-group">
<label for="sel1">Data Save Type:</label>
<select class="form-control" id="sel1">
<option value="CSV">CSV</option>
<option value="SQL">SQL</option>
<option value="TEXT">TEXT</option>
</select>
</div>
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" class="form-check-input" id="s" value="0" checked> Save All Data
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" class="form-check-input" id ="sd" value="1"> Delete All Data
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" class="form-check-input" id ="r" value="2"> Emergency Restore Database<br> (Restores Last SQL Backup Made From File On The Server)
</label>
</div>
<button id="sendform" class="btn btn-primary">Submit</button>
</form>
</div>
<!-- Modal -->
<div id ="sure" class="modal fade">
<div class="modal-dialog" role="dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Result</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>Modal body text goes here.</p>
</div>
<div class="modal-footer">
<a href="#" id="modalsave" class="btn btn-warning" role="button" >Download</a>
<button type="button" id ="modalclose "class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div id ="confirm" class="modal fade">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Confirm</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>Modal body text goes here.</p>
</div>
<div class="modal-footer">
<button type="button" id ="modalclosesmall"class="btn btn-secondary" data-dismiss="modal">OK</button>
</div>
</div>
</div>
</div>
</main>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS Code from bootstrap site -->
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1"
crossorigin="anonymous"></script>
<script src="https://code.jquery.com/qunit/qunit-2.4.1.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.bundle.js"></script>
<script src="/tests/tests.js"></script>
<script>
if (typeof ($.fn.modal) === 'undefined') {
document.write('<script src="/js/bootstrap.min.js"><\/script>')
}
</script>
<script>
window.jQuery || document.write('<script src="/js/jquery-3.2.1.min.js"><\/script>');
</script>
<div id="bootstrapCssTest" class="hidden"></div>
<script>
$(function () {
if ($('#bootstrapCssTest').is(':visible')) {
$("head").prepend('<link rel="stylesheet" href="/css/bootstrap.min.css">');
}
});
</script>
<script src='/js/backup.js'></script>
</body>
</html>