i was wondering why does my modal in attire.php does not appear while in menu.php it appears. I use the same classes for every modals in each files. Please help me….
menu.php
<button type="button" class="btn btn-sm btn-dark btn-icon d-flex align-items-center me-2" data-bs-toggle="modal" data-bs-target="#modalAdd">
<span class="btn-inner--icon"><i class="fas fa-add d-block me-2"></i></span>
<span class="btn-inner--text">New Menu</span>
</button>
<div class="modal fade modal-lg" id="modalAdd" data-bs-backdrop="static" role="dialog" data-bs-keyboard="false" tabindex="-1" aria-labelledby="modalAddLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="modalAddLabel">Add Menu</h1>
</div>
<form action="menu_crud.php" method="POST" enctype="multipart/form-data">
<div class="modal-body">
<div class="mb-3">
<label class="form-label">Upload Image</label>
<input type="file" class="form-control form-control-lg" name="menu_img">
</div>
<div class="mb-3">
<label class="form-label">Name</label>
<input type="text" class="form-control form-control-lg" name="menu_name" required>
</div>
<div class="row">
<div class="col-md-6 mb-3">
<label class="form-label">Price/pax</label>
<input type="text" class="form-control form-control-lg" name="price_per_pax" required>
</div>
<div class="col-md-6 mb-3">
<label class="form-label">Category</label>
<select class="form-select form-select-lg" name="menu_ctg_id">
<option value="" selected disabled>Select Category</option>
<?php
$categories = mysqli_query($con, "SELECT * FROM menu_category");
if (mysqli_num_rows($categories) > 0) {
foreach ($categories as $category) {
?>
<option value="<?= $category['menu_ctg_id'] ?>"><?= $category['ctg_name'] ?></option>
<?php
}
} else {
echo "No category available";
}
?>
</select>
</div>
</div>
<div class="mb-3">
<label class="form-label">Description</label>
<textarea class="form-control form-control-lg" name="description" required></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-white mb-0" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-sm btn-dark mb-0" name="addmenu">Save</button>
</div>
</form>
</div>
</div>
</div>
<!-- End Modal Add -->
attire.php
<button type="button" class="btn btn-sm btn-dark btn-icon d-flex align-items-center me-2" data-bs-toggle="modal" data-bs-target="#modalAdd">
<span class="btn-inner--icon"><i class="fas fa-add d-block me-2"></i></span>
</span><span class="btn-inner--text">New attire</span>
</button>
<div class="modal fade modal-lg" id="modalAdd" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="modalAddLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="modalAddLabel">Add attire</h1>
</div>
<form action="attire_crud.php" method="POST" enctype="multipart/form-data">
<div class="modal-body">
<div class="mb-3">
<label class="form-label">Upload attire Image</label>
<input type="file" class="form-control form-control-lg" name="attire_img">
</div>
<div class="mb-3">
<label class="form-label">attire Name</label>
<input type="text" class="form-control form-control-lg" name="attire_name" required>
</div>
<div class="row">
<div class="col-md-6 mb-3">
<label class="form-label">attire Type</label>
<input type="text" class="form-control form-control-lg" name="attire_type" required>
</div>
<div class="col-md-6 mb-3">
<label class="form-label">attire Size</label>
<input type="text" class="form-control form-control-lg" name="attire_size" required>
</div>
</div>
<div class="row">
<div class="col-md-6 mb-3">
<label class="form-label">attire Price</label>
<input type="text" class="form-control form-control-lg" name="attire_price" required>
</div>
<div class="col-md-6 mb-3">
<label class="form-label">Promotion ID</label>
<select class="form-select form-select-lg" name="promo_id">
<option value="" selected disabled>Select Promotion ID</option>
<?php
$promoQuery = mysqli_query($con, "SELECT promo_id, promo_name FROM promotions");
while ($promoData = mysqli_fetch_assoc($promoQuery)) {
echo "<option value="{$promoData['promo_id']}">{$promoData['promo_id']} - {$promoData['promo_name']}</option>";
}
?>
</select>
</div>
</div>
<div class="mb-3">
<label class="form-label">Description</label>
<textarea class="form-control form-control-lg" name="attire_desc" required></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-white mb-0" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-sm btn-dark mb-0" name="addattire">Save</button>
</div>
</form>
</div>
</div>
</div>
<!-- End Modal Add -->
I have tried copied the same modal for both files yet same problem occurs. please help me to review this code and help me to solve this. i have tried to copy the same classess into the same file but it does not appear in the attire.php. i have added all the necessary css and script file but still the same. is there any suggestion on how to overcome this problem?
ZUFARAHA ZAKARIA is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.