replaced souts with log.debug
This commit is contained in:
@ -57,7 +57,8 @@ justify-content: center;
|
||||
}
|
||||
|
||||
.create-table-window-content{
|
||||
overflow:scroll;
|
||||
height: calc(100% - 90px);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.create-table-window-settings{
|
||||
|
@ -1,29 +1,58 @@
|
||||
$(document).ready(function() {
|
||||
//check login state
|
||||
console.log("page loaded");
|
||||
$.post('/senddata/checkloginstate','action=getloginstate',function(data){
|
||||
console.log(data);
|
||||
if (data.loggedin == true) {
|
||||
$("#userlabel").html(" "+data.username);
|
||||
}else{
|
||||
$("#userlabel").html(" not logged in!!");
|
||||
}
|
||||
},'json');
|
||||
$(document).ready(function () {
|
||||
//check login state
|
||||
console.log("page loaded");
|
||||
$.post('/senddata/checkloginstate', 'action=getloginstate', function (data) {
|
||||
console.log(data);
|
||||
if (data.loggedin == true) {
|
||||
$("#userlabel").html(" " + data.username);
|
||||
} else {
|
||||
$("#userlabel").html(" not logged in!!");
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
|
||||
$('#logoutbtn').click(function () {
|
||||
$.post('/senddata/checkloginstate', 'action=logout', function (data) {
|
||||
console.log(data);
|
||||
}, 'json');
|
||||
});
|
||||
|
||||
$('#logoutbtn').click(function() {
|
||||
$.post('/senddata/checkloginstate','action=logout',function(data){
|
||||
console.log(data);
|
||||
},'json');
|
||||
});
|
||||
$('#addnewtable-btn').click(function () {
|
||||
console.log("clicked");
|
||||
$('.create-table').show();
|
||||
});
|
||||
|
||||
$('#addnewtable-btn').click(function() {
|
||||
console.log("clicked");
|
||||
$('.create-table').show();
|
||||
});
|
||||
$('.exit-icon').click(function () {
|
||||
$('.create-table').hide();
|
||||
});
|
||||
|
||||
$('.exit-icon').click(function() {
|
||||
$('.create-table').hide();
|
||||
});
|
||||
$('.dropdown-item').click(function () {
|
||||
$('#dropdown-wastetype').html($(this).html());
|
||||
});
|
||||
|
||||
$('.btn-addtolist').click(function () {
|
||||
console.log("added new row to table");
|
||||
$('#addtable-body').append("<tr>" +
|
||||
"<td class='td-dropdown-wastetype'>" + $('#dropdown-wastetype').html() + "</td>" +
|
||||
"<td class='td-input-wastetime'>" + $('#input-wastetime').val() + "</td>" +
|
||||
"<td class='td-input-wasteregion'>" + $('#input-wasteregion').val() + "</td>" +
|
||||
"<td class='td-input-wastezone'>" + $('#input-wastezone').val() + "</td>" +
|
||||
"</tr>");
|
||||
});
|
||||
|
||||
$('#btn-savelist').click(function () {
|
||||
console.log("saving list");
|
||||
var wastetypearr = $('.td-dropdown-wastetype');
|
||||
var wastetime = $('.td-input-wastetime');
|
||||
var wasteregionarr = $('.td-input-wasteregion');
|
||||
var wastezonearr = $('.td-input-wastezone');
|
||||
|
||||
for (var i = 0; i < wastetypearr.length; i++) {
|
||||
console.log(wastetypearr[i].innerHTML);
|
||||
$.post('/senddata/wastedata', 'action=senddata&wastetype=' + wastetypearr[i].innerHTML +"&wastetime="+wastetime[i].innerHTML+"&wasteregion="+wasteregionarr[i].innerHTML+"&wastezone="+wastezonearr[i].innerHTML, function (data) {
|
||||
console.log(data);
|
||||
}, 'text');
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
@ -87,7 +87,7 @@
|
||||
<h4>Add Data:</h4>
|
||||
<div class="input-group mt-3 mb-3" style="width: 50%;">
|
||||
<div class="input-group-prepend">
|
||||
<button type="button" class="btn btn-outline-light dropdown-toggle" data-toggle="dropdown">
|
||||
<button id="dropdown-wastetype" type="button" class="btn btn-outline-light dropdown-toggle" data-toggle="dropdown">
|
||||
Select waste type
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
@ -98,7 +98,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input style="width: 50px;" class="form-control" id="date" name="date" placeholder="MM/DD/YYY" type="text"/>
|
||||
<input id="input-wastetime" style="width: 50px;" class="form-control" id="date" name="date" placeholder="MM/DD/YYY" type="text"/>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
@ -114,65 +114,22 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
<input type="text" class="form-control" placeholder="Region">
|
||||
<button type="button" class="btn btn-success" style="float:right;">Add to list</button>
|
||||
<input id="input-wasteregion" type="text" class="form-control" placeholder="Region">
|
||||
<input id="input-wastezone" type="text" class="form-control" placeholder="Zone">
|
||||
<button type="button" class="btn-addtolist btn btn-success" style="float:right;">Add to list</button>
|
||||
</div>
|
||||
|
||||
<h4>Your Data:</h4>
|
||||
<table class="table table-dark table-hover" style="width: 50%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Firstname</th>
|
||||
<th>Lastname</th>
|
||||
<th>Email</th>
|
||||
<th>Waste type</th>
|
||||
<th>Date</th>
|
||||
<th>Region</th>
|
||||
<th>Zone</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Doe</td>
|
||||
<td>john@example.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mary</td>
|
||||
<td>Moe</td>
|
||||
<td>mary@example.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>July</td>
|
||||
<td>Dooley</td>
|
||||
<td>july@example.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>July</td>
|
||||
<td>Dooley</td>
|
||||
<td>july@example.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>July</td>
|
||||
<td>Dooley</td>
|
||||
<td>july@example.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>July</td>
|
||||
<td>Dooley</td>
|
||||
<td>july@example.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>July</td>
|
||||
<td>Dooley</td>
|
||||
<td>july@example.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>July</td>
|
||||
<td>Dooley</td>
|
||||
<td>july@example.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>July</td>
|
||||
<td>Dooley</td>
|
||||
<td>july@example.com</td>
|
||||
</tr>
|
||||
<tbody id="addtable-body">
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
@ -180,7 +137,7 @@
|
||||
|
||||
</div>
|
||||
<div class="create-table-window-bottom">
|
||||
<button type="button" class="btn btn-success" style="float:right;">Save</button>
|
||||
<button id="btn-savelist" type="button" class="btn btn-success" style="float:right;">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user