BBnepal-Accounts/application/views/admin/edit-section.php

76 lines
1.7 KiB
PHP
Raw Normal View History

2024-07-10 12:43:19 +00:00
<style>
.error {
color : red;
}
</style>
<main class="wrapper responsive-width" id="main">
<!----admin template section---->
<div class="admin_tempblock">
<div class="admin_tempsec">
<div class="admin_sec">
<?php if($this->session->flashdata('failed')) { ?>
<div class="mt-3 mb-3 text-center p-2 bg-danger text-white">
<p><?php echo $this->session->flashdata('failed') ?></p>
</div>
<?php } ?>
<form action="<?php echo base_url() ?>Admin/updateSection" method="post" id="sectionForm">
<div class="subsec_sec">
<div class="subject_l">
<div class="subject_lsec">
<div class="subject_lhead">Create Section</div>
<div class="subject_lformarea">
<div class="form-group">
<label for="">Section Name</label>
<input type="text" name="section_name" value="<?php echo $result['section_name'] ?>" class="form-control" placeholder="Name of your course">
<input type="hidden" name="secId" value="<?php echo $result['id'] ?>">
</div>
<input type="submit" class="subject_addbtn" value="Submit">
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<!----admin template section end---->
</main>
<!--End right-top side-->
<script>
$(document).ready(function(){
$("#sectionForm").validate({
rules: {
section_name: {
required: true,
minlength: 5
}
},
// Specify validation error messages
messages: {
section_name: {
required: "Please provide a section name",
minlength : "Please enter more than 4 Characters"
},
},
submitHandler: function(form) {
form.submit();
}
});
});
</script>