donation/app/Views/donations_accepted.php
2024-02-26 17:22:11 +05:30

102 lines
3.8 KiB
PHP

<html>
<head>
</head>
<style>
/* CSS for the preview image */
.preview-image {
display: block;
/* Ensure the image is displayed as a block element */
width: 120px;
/* Set the desired width for passport size */
height: 160px;
/* Set the desired height for passport size */
object-fit: cover;
/* Maintain the aspect ratio and fill the container */
margin-top: 10px;
/* Add a top margin for spacing */
}
</style>
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<h4 class="header-title"><?= $page_name; ?></h4>
<p class="sub-header"> </p>
<?php if (session()->getFlashdata('success')) : ?>
<div class="alert alert-success"><?= session()->getFlashdata('success') ?></div>
<?php endif; ?>
<form class="needs-validation" novalidate method="post" enctype="multipart/form-data"
action="<?= base_url() . "save_donations_accepted"; ?>" id="myForm">
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-6">
<label for="title" class="col-form-label">Name<span class="text-danger">*</span></label>
<select class="form-control" placeholder="PAN Number" id="name" name="name[]" required data-toggle="select2" multiple >
<option value="0" disabled>--Select--</option>
<?php foreach ($list as $val) : ?>
<option value="<?= $val->id ?>" <?php if ($val->is_active == 1) echo "selected"; ?> > <?= $val->name ?> </option>
<?php endforeach; ?>
</select>
<div class="invalid-feedback"> Please provide. </div>
</div>
<div class="form-group col-md-6"></div>
</div>
</div>
<div class="form-group text-right m-b-0">
<button class="btn btn-success waves-effect waves-light mr-1" id="submitBtn" type="submit">Submit</button>
<a class="btn btn-secondary waves-effect" href="donations_accepted">Cancel</a>
<!-- <button onclick="history.back()" class="btn btn-secondary waves-effect">Cancel</button> -->
</div>
</div>
</form>
</div> <!-- end card-body-->
</div> <!-- end card-->
</div> <!-- end col-->
</div><!-- end row -->
<script>
$(function() {
role = "<?php echo get_user_role() ?>";
console.log(role);
if(role == "auditor")
{
// for input
var formElements = document.querySelectorAll('#myForm input, #myForm textarea');
formElements.forEach(function(element) {
element.setAttribute('readonly', true);
});
// for select
var formElements = document.querySelectorAll('#myForm select');
formElements.forEach(function(element) {
element.setAttribute('disabled', true);
});
$('#submitBtn').attr('disabled', true);
}
else
{
// for input
// var formElements = document.querySelectorAll('#myForm input, #myForm textarea');
// formElements.forEach(function(element) {
// element.setAttribute('readonly', false);
// });
// // for select
// var formElements = document.querySelectorAll('form select');
// formElements.forEach(function(element) {
// element.setAttribute('disabled', false);
// });
}
});
</script>
</body>
</html>