add multifile support

This commit is contained in:
/jedi/ 2019-03-02 02:16:37 +01:00
parent 34cf28a2b2
commit c11edf96c9
4 changed files with 70 additions and 44 deletions

View file

@ -21,7 +21,7 @@
<input type="text" class="form-control" readonly>
</div>
</div>
<img id='img-upload' src="/upload/<?php echo $item["hash"]; ?>"/>
<img id='img-upload' src="/upload/<?php echo $item["files"][0]["hash"]; ?>"/>
</div>
<p><button type="submit" class="form-control" onclick="edit_found_item(); return false;">Save</button></p>
</form>

View file

@ -43,9 +43,15 @@
<td><?php echo $item["wo"]; ?></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="/thumb/<?php echo $item["hash"]; ?>">
</button>
<?php
if(isset($item["files"])){
?>
<button class="btn btn-link" data-toggle="modal" data-target="#exampleModal_picture" onclick="show_picture('<?php echo $item["files"][0]["hash"]; ?>')">
<img style="height: 48px;" src="/thumb/<?php echo $item["files"][0]["hash"]; ?>">
</button>
<?php
}
?>
</td>
<!--<td><img style="height: 48px;" src="/upload/<?php echo $item["hash"]; ?>"></td>-->
<td>

View file

@ -47,14 +47,17 @@
<script>
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;
function fill_edit_form(item) {
document.getElementById('id').value = item.id;
document.getElementById('was').value = item.was;
document.getElementById('wann').value = item.wann;
document.getElementById('wo').value = item.wo;
document.getElementById('container').value = item.container;
if(item.files&&item.files.length>0){
document.getElementById('img-upload').src = "/upload/"+item.files[0].hash;
}else{
document.getElementById('img-upload').src = "";
}
}