Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
aa023aeb95 | |||
8b1d2bd583 | |||
c839c8506c | |||
8e4aad4691 | |||
3a1cff0895 | |||
32633221f1 | |||
cb5db3dddd | |||
2c82d5fb43 | |||
c5ff6cd2aa | |||
fbc53b97f5 | |||
aaa0600af4 |
28
.travis.yml
Normal file
28
.travis.yml
Normal file
@ -0,0 +1,28 @@
|
||||
language: java
|
||||
jdk: oraclejdk8
|
||||
dist: trusty
|
||||
|
||||
# Make the gradle wrapper executable
|
||||
# before_install: chmod +x gradlew
|
||||
before_install:
|
||||
- wget https://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
||||
- unzip -qq gradle-6.1.1-all.zip
|
||||
- export GRADLE_HOME=$PWD/gradle-6.1.1
|
||||
- export PATH=$GRADLE_HOME/bin:$PATH
|
||||
- gradle -v
|
||||
|
||||
script:
|
||||
#- gradle check jacocoTestReport
|
||||
# Also upload test coverage to codecov
|
||||
#- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
before_cache:
|
||||
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
|
||||
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
|
||||
- rm -f $HOME/.gradle/caches/*/fileHashes/fileHashes.bin
|
||||
- rm -f $HOME/.gradle/caches/*/fileHashes/fileHashes.lock
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.gradle/caches/
|
||||
- $HOME/.gradle/wrapper/
|
@ -6,7 +6,7 @@ plugins {
|
||||
}
|
||||
|
||||
group 'com.wasteinformationserver'
|
||||
version '0.3.1-Beta'
|
||||
version '1.0.0'
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
@ -29,7 +29,7 @@ sourceSets {
|
||||
dependencies {
|
||||
compile group: 'org.eclipse.paho', name: 'org.eclipse.paho.client.mqttv3', version: '1.2.2'
|
||||
compile group: 'mysql',name:'mysql-connector-java',version: '8.0.18'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||
}
|
||||
|
||||
task run (type: JavaExec){
|
||||
|
@ -28,19 +28,19 @@ class DeviceRequest : PostRequest() {
|
||||
val deviceid = deviceset.getInt("DeviceID")
|
||||
val cityid = deviceset.getInt("CityID")
|
||||
if (cityid == -1) {
|
||||
sb.append("{\"deviceid\":\"").append(deviceid).append("\",\"cityid\":\"").append(cityid).append("\"}")
|
||||
sb.append("{\"deviceid\":").append(deviceid).append(",\"cityid\":").append(cityid).append("}")
|
||||
}
|
||||
else {
|
||||
val devicename = deviceset.getString("DeviceName")
|
||||
val devicelocation = deviceset.getString("DeviceLocation")
|
||||
sb.append("{\"deviceid\":\"").append(deviceid).append("\",\"devicename\":\"").append(devicename).append("\",\"devicelocation\":\"").append(devicelocation).append("\",\"devices\":[")
|
||||
sb.append("{\"deviceid\":").append(deviceid).append(",\"devicename\":\"").append(devicename).append("\",\"devicelocation\":\"").append(devicelocation).append("\",\"devices\":[")
|
||||
val devicecities = jdbc.executeQuery("SELECT * FROM `device_city` INNER JOIN `cities` ON device_city.CityID=cities.id WHERE `DeviceID`='$deviceid'")
|
||||
while (devicecities.next()) {
|
||||
val cityidd = devicecities.getInt("id")
|
||||
val cityname = devicecities.getString("name")
|
||||
val wastetype = devicecities.getString("wastetype")
|
||||
val zone = devicecities.getString("zone")
|
||||
sb.append("{\"cityid\":\"").append(cityidd).append("\",\"cityname\":\"").append(cityname).append("\",\"wastetype\":\"").append(wastetype).append("\",\"zone\":\"").append(zone).append("\"}")
|
||||
sb.append("{\"cityid\":").append(cityidd).append(",\"cityname\":\"").append(cityname).append("\",\"wastetype\":\"").append(wastetype).append("\",\"zone\":\"").append(zone).append("\"}")
|
||||
if (!devicecities.isLast) {
|
||||
sb.append(",")
|
||||
}
|
||||
@ -142,14 +142,6 @@ class DeviceRequest : PostRequest() {
|
||||
}
|
||||
sb.append("{\"status\":\"success\"}")
|
||||
}
|
||||
"getDeviceNumber" -> try {
|
||||
val numberset = jdbc!!.executeQuery("SELECT * FROM devices")
|
||||
numberset.last()
|
||||
val devicenr = numberset.row
|
||||
sb.append("{\"devicenr\":\"$devicenr\"}")
|
||||
} catch (e: SQLException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
"addtodb" -> {
|
||||
var cityid = -1
|
||||
try {
|
||||
@ -162,6 +154,21 @@ class DeviceRequest : PostRequest() {
|
||||
}
|
||||
sb.append("{\"success\":true}")
|
||||
}
|
||||
"getheader" -> {
|
||||
try {
|
||||
var numberset = jdbc!!.executeQuery("SELECT * FROM devices")
|
||||
numberset.last()
|
||||
val devicenr = numberset.row
|
||||
|
||||
numberset = jdbc!!.executeQuery("SELECT * FROM devices WHERE CityID=-1")
|
||||
numberset.last()
|
||||
val unconfigureddevices = numberset.row
|
||||
|
||||
sb.append("{\"success\":true,\"devicenumber\":$devicenr, \"unconfigureddevices\":$unconfigureddevices}")
|
||||
} catch (e: SQLException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.toString()
|
||||
}
|
||||
|
511
src/resources/wwwroot/ShedulePickUp.html
Normal file
511
src/resources/wwwroot/ShedulePickUp.html
Normal file
@ -0,0 +1,511 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>WasteInformation Server</title>
|
||||
<!-- Tell the browser to be responsive to screen width -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/fontawesome-free/css/all.min.css">
|
||||
<!-- Ionicons -->
|
||||
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
|
||||
<!-- DataTables -->
|
||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/datatables-bs4/css/dataTables.bootstrap4.css">
|
||||
<!-- Tempusdominus Bbootstrap 4 -->
|
||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css">
|
||||
<!-- iCheck -->
|
||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/icheck-bootstrap/icheck-bootstrap.min.css">
|
||||
<!-- JQVMap -->
|
||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/jqvmap/jqvmap.min.css">
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="lib/AdminLTE/dist/css/adminlte.min.css">
|
||||
<!-- overlayScrollbars -->
|
||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
|
||||
<!-- Daterange picker -->
|
||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/daterangepicker/daterangepicker.css">
|
||||
<!-- summernote -->
|
||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/summernote/summernote-bs4.css">
|
||||
<!-- Google Font: Source Sans Pro -->
|
||||
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
|
||||
|
||||
<!-- Bootstrap Date-Picker Plugin -->
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/css/bootstrap-datepicker3.css"/>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="css/dashboard.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/general.css">
|
||||
|
||||
<link rel="icon" type="image/png" href="/favicon.png">
|
||||
|
||||
|
||||
</head>
|
||||
<body class="hold-transition sidebar-mini layout-fixed">
|
||||
<div class="wrapper">
|
||||
<!-- Main Sidebar Container -->
|
||||
<aside class="main-sidebar sidebar-dark-primary elevation-4">
|
||||
<!-- Brand Logo -->
|
||||
<a href="ShedulePickUp.html" class="brand-link">
|
||||
<img src="/favicon.png" alt="AdminLTE Logo"
|
||||
class="brand-image img-circle elevation-3"
|
||||
style="opacity: .8">
|
||||
<span class="brand-text font-weight-light">Waste Control</span>
|
||||
</a>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar">
|
||||
<!-- Sidebar user panel (optional) -->
|
||||
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
|
||||
<div class="image">
|
||||
<!-- <img src="lib/AdminLTE/dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image"> -->
|
||||
<i class="nav-icon fas fa-user img-circle elevation-2" style="color:white"></i>
|
||||
</div>
|
||||
<!-- <i class="nav-icon fas fa-tachometer-alt"></i> -->
|
||||
<div class="info">
|
||||
<a href="user.html" class="d-block" id="userlabel">Username to set!</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sidebar Menu -->
|
||||
<nav class="mt-2">
|
||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
|
||||
data-accordion="false">
|
||||
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="ShedulePickUp.html" class="nav-link">
|
||||
<i class="nav-icon fas fa-calendar-alt"></i>
|
||||
<p>
|
||||
Shedule Pick-up
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="dashboard.html" class="nav-link">
|
||||
<i class="nav-icon fas fa-columns"></i>
|
||||
<p>
|
||||
Dashboard
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li id="devicepanel" class="nav-item">
|
||||
<a href="device.html" class="nav-link">
|
||||
<i class="nav-icon fas fa-desktop"></i>
|
||||
<p>
|
||||
Devices
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="#todo" class="nav-link">
|
||||
<i class="nav-icon fas fa-plus-circle"></i>
|
||||
<p>
|
||||
New Entry
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li id="adminpanel" class="nav-item hideit">
|
||||
<a href="adminpanel.html" class="nav-link">
|
||||
<i class="nav-icon fas fa-plus-circle"></i>
|
||||
<p>
|
||||
Admin panel
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="#todo" class="nav-link">
|
||||
<i class="nav-icon fas fa-cog"></i>
|
||||
<p>
|
||||
Settings
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="index.html" class="nav-link" id="logoutbtn">
|
||||
<i class="nav-icon fas fa-sign-out-alt"></i>
|
||||
<p>
|
||||
Logout
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
</div>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
|
||||
<!-- Content Wrapper. Contains page content -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0 text-dark">Dashboard</h1>
|
||||
</div><!-- /.col -->
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item"><a href="#">Home</a></li>
|
||||
<li class="breadcrumb-item active">Shedule Puck-up</li>
|
||||
</ol>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<!-- Small boxes (Stat box) -->
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-6">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-info">
|
||||
<div class="inner">
|
||||
<h3 id="total-connection-labels">42</h3>
|
||||
|
||||
<p>Total collections</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-bag"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
<div class="col-lg-3 col-6">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-gray">
|
||||
<div class="inner">
|
||||
<h3 id="total-city-number-label">42</h3>
|
||||
|
||||
<p>total collect zones</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-android-globe" style="color: lightgrey"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
<div class="col-lg-3 col-6">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-warning">
|
||||
<div class="inner">
|
||||
<h3 id="planed-collection-label">44</h3>
|
||||
|
||||
<p>Planned Collections</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-calendar"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
<div class="col-lg-3 col-6">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-success">
|
||||
<div class="inner">
|
||||
<h3 id="finished-collection-label">65</h3>
|
||||
|
||||
<p>Finished Collections</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-android-checkmark-circle"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
<!-- Main row -->
|
||||
<div class="row">
|
||||
<!-- Left col -->
|
||||
<section class="col-lg-7 connectedSortable">
|
||||
<!-- Custom tabs (Charts with tabs)-->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
<i class="fas fa-chart-pie mr-1"></i>
|
||||
All pickupdats
|
||||
</h3>
|
||||
</div><!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<table id="table-pickupdates" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<i class="fas fa-city"></i>
|
||||
City</th>
|
||||
<th><i class="fas fa-search-location"></i>
|
||||
Zone</th>
|
||||
<th><i class="fas fa-recycle"></i>
|
||||
Waste Type</th>
|
||||
<th><i class="fas fa-calendar-alt"></i>
|
||||
Date</th>
|
||||
<th><i class="fas fa-trash-alt"></i>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="picupdates-tablebody">
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>
|
||||
<i class="fas fa-city"></i>
|
||||
City</th>
|
||||
<th><i class="fas fa-search-location"></i>
|
||||
Zone</th>
|
||||
<th><i class="fas fa-recycle"></i>
|
||||
Waste Type</th>
|
||||
<th><i class="fas fa-calendar-alt"></i>
|
||||
Date</th>
|
||||
<th><i class="fas fa-trash-alt"></i>
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div><!-- /.card-body -->
|
||||
</div>
|
||||
<!-- /.card -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
<i class="fas fa-chart-pie mr-1"></i>
|
||||
New City
|
||||
</h3>
|
||||
<button id="btn-savecity" type="button" class="btn btn-success"
|
||||
style="float:right;">Save
|
||||
</button>
|
||||
</div><!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="form-group" style="margin-top: 15px; width: 10cm;">
|
||||
<label for="new_city_cityname">City/Village name</label>
|
||||
<input type="email" class="form-control" id="new_city_cityname"
|
||||
aria-describedby="emailHelp" placeholder="Enter city name here">
|
||||
<small class="form-text text-muted">Please try to use no special
|
||||
characters</small>
|
||||
</div>
|
||||
<div class="form-group" style="width: 10cm;">
|
||||
<label for="new_city_zonename">Zone Name</label>
|
||||
<input type="email" class="form-control" id="new_city_zonename"
|
||||
aria-describedby="emailHelp" placeholder="Enter Zone name here">
|
||||
<small class="form-text text-muted">Please try to use no special
|
||||
characters</small>
|
||||
</div>
|
||||
|
||||
<div class="input-group-prepend">
|
||||
<button id="dropdown-wastetype" type="button"
|
||||
class="btn btn-outline-dark dropdown-toggle"
|
||||
data-toggle="dropdown">
|
||||
Select waste type
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="wastetype-citynew-item dropdown-item" href="#">Plastic</a>
|
||||
<a class="wastetype-citynew-item dropdown-item" href="#">Metal</a>
|
||||
<a class="wastetype-citynew-item dropdown-item" href="#">Residual waste</a>
|
||||
<a class="wastetype-citynew-item dropdown-item" href="#">Biowaste</a>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.card-body -->
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Custom tabs (Charts with tabs)-->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
<i class="fas fa-chart-pie mr-1"></i>
|
||||
New Pick up date
|
||||
</h3>
|
||||
</div><!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<form>
|
||||
|
||||
<h4>Add Data:</h4>
|
||||
<div class="input-group mt-3 mb-3" style="width: 100%;">
|
||||
|
||||
<div class="input-group-prepend">
|
||||
<button id="dropdown-city" type="button"
|
||||
class="btn btn-outline-dark dropdown-toggle"
|
||||
data-toggle="dropdown">
|
||||
Select city
|
||||
</button>
|
||||
<div id="dropdown-city-data" class="dropdown-menu">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group-prepend">
|
||||
<button id="dropdown-zone" type="button"
|
||||
class="btn btn-outline-dark dropdown-toggle"
|
||||
data-toggle="dropdown">
|
||||
Select Zone
|
||||
</button>
|
||||
<div id="dropdown-zone-data" class="dropdown-menu">
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group-prepend">
|
||||
<button id="dropdown-type-data" type="button"
|
||||
class="btn btn-outline-dark dropdown-toggle"
|
||||
data-toggle="dropdown">
|
||||
Select waste type
|
||||
</button>
|
||||
<div id="dropdown-type-drops" class="dropdown-menu">
|
||||
</div>
|
||||
</div>
|
||||
<input id="input-wastetime" style="width: 50px;" class="form-control" id="date"
|
||||
name="date" placeholder="MM/DD/YYY" type="text"/>
|
||||
<button type="button" class="btn-savelist btn btn-success"
|
||||
style="float:right;">Save
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div><!-- /.card-body -->
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<!-- /.Left col -->
|
||||
<!-- right col (We are only adding the ID to make the widgets sortable)-->
|
||||
<section class="col-lg-5 connectedSortable">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
<i class="fas fa-chart-pie mr-1"></i>
|
||||
Pick up locations
|
||||
</h3>
|
||||
</div><!-- /.card-header -->
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<table id="example2" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<i class="fas fa-city"></i>
|
||||
City</th>
|
||||
<th><i class="fas fa-search-location"></i>
|
||||
Zone</th>
|
||||
<th><i class="fas fa-recycle"></i>
|
||||
Waste Type</th>
|
||||
<th><i class="fas fa-calendar-alt"></i>
|
||||
Date</th>
|
||||
<th><i class="fas fa-trash-alt"></i>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="location-table-data">
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>
|
||||
<i class="fas fa-city"></i>
|
||||
City</th>
|
||||
<th><i class="fas fa-search-location"></i>
|
||||
Zone</th>
|
||||
<th><i class="fas fa-recycle"></i>
|
||||
Waste Type</th>
|
||||
<th><i class="fas fa-calendar-alt"></i>
|
||||
Date</th>
|
||||
<th><i class="fas fa-trash-alt"></i>
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
|
||||
<!-- /.card -->
|
||||
</section>
|
||||
<!-- right col -->
|
||||
</div>
|
||||
<!-- /.row (main row) -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
<footer class="main-footer">
|
||||
<strong>By Gregor Dutzler & Lukas Heiligenbrunner & Emil Meindl</strong>
|
||||
<div id="version-footer-label" class="float-right d-none d-sm-inline-block">
|
||||
<b>Version</b> 3.0.0
|
||||
<b>Build</b> 2019-8-8 9:30
|
||||
</div>
|
||||
|
||||
|
||||
</footer>
|
||||
|
||||
<!-- Control Sidebar -->
|
||||
<aside class="control-sidebar control-sidebar-dark">
|
||||
<!-- Control sidebar content goes here -->
|
||||
</aside>
|
||||
<!-- /.control-sidebar -->
|
||||
</div>
|
||||
<!-- ./wrapper -->
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="lib/AdminLTE/plugins/jquery/jquery.min.js"></script>
|
||||
<!-- jQuery UI 1.11.4 -->
|
||||
<script src="lib/AdminLTE/plugins/jquery-ui/jquery-ui.min.js"></script>
|
||||
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
|
||||
<script>
|
||||
$.widget.bridge('uibutton', $.ui.button)
|
||||
</script>
|
||||
<!-- Bootstrap 4 -->
|
||||
<script src="lib/AdminLTE/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- ChartJS -->
|
||||
<script src="lib/AdminLTE/plugins/chart.js/Chart.min.js"></script>
|
||||
<!-- Sparkline -->
|
||||
<script src="lib/AdminLTE/plugins/sparklines/sparkline.js"></script>
|
||||
<!-- JQVMap -->
|
||||
<script src="lib/AdminLTE/plugins/jqvmap/jquery.vmap.min.js"></script>
|
||||
<script src="lib/AdminLTE/plugins/jqvmap/maps/jquery.vmap.usa.js"></script>
|
||||
<!-- jQuery Knob Chart -->
|
||||
<script src="lib/AdminLTE/plugins/jquery-knob/jquery.knob.min.js"></script>
|
||||
<!-- daterangepicker -->
|
||||
<script src="lib/AdminLTE/plugins/moment/moment.min.js"></script>
|
||||
<script src="lib/AdminLTE/plugins/daterangepicker/daterangepicker.js"></script>
|
||||
<!-- Tempusdominus Bootstrap 4 -->
|
||||
<script src="lib/AdminLTE/plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
|
||||
<!-- Summernote -->
|
||||
<script src="lib/AdminLTE/plugins/summernote/summernote-bs4.min.js"></script>
|
||||
<!-- overlayScrollbars -->
|
||||
<script src="lib/AdminLTE/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="lib/AdminLTE/dist/js/adminlte.js"></script>
|
||||
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
|
||||
<script src="lib/AdminLTE/dist/js/pages/dashboard.js"></script>
|
||||
<!-- AdminLTE for demo purposes -->
|
||||
<script src="lib/AdminLTE/dist/js/demo.js"></script>
|
||||
|
||||
<script type="text/javascript"
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script>
|
||||
|
||||
<!-- DataTables -->
|
||||
<script src="lib/AdminLTE/plugins/datatables/jquery.dataTables.js"></script>
|
||||
<script src="lib/AdminLTE/plugins/datatables-bs4/js/dataTables.bootstrap4.js"></script>
|
||||
|
||||
<script src="lib/AdminLTE/plugins/sweetalert2/sweetalert2.all.js"></script>
|
||||
|
||||
<!-- OWN -->
|
||||
|
||||
<script type="text/javascript" src="js/dashboard.js"></script>
|
||||
<script src="js/userManager.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -70,6 +70,36 @@
|
||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
|
||||
data-accordion="false">
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="dashboard.html" class="nav-link">
|
||||
<i class="nav-icon fas fa-columns"></i>
|
||||
<p>
|
||||
Dashboard
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="devicepanel" class="nav-item">
|
||||
<a href="device.html" class="nav-link">
|
||||
<i class="nav-icon fas fa-desktop"></i>
|
||||
<p>
|
||||
Devices
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="adminpanel" class="nav-item hideit">
|
||||
<a href="adminpanel.html" class="nav-link">
|
||||
<i class="nav-icon fas fa-plus-circle"></i>
|
||||
<p>
|
||||
Admin panel
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="#todo" class="nav-link">
|
||||
<i class="nav-icon fas fa-cog"></i>
|
||||
@ -79,6 +109,7 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="index.html" class="nav-link" id="logoutbtn">
|
||||
<i class="nav-icon fas fa-sign-out-alt"></i>
|
||||
@ -88,23 +119,7 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="#todo" class="nav-link">
|
||||
<i class="nav-icon fas fa-plus-circle"></i>
|
||||
<p>
|
||||
New Entry
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li id="adminpanel" class="nav-item hideit">
|
||||
<a href="adminpanel.html" class="nav-link">
|
||||
<i class="nav-icon fas fa-plus-circle"></i>
|
||||
<p>
|
||||
Admin panel
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
|
@ -73,22 +73,23 @@
|
||||
data-accordion="false">
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="#todo" class="nav-link">
|
||||
<i class="nav-icon fas fa-cog"></i>
|
||||
<a href="dashboard.html" class="nav-link">
|
||||
<i class="nav-icon fas fa-columns"></i>
|
||||
<p>
|
||||
Settings
|
||||
Dashboard
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<li id="devicepanel" class="nav-item">
|
||||
<a href="device.html" class="nav-link">
|
||||
<i class="nav-icon fas fa-desktop"></i>
|
||||
<p>
|
||||
Devices
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="index.html" class="nav-link" id="logoutbtn">
|
||||
<i class="nav-icon fas fa-sign-out-alt"></i>
|
||||
<p>
|
||||
Logout
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="adminpanel" class="nav-item hideit">
|
||||
<a href="adminpanel.html" class="nav-link">
|
||||
@ -99,11 +100,21 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li id="devicepanel" class="nav-item">
|
||||
<a href="device.html" class="nav-link">
|
||||
<i class="nav-icon fas fa-plus-circle"></i>
|
||||
<li class="nav-item">
|
||||
<a href="#todo" class="nav-link">
|
||||
<i class="nav-icon fas fa-cog"></i>
|
||||
<p>
|
||||
Devices
|
||||
Settings
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="index.html" class="nav-link" id="logoutbtn">
|
||||
<i class="nav-icon fas fa-sign-out-alt"></i>
|
||||
<p>
|
||||
Logout
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
@ -217,22 +228,23 @@
|
||||
<table id="table-pickupdates" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>City</th>
|
||||
<th>Zone</th>
|
||||
<th>Waste Type</th>
|
||||
<th>Date</th>
|
||||
<th>X</th>
|
||||
<th><i class="fas fa-city"></i>City</th>
|
||||
<th><i class="fas fa-search-location"></i>Zone</th>
|
||||
<th><i class="fas fa-recycle"></i>Waste Type</th>
|
||||
<th><i class="fas fa-calendar-alt"></i>Date</th>
|
||||
<th><i class="fas fa-trash-alt"></i></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="picupdates-tablebody">
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>City</th>
|
||||
<th>Zone</th>
|
||||
<th>Waste Type</th>
|
||||
<th>Date</th>
|
||||
<th>X</th>
|
||||
<th><i class="fas fa-city"></i>City</th>
|
||||
<th><i class="fas fa-search-location"></i>Zone</th>
|
||||
<th><i class="fas fa-recycle"></i>Waste Type</th>
|
||||
<th><i class="fas fa-calendar-alt"></i>Date</th>
|
||||
<th><i class="fas fa-trash-alt"></i>
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@ -322,6 +334,7 @@
|
||||
data-toggle="dropdown">
|
||||
Select waste type
|
||||
</button>
|
||||
|
||||
<div id="dropdown-type-drops" class="dropdown-menu">
|
||||
</div>
|
||||
</div>
|
||||
@ -353,20 +366,25 @@
|
||||
<table id="example2" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>City</th>
|
||||
<th>Zone</th>
|
||||
<th>Waste Type</th>
|
||||
<th>X</th>
|
||||
<th>
|
||||
<i class="fas fa-city"></i>
|
||||
City</th>
|
||||
<th><i class="fas fa-search-location"></i>
|
||||
Zone</th>
|
||||
<th><i class="fas fa-recycle"></i>
|
||||
Waste Type</th>
|
||||
<th><i class="fas fa-trash-alt"></i>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="location-table-data">
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>City</th>
|
||||
<th>Zone</th>
|
||||
<th>Waste Type</th>
|
||||
<th>X</th>
|
||||
<th><i class="fas fa-city"></i>City</th>
|
||||
<th><i class="fas fa-search-location"></i>Zone</th>
|
||||
<th><i class="fas fa-recycle"></i>Waste Type</th>
|
||||
<th><i class="fas fa-trash-alt"></i></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
@ -51,6 +51,7 @@
|
||||
<span class="brand-text font-weight-light">Waste Control</span>
|
||||
</a>
|
||||
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar">
|
||||
<!-- Sidebar user panel (optional) -->
|
||||
@ -71,23 +72,26 @@
|
||||
data-accordion="false">
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="#todo" class="nav-link">
|
||||
<i class="nav-icon fas fa-cog"></i>
|
||||
<a href="dashboard.html" class="nav-link">
|
||||
<i class="nav-icon fas fa-columns"></i>
|
||||
<p>
|
||||
Settings
|
||||
Dashboard
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="index.html" class="nav-link" id="logoutbtn">
|
||||
<i class="nav-icon fas fa-sign-out-alt"></i>
|
||||
|
||||
<li id="devicepanel" class="nav-item">
|
||||
<a href="device.html" class="nav-link">
|
||||
<i class="nav-icon fas fa-desktop"></i>
|
||||
<p>
|
||||
Logout
|
||||
Devices
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="adminpanel" class="nav-item hideit">
|
||||
<a href="adminpanel.html" class="nav-link">
|
||||
<i class="nav-icon fas fa-plus-circle"></i>
|
||||
@ -97,14 +101,25 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li id="devicepanel" class="nav-item">
|
||||
<a href="device.html" class="nav-link">
|
||||
<i class="nav-icon fas fa-plus-circle"></i>
|
||||
<li class="nav-item">
|
||||
<a href="#todo" class="nav-link">
|
||||
<i class="nav-icon fas fa-cog"></i>
|
||||
<p>
|
||||
Devices
|
||||
Settings
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="index.html" class="nav-link" id="logoutbtn">
|
||||
<i class="nav-icon fas fa-sign-out-alt"></i>
|
||||
<p>
|
||||
Logout
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
@ -141,9 +156,9 @@
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-info">
|
||||
<div class="inner">
|
||||
<h3>TODO</h3>
|
||||
<h3 id="devicenr-label">-1</h3>
|
||||
|
||||
<p>Todo</p>
|
||||
<p>Devices</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-bag"></i>
|
||||
@ -156,9 +171,9 @@
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-success">
|
||||
<div class="inner">
|
||||
<h3>TODO</h3>
|
||||
<h3 id="unconfigured-devices-label">-1</h3>
|
||||
|
||||
<p>Devices</p>
|
||||
<p>Not Configured Devices</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-stats-bars"></i>
|
||||
@ -186,22 +201,22 @@
|
||||
<table id="table-devices" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Device ID</th>
|
||||
<th>Devicename</th>
|
||||
<th>Devicelocation</th>
|
||||
<th>WasteType</th>
|
||||
<th>Action</th>
|
||||
<th><i class="fas fa-id-card"></i> Device ID</th>
|
||||
<th><i class="fas fa-signature"></i> Devicename</th>
|
||||
<th><i class="fas fa-search-location"></i> Devicelocation</th>
|
||||
<th><i class="fas fa-recycle"></i> WasteType</th>
|
||||
<th><i class="fas fa-edit"></i> Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="devices-tablebody">
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Device ID</th>
|
||||
<th>Devicename</th>
|
||||
<th>Devicelocation</th>
|
||||
<th>WasteType</th>
|
||||
<th>Action</th>
|
||||
<th><i class="fas fa-id-card"></i> Device ID</th>
|
||||
<th><i class="fas fa-signature"></i> Devicename</th>
|
||||
<th><i class="fas fa-search-location"></i> Devicelocation</th>
|
||||
<th><i class="fas fa-recycle"></i> WasteType</th>
|
||||
<th><i class="fas fa-edit"></i> Action</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
@ -1,11 +1,12 @@
|
||||
$(document).ready(function () {
|
||||
$(function () {
|
||||
new Device();
|
||||
});
|
||||
|
||||
|
||||
class Device {
|
||||
constructor() {
|
||||
this.reloadDevices()
|
||||
this.reloadDevices();
|
||||
this.loadHeader();
|
||||
}
|
||||
|
||||
devicetable = null;
|
||||
@ -36,7 +37,6 @@ class Device {
|
||||
var devicelocation = data.data[i].devicelocation;
|
||||
|
||||
var row = "<tr><td>" + id + "</td><td>" + devicename + "</td><td>" + devicelocation + "</td><td>";
|
||||
|
||||
for (var n = 0; n < data.data[i].devices.length; n++) {
|
||||
var cityname = data.data[i].devices[n].cityname;
|
||||
var cityzone = data.data[i].devices[n].zone;
|
||||
@ -51,9 +51,9 @@ class Device {
|
||||
}
|
||||
}
|
||||
|
||||
_this.addDeleteButton();
|
||||
_this.addAddButton();
|
||||
_this.addConfigDialog();
|
||||
_this._addDeleteButton();
|
||||
_this._addAddButton();
|
||||
_this._addConfigDialog();
|
||||
_this.devicetable = $('#table-devices').DataTable();
|
||||
}, 'json');
|
||||
}
|
||||
@ -61,7 +61,8 @@ class Device {
|
||||
/**
|
||||
* add click listener to add button to add new city entries to current device
|
||||
*/
|
||||
addAddButton() {
|
||||
_addAddButton() {
|
||||
var _this = this;
|
||||
$('.addbtn').click(function (event) {
|
||||
var id = event.target.getAttribute("dataid");
|
||||
var cityname;
|
||||
@ -84,8 +85,6 @@ class Device {
|
||||
}
|
||||
]).then((result) => {
|
||||
if (result.value) {
|
||||
console.log(result.value);
|
||||
const answers = JSON.stringify(result.value);
|
||||
cityname = result.value[0];
|
||||
|
||||
console.log("cityname=" + cityname);
|
||||
@ -104,7 +103,6 @@ class Device {
|
||||
}
|
||||
]).then((result) => {
|
||||
if (result.value) {
|
||||
console.log(result.value);
|
||||
zone = result.value[0];
|
||||
$.post('/senddata/Devicedata', 'action=gettypes&cityname=' + cityname + '&zonename=' + zone, function (data) {
|
||||
Swal.mixin({
|
||||
@ -121,11 +119,8 @@ class Device {
|
||||
}
|
||||
]).then((result) => {
|
||||
if (result.value) {
|
||||
console.log(result.value);
|
||||
wastetype = result.value[0];
|
||||
|
||||
|
||||
//todo add to db
|
||||
$.post('/senddata/Devicedata', 'action=addtodb&deviceid=' + id + '&cityname=' + cityname + '&zonename=' + zone + '&wastetype=' + wastetype, function (data) {
|
||||
if (data.success) {
|
||||
Swal.fire({
|
||||
@ -134,8 +129,7 @@ class Device {
|
||||
html: 'This alert closes added.',
|
||||
timer: 1000,
|
||||
}).then((result) => {
|
||||
console.log('Popup closed. ');
|
||||
reloadDevices();
|
||||
_this.reloadDevices();
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -154,7 +148,7 @@ class Device {
|
||||
/**
|
||||
* add click listener to delete button to delete this device entry
|
||||
*/
|
||||
addDeleteButton() {
|
||||
_addDeleteButton() {
|
||||
var _this = this;
|
||||
$(".delbtn").click(function (event) {
|
||||
var id = event.target.getAttribute("dataid");
|
||||
@ -191,7 +185,8 @@ class Device {
|
||||
/**
|
||||
* add click listener to unconfigured device to show configure dialog
|
||||
*/
|
||||
addConfigDialog() {
|
||||
_addConfigDialog() {
|
||||
var _this = this;
|
||||
$(".configuredevicebutton").click(function (event) {
|
||||
var id = event.target.getAttribute("deviceid");
|
||||
var cityname;
|
||||
@ -272,7 +267,7 @@ class Device {
|
||||
timer: 1000,
|
||||
}).then((result) => {
|
||||
console.log('Popup closed. ');
|
||||
reloadDevices();
|
||||
_this.reloadDevices();
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -285,10 +280,18 @@ class Device {
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
console.log("click..." + id);
|
||||
/**
|
||||
* Load header tiles
|
||||
*/
|
||||
loadHeader(){
|
||||
$.post('/senddata/Devicedata', 'action=getheader', function (data) {
|
||||
if (data.success) {
|
||||
$("#devicenr-label").html(data.devicenumber);
|
||||
$("#unconfigured-devices-label").html(data.unconfigureddevices);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,14 +88,7 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="#todo" class="nav-link">
|
||||
<i class="nav-icon fas fa-plus-circle"></i>
|
||||
<p>
|
||||
New Entry
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
|
Reference in New Issue
Block a user