-
Notifications
You must be signed in to change notification settings - Fork 1
/
imagepreview.php
140 lines (113 loc) · 4.86 KB
/
imagepreview.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
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/css/main.css" />
<title>rpi-cam Raspberry Pi Camera Webserver</title>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<script type="text/javascript" charset="utf-8">
function submit(){
//alert("OK");
document.location="createpreviewimage.php";
}
</script>
</head>
<div id="maintitle">
<div style="width:1010px;margin:0px auto;text-align:left;background-color:#bdbec6;border:1px solid #000000;">
<div id="title">
<img src="/images/raspberry-pi-icon.png" style="float:right;width:100px;height:89px;margin-left:3px;" alt="RPI Icon" />
<h1 style="float:right;width:100px;height:29px;margin-right:-110px;margin-top: 85px;">
<font color="red">rpi-cam</font>
</h1>
<h1>Raspberry Pi Camera Webserver</h1>
</br></br>A simple LAMP based server with support for the Raspberry Pi Camera Module
</div>
</div>
<!--
<img src="/images/raspberry-pi-icon.png" width="100" height="89" alt="RPi Icon">
<p style="margin-top: -20px;"> Raspberry Pi Camera Webserver</p>
-->
<body>
<?php
include 'includes/checklogin.php';
//USB Stick gemountet ?
//$command="ls /var/www/capture/usb/exist";
$command="mount | grep /dev/sda";
$return=shell_exec($command);
// LINKER NAVIGATOR
echo '<div id="left">';
echo '<div class="menucontainer">';
echo ' <p class="menutitle">Main Menu</p>';
echo ' <a class="menu" href="index.php">Home</a>';
echo '</div>';
echo '<div class="menucontainer">';
echo ' <p class="menutitle">USB Stick</p>';
//if (trim($return)==='/var/www/capture/usb/exist')
if (trim($return)!='')
{
$usbstick="MOUNT OK";
//Check ob USB Stich auch vom WWW beschreibbar?
include "includes/checkusb.php";
//$isrunning = file_get_contents('/var/www/capture/usb/tlstatus', NULL, NULL, 0, 1);
$varfilearray= explode("\n",file_get_contents('/var/www/capture/usb/tlstatus'));
$isrunning=$varfilearray[0];
session_start();
$_SESSION['rollname']=$varfilearray[1];
$_SESSION['sleeptime']=$varfilearray[2];
if ($isrunning === "1") {echo ' <a class="menu" href="#">'.$usbstick.'</a>';} else {echo ' <a class="menu" href="umount.php">'.$usbstick.'</a>';}
echo '<p style="text-align:center;">/var/www/capture/usb</p>';
// load USB Stick free Space
include 'includes/displayusb.php';
if ($isrunning === "1") {echo ' <a class="menu" href="#">Unmount not possible</a>';} else {echo ' <a class="menu" href="umount.php">Unmount</a>';}
echo '</div>';
echo '<div class="menucontainer">';
echo ' <p class="menutitle">Operation</p>';
if ($isrunning === "1")
{
//NOP
}
else
{
echo ' <a class="menu" href="quickcapture.php">Quick Image capture</a>';
echo ' <a class="menu" href="imagepreview.php">Preview Image</a>';
echo ' <a class="menu" href="captureimage.php">Capture Image</a>';
echo ' <a class="menu" href="listimages.php">List Images</a>';
}
echo ' <a class="menu" href="timelapse.php">Timelapse</a>';
if ($isrunning === "1") {$status="Timelapse running";} elseif ($isrunning ==="2"){$status="AVI converting";} else {$status="Timelapse stopped";}
echo '<p style="text-align:center;">'.$status.'</p>';
echo ' <a class="menu" href="apconfig.php">Configure AP</a>';
echo ' <a class="menu" href="reboot.php">Reboot RPi</a>';
echo ' <a class="menu" href="logout.php">Logout "'.$_SESSION['username'].'"</a>';
echo '</div>';
echo '</div>';
// ------ CONTENT GOES HERE ----------
echo '<div id="content">';
echo "<h1>Preview image:</h1>";
$filename="preview.jpg";
echo '<img src="/capture/usb/'.$filename.'" alt="Preview Image" onclick="submit();">';
echo '</br>
<button name="Klickmich" type="button" value="Create Preview" onclick="submit();">Refresh Preview</button>
</br>';
}
else
{
$usbstick="NOT MOUNTED";
echo ' <a class="menu" href="mount.php">'.$usbstick.'</a>';
echo ' <p style="text-align:center;">/var/www/capture/usb</p>';
echo ' <a class="menu" href="mount.php">Mount</a>';
echo '</div>';
echo '<div class="menucontainer">';
echo ' <p class="menutitle">Operation</p>';
echo ' <a class="menu" href="apconfig.php">Configure AP</a>';
echo ' <a class="menu" href="reboot.php">Reboot RPi</a>';
echo ' <a class="menu" href="logout.php">Logout "'.$_SESSION['username'].'"</a>';
echo '</div>';
echo '</div>';
echo '<div id="content">';
include "includes/manual.php";
}
?>
<p>(c) 2013 by <a href="http://www.supagusti.tk" target="_blank">Supagusti's Blog</a></p>
</div>
</body>
</html>