This repository has been archived by the owner on Oct 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
photoupload.php
executable file
·134 lines (109 loc) · 3 KB
/
photoupload.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
<?php
session_start();
require("include/functions.php");
$config_file = 'config.php';
if (file_exists($config_file)) {
require("config.php");
} else {
header("Location: error.php?e=config");
die();
}
require("include/apply_config.php");
$force_loggedin = TRUE;
require("include/check_login.php");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>
<title>$app_custom_name - Upload photographs</title>";
require("include/get_css.php");
require("include/get_jqueryui.php");
?>
<script src="js/jquery.validate.js"></script>
<!-- Form validation from http://bassistance.de/jquery-plugins/jquery-plugin-validation/ -->
<script type="text/javascript">
$().ready(function() {
// validate signup form on keyup and submit
$("#fileForm").validate({
rules: {
file: {
required: true
},
SiteID: {
required: true
}
},
messages: {
file: "Please select a file",
fileid: "Please enter a site"
}
});
});
</script>
<style type="text/css">
#fileForm label.error {
margin-left: 10px;
width: auto;
display: inline;
}
</style>
<?php
if ($use_googleanalytics){
echo $googleanalytics_code;
}
#Execute custom code for head, if set
if (is_file("$absolute_dir/customhead.php")) {
include("customhead.php");
}
?>
</head>
<body>
<!--Blueprint container-->
<div class="container">
<?php
require("include/topbar.php");
?>
<div class="span-24 last">
<hr noshade>
</div>
<div class="span-24 last">
<h3>Upload a photograph:</h3>
Photograph file:<br>
<form enctype="multipart/form-data" action="photoupload2.php" method="post" id="fileForm">
<input name="userfile" type="file" id="file" class="fg-button ui-state-default ui-corner-all">
<?php
$max=ini_get("upload_max_filesize");
echo "<span class=\"notice\">Maximum file size is $max</span>";
?>
<br>
Site where this photograph was taken:<br>
<?php
$query = "SELECT * from Sites ORDER BY SiteName";
$result = mysqli_query($connection, $query)
or die (mysqli_error($connection));
$nrows = mysqli_num_rows($result);
echo "<select name=\"SiteID\" class=\"ui-state-default ui-corner-all\">
<option></option>";
for ($i=0;$i<$nrows;$i++) {
$row = mysqli_fetch_array($result);
extract($row);
echo "<option value=\"$SiteID\">$SiteName - $SiteID $SiteLat, $SiteLon</option>\n";
}
?>
</select>
<br>
Direction where the picture was taken:<br><input type="text" name="photodir" size="10" class="fg-button ui-state-default ui-corner-all"> (degrees or N/E/S/W)<br>
Notes of this file:<br>
<input name="photonotes" size="40" class="fg-button ui-state-default ui-corner-all"><br><br>
<input type="submit" value=" Upload " class="fg-button ui-state-default ui-corner-all"> <br>
</form>
<br>
<p class="notice">The photograph file has to be in jpg format.
</div>
<div class="span-24 last">
<?php
require("include/bottom.php");
?>
</div>
</div>
</body>
</html>