Bestanden uploaden naar 'scripts'

This commit is contained in:
2019-06-05 22:03:16 +00:00
parent cc357067f7
commit a386bd1e70
5 changed files with 541 additions and 0 deletions

151
scripts/step4.php Normal file
View File

@@ -0,0 +1,151 @@
<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>Foto importeer app</h2>
<div class="vl"></div>
<h3>Stap 4</h3>
<div class="vl"></div>
<h4>Importeer foto&#39;s en verwijder van de SD kaart</h4>
<form method="post">
<button name="movebackup">Start import</button>
</form>
<div class="vl"></div>
<button class="collapsible">Meer opties</button>
<div class="colcontent">
<div class="vl"></div>
<h4>Importeer foto&#39;s en laat deze op de SD kaart staan</h4>
<form method="post">
<button name="copybackup">Start import</button>
</form>
<div class="vl"></div>
<h4>Kopieer alle data vanaf de SD kaart</h4>
<form method="post">
<button name="dumpcopybackup">Start import</button>
</form>
<div class="vl"></div>
<h4>Verplaats alle data vanaf de SD kaart</h4>
<form method="post">
<button name="dumpmovebackup">Start import</button>
</form>
</div>
<div class="vl"></div>
<p class="left">Importeer tool uitzetten</p>
<p>
<form method="post">
<button class="button button-outline" name="shutdown">Zet uit</button>
</form>
</p>
<p><a href="sysinfo.php">System info</a></p>
<script>
var coll = document.getElementsByClassName("collapsible");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var colcontent = this.nextElementSibling;
if (colcontent.style.display === "block") {
colcontent.style.display = "none";
} else {
colcontent.style.display = "block";
}
});
}
</script>
<?php
if (isset($_POST['movebackup']))
{
echo '<script>swal({title:"Weet u zeker het zeker?",text:"De data word verplaast en blijft dus NET op de SD kaart",icon:"warning",buttons:["Annuleren",!0],dangerMode:!0}).then(e=>{e?window.location.href="step4.php?movebackupok":swal("Geannuleerd","Er is niks uitgevoerd","info")});</script>';
}
if (isset($_GET['movebackupok']))
{
shell_exec("echo \backupmode=move > session-mode");
header('Location: start-import.php');
}
if (isset($_POST['copybackup']))
{
echo '<script>swal({title:"Weet u zeker het zeker?",text:"De data word gekopieerd en blijft dus ook op de SD kaart",icon:"warning",buttons:["Annuleren",!0],dangerMode:!0}).then(e=>{e?window.location.href="step4.php?copyackupok":swal("Geannuleerd","Er is niks uitgevoerd","info")})</script>';
}
if (isset($_GET['copyackupok']))
{
shell_exec("echo \backupmode=copy > session-mode");
header('Location: start-import.php');
}
if (isset($_POST['dumpmovebackup']))
{
echo '<script>swal({title:"Weet u zeker het zeker?",text:"De data word verplaast en blijft dus NET op de SD kaart",icon:"warning",buttons:["Annuleren",!0],dangerMode:!0}).then(e=>{e?window.location.href="step4.php?dumpmovebackupok":swal("Geannuleerd","Er is niks uitgevoerd","info")});</script>';
}
if (isset($_GET['dumpmovebackupok']))
{
shell_exec("echo \backupmode=dumpmove > session-mode");
header('Location: start-import.php');
}
if (isset($_POST['dumpcopybackup']))
{
echo '<script>swal({title:"Weet u zeker het zeker?",text:"De data word gekopieerd en blijft dus ook op de SD kaart",icon:"warning",buttons:["Annuleren",!0],dangerMode:!0}).then(e=>{e?window.location.href="step4.php?dumpcopyackupok":swal("Geannuleerd","Er is niks uitgevoerd","info")})</script>';
}
if (isset($_GET['dumpcopyackupok']))
{
shell_exec("echo \backupmode=dumpcopy > session-mode");
header('Location: start-import.php');
}
if (isset($_POST['shutdown']))
{
shell_exec('sudo shutdown -h 1');
echo '<script>swal(" ",{title:"De importeer tool word uitgeschakeld",icon: "info",button: false,});</script>';
}
?>
</body>
</html>