Add Container Feature

This commit is contained in:
Katharina 2019-02-22 20:47:26 +01:00 committed by /jedi/
parent 33ec4480d6
commit fef7701152
3 changed files with 32 additions and 27 deletions

View file

@ -10,6 +10,9 @@
#img-upload{
width: 100%;
}
#img-zoom{
width: 100%;
}
</style>
<div class="container-fluid">
@ -53,6 +56,7 @@
<p><input type="text" class="form-control" placeholder="WAS" name="was" id="was" value=""></p>
<p><input type="text" class="form-control" placeholder="WANN" name="wann" id="wann" value=""></p>
<p><input type="text" class="form-control" placeholder="WO" name="wo" id="wo" value=""></p>
<p><input type="text" class="form-control" placeholder="KISTE" name="container" id="container" value=""></p>
<div class="form-group">
<div class="input-group">
@ -84,9 +88,9 @@
<!-- Modal Picture Zoom -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal fade bd-example-modal-lg" id="exampleModal_picture" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content" >
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
@ -94,11 +98,10 @@
</button>
</div>
<div class="modal-body">
<img id='img-upload' src="/upload/"/>
<img id='img-zoom' src="/upload/"/>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
@ -118,6 +121,7 @@
<th>was</th>
<th>wann</th>
<th>wo</th>
<th>kiste</th>
<th>foto</th>
<th></th>
</tr>
@ -128,6 +132,7 @@
<th>was</th>
<th>wann</th>
<th>wo</th>
<th>kiste</th>
<th>foto</th>
<th></th>
</tr>
@ -141,13 +146,14 @@
<td><?php echo $item["was"]; ?></td>
<td><?php echo $item["wann"]; ?></td>
<td><?php echo $item["wo"]; ?></td>
<td><button style="background: url(/upload/<?php echo $item["hash"]; ?>)" ... /></td>
<td><?php echo $item["container"];?></td>
<td><button class="btn btn-link" data-toggle="modal" data-target="#exampleModal_picture" onclick="show_picture('<?php echo $item["hash"]; ?>')"><img style="height: 48px;" src="/upload/<?php echo $item["hash"]; ?>"></button></td>
<!--<td><img style="height: 48px;" src="/upload/<?php echo $item["hash"]; ?>"></td>-->
<td>
<div class="btn-group" role="group">
<button type="button" class="btn btn-outline-secondary"><i class="fas fa-fw fa-check-circle"></i></button>
<!--<a href="/found_item_edit/<?php echo $item["id"]; ?>/" type="button" class="btn btn-outline-secondary"><i class="fas fa-fw fa-edit"></i></a>-->
<button type="button" class="btn btn-outline-secondary" data-toggle="modal" data-target="#exampleModal" onclick="fill_edit_form(<?php echo $item["id"]; ?>,'<?php echo $item["was"]; ?>','<?php echo $item["wann"]; ?>','<?php echo $item["wo"]; ?>','<?php echo $item["hash"]; ?>')">
<button type="button" class="btn btn-outline-secondary" data-toggle="modal" data-target="#exampleModal" onclick="fill_edit_form(<?php echo $item["id"]; ?>,'<?php echo $item["was"]; ?>','<?php echo $item["wann"]; ?>','<?php echo $item["wo"]; ?>','<?php echo $item["hash"]; ?>','<?php echo $item["container"];?>')">
<i class="fas fa-fw fa-edit"></i>
</button>
<button type="button" class="btn btn-outline-danger" onclick="delete_item(<?php echo $item["id"]; ?>)"><i class="fas fa-fw fa-trash-alt"></i></button>
@ -181,23 +187,19 @@
<script>
function fill_edit_form(id, was, wann, wo, hash) {
function fill_edit_form(id, was, wann, wo, hash, container) {
document.getElementById('id').value = id;
document.getElementById('was').value = was;
document.getElementById('wann').value = wann;
document.getElementById('wo').value = wo;
document.getElementById('container').value = container;
document.getElementById('img-upload').src = "/upload/"+hash;
/*document.charset = "UTF-8";
document.open("text/html");
document.write("<html>");
document.write("<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><\/head>");
document.write("<body>");
document.write(PaketL + PaketB + PaketH + Raum);
document.write("<\/body><\/html>");
document.close();*/
}
function show_picture(hash){
document.getElementById('img-zoom').src = "/upload/"+hash;
}
function delete_item(id){