82 lines
3.0 KiB
PHP
82 lines
3.0 KiB
PHP
<?php $rPath = "../"; require $rPath.'webdata/init.php'; requireLogin(); ?><!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<?=getHtmlHeaders($rPath);?>
|
|
<title>Plan - PaperBag - Plan Your Shopping</title>
|
|
</head>
|
|
<body id='plan'>
|
|
<div id="page-container">
|
|
<div id="page-wrapper">
|
|
<?php include $rPath.'webdata/navbar.php'; ?>
|
|
<h1 class="headline text-center">PaperBag</h1>
|
|
<div class="container" style="padding-top: 5px; padding-bottom: 15px; text-align: center;">
|
|
|
|
<div id="spaceSelectWrapper" style="max-width: 900px; margin: auto;">
|
|
<div class="input-group" style="width: 200px;">
|
|
<label class="input-group-text" for="spaceSelect">Space:</label>
|
|
<select class="form-select" id='spaceSelect' aria-label="Select space">
|
|
<option>...</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card-columns" id="stores" style="text-align: center;">
|
|
<hr>
|
|
<h5>Please enable javascript for this page to work</h5>
|
|
<hr>
|
|
</div>
|
|
|
|
<div id='totalPriceWrapper'>Space subtotal: <span id="totalPrice" class="priceWrapper price">00.00</span></div>
|
|
<br>
|
|
<button class="btn btn-primary mb-2" id="addStore">Add store</button><br>
|
|
<button class="btn btn-secondary" id="refreshAll">Refresh all</button>
|
|
|
|
</div>
|
|
|
|
<script src='plan.js'></script>
|
|
<script src='recipe.js'></script>
|
|
<script src='draggingClass.js'></script>
|
|
</div>
|
|
<?php include $rPath.'webdata/footer.html'; ?>
|
|
</div>
|
|
|
|
<div class="modal" tabindex="-1" id="addStoreModal">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Add store</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body align-content-center">
|
|
<button class="btn btn-primary" id="addEmptyStore">Empty store</button>
|
|
<hr>
|
|
<div class="accordion mb-2" id="addStoreRecipe"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
let addStoreModal = new bootstrap.Modal( document.getElementById('addStoreModal') );
|
|
|
|
$("#addStore").on('click', ev=>{
|
|
ev.stopPropagation();
|
|
addStoreModal.show();
|
|
});
|
|
|
|
$("#addStoreModal").on('show.bs.modal', ev=> {
|
|
$("#addStoreRecipe").html('');
|
|
|
|
$.getJSON('/api/v1/recipe', {}, resp => {
|
|
let recipes = new Recipe(resp);
|
|
recipes.getAccordionHtml('#addStoreRecipe');
|
|
});
|
|
});
|
|
|
|
$("#addEmptyStore").click(ev => {
|
|
stores.push(new Store());
|
|
addStoreModal.hide();
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|