-
Notifications
You must be signed in to change notification settings - Fork 2
/
CONFIG_GEO.ino
66 lines (55 loc) · 2.19 KB
/
CONFIG_GEO.ino
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
const char GEOCONFIG[] PROGMEM = R"=====(
<body>
<div id='msect'>
<div id='menu'>
<a href="#" class='close' onclick='cl();'>×</a>
<a href="#" id="sub" style='background:green; display: none' onclick='submitFunction()'>save</a><br>
</div>
<br><kop>GEOGRAPHICAL SETTINGS</kop><br><br>
<div class='divstijl' style='height:52vh;'>
<form id='formulier' method='get' action='submitform' oninput='showSubmit()'>
<center><table>
<tr><td style='width:140px;'>latitude °<td><input class='inp3' name='be' length='8' placeholder='latitude' value='{be}'></input></tr>
<tr><td>longitude °<td><input class='inp3' name='longi' length='8' placeholder='longitude' value='{le}'></input></tr>
<tr><td>timezone<td><input class='inp2' name='tz' length='6' placeholder='minutes relative to GMT' value='{tz}'></input></tr>
<tr><td>dst y/n<td><input type='checkbox' style='width:30px; height:30px;' name='ts' #check></input></tr></table>
</div></div><br></form>
<br></body></html>
)=====";
void zendPageGEOconfig( AsyncWebServerRequest *request ) {
String webPage = FPSTR(HTML_HEAD);
webPage += FPSTR(GEOCONFIG);
// put back the data
webPage.replace("{le}", String(longi,3) );
webPage.replace("{be}", String(lati,3) );
webPage.replace("{tz}", String(gmtOffset) );
if (zomerTijd) {
// Serial.println("zomerTijd = true");
webPage.replace("#check", "checked");
}
request->send(200, "text/html", webPage);
webPage="";
}
//void handleGEOconfig(AsyncWebServerRequest *request) {
////char static_ip2[16] = "";
//
// //de serverargumenten verzamelen
////strcpy(lengte, request->getParam("le")->value().c_str());
//
//longi = request->getParam("le")->value().toFloat();
//
////strcpy(breedte, request->getParam("be")->value().c_str());
//
//lati = request->getParam("be")->value().toFloat();
//
//strcpy(gmtOffset, request->getParam("tz")->value().c_str());
//
//
////BEWARE CHECKBOX
//if(request->hasParam("ts")) { zomerTijd = true; } else { zomerTijd = false;}
//
//
// wifiConfigsave();
//
// actionFlag=25; // recalculate with these settings
//}