Bestanden uploaden naar 'scripts'

This commit is contained in:
2019-08-24 22:00:04 +00:00
parent e18b537ab8
commit aa31804925
5 changed files with 231 additions and 0 deletions

80
scripts/backup-step1.php Normal file
View File

@@ -0,0 +1,80 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Foto importeer app</title>
<link rel="shortcut icon" href="favicon.png" />
<link rel="stylesheet" href="milligram.min.css">
<script src="sweetalert.min.js"></script>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#content {
margin: 0px auto;
text-align: center;
}
h2 {
letter-spacing: 3px;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 1%;
margin-bottom: 1%;
}
.vl {
border-top: 1px solid #9b4dca;
padding-top: 10px;
padding-bottom: 15px;
}
.colcontent {
display: none;
overflow: hidden;
}
button.collapsible {
margin-bottom: 26px;
}
.collapsible {
width: 180px;
}
</style>
</head>
<body>
<div id="content">
<img src="tokyo-taxi.svg" height="51px" alt="Tokyo taxi">
<h2>Apliance Backup</h2>
<div class="vl"></div>
<h3>Stap 1</h3>
<div class="vl"></div>
<h4>Koppel de externe schijf aan<br></h4>
<h4>Wacht vervolgens 10-15 seconden,<br>druk dan op volgende stap.<br></h4>
<form method="post">
<button class="button" name="next">Volgende stap</button>
</form>
<div id="content">
<div class="vl"></div>
<p><a href="sysinfo.php">System info</a></p>
</div>
<?php
if (isset($_POST['next']))
{
$shellout = shell_exec("if [ -e /dev/sdb1 ] ; then echo 1; else echo 0; fi;");
if ($shellout==1) {
echo '<script>
swal("De externe schijf is gevonden", "", "success").then(function() {
window.location = "backup-step2.php";
});
</script>';
}
if ($shellout==0) {
echo '<script>swal("De externe hardeschijf is niet gevonden ", "Controleer of deze goed is verbonden", "error")</script>';
}
}
?>
</body>
</html>

68
scripts/backup-step2.php Normal file
View File

@@ -0,0 +1,68 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Foto importeer app</title>
<link rel="shortcut icon" href="favicon.png" />
<link rel="stylesheet" href="milligram.min.css">
<script src="sweetalert.min.js"></script>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#content {
margin: 0px auto;
text-align: center;
}
h2 {
letter-spacing: 3px;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 1%;
margin-bottom: 1%;
}
.vl {
border-top: 1px solid #9b4dca;
padding-top: 10px;
padding-bottom: 15px;
}
.colcontent {
display: none;
overflow: hidden;
}
button.collapsible {
margin-bottom: 26px;
}
.collapsible {
width: 180px;
}
</style>
</head>
<body>
<div id="content">
<img src="tokyo-taxi.svg" height="51px" alt="Tokyo taxi">
<h2>Apliance Backup</h2>
<div class="vl"></div>
<h3>Stap 2</h3>
<div class="vl"></div>
<h4>Alles is gereed,</h4>
<h4>Druk op "Maak backup" om te starten<br></h4>
<form method="post">
<button class="button" name="next">Maak backup</button>
</form>
<div id="content">
<div class="vl"></div>
<p><a href="sysinfo.php">System info</a></p>
</div>
<?php
if (isset($_POST['next']))
{
header('Location: start-backup.php');
}
?>
</body>
</html>

49
scripts/error-import.php Normal file
View File

@@ -0,0 +1,49 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Foto importeer tool</title>
<link rel="shortcut icon" href="favicon.png" />
<link rel="stylesheet" href="milligram.min.css">
<script src="sweetalert.min.js"></script>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#content {
margin: 0px auto;
text-align: center;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 1%;
margin-bottom: 1%;
}
.vl {
border-top: 1px solid #9b4dca;
padding-top: 10px;
padding-bottom: 15px;
}
h4.h4txt {
padding-bottom: 26px;
margin: 0px;
}
</style>
</head>
<body>
<script>
swal("Er is iets fout gegaan tijdens het importeren", "", "error")
</script>
<div id="content">
<img src="tokyo-taxi.svg" height="51px" alt="Tokyo taxi">
<h1>Foto importeer tool</h1>
<div class="vl"></div>
<h3>Er is iets fout gegaan tijdens het importeren</h3>
<div class="vl"></div>
<h4 class="h4txt">Error wil be here</h4>
<div class="vl"></div>
</p>
<p><a href="sysinfo.php">System info</a></p>
</div>
</body>
</html>

BIN
scripts/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

34
scripts/index.php Normal file
View File

@@ -0,0 +1,34 @@
/*
#state 0 = not running
#state 1 = now running
#state 2 = Finished without errors
#state 3 = Finished with errors
#state B1 = Backup is running
#State B2 = finished without errors
*/
<?php
$shellout = shell_exec("bash -c 'source session-state; echo \$curstate'");
if ($shellout==0) {
header('Location: welcome.php');
}
if ($shellout==1) {
header('Location: loader-import.php');;
}
if ($shellout==2) {
header('Location: success-import.php');;
}
if ($shellout==3) {
header('Location: error-import.php');;
}
if ($shellout==4) {
header('Location: loader-backup.php');;
}
if ($shellout==5) {
header('Location: success-backup.php');;
}
?>