commitall
This commit is contained in:
148
application/views/admin/assign-class-teacher.php
Normal file
148
application/views/admin/assign-class-teacher.php
Normal file
@@ -0,0 +1,148 @@
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/bootstrap-select.css">
|
||||
<style>
|
||||
.error {
|
||||
color: red;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.form-group.form-group-iconselect {
|
||||
position: relative;
|
||||
margin: 0px 0px 25px 0px;
|
||||
}
|
||||
|
||||
label#subject_icon-error {
|
||||
position: absolute;
|
||||
bottom: -25px;
|
||||
}
|
||||
</style>
|
||||
<div class="wraper responsive-width">
|
||||
<main class="" id="main">
|
||||
<?php
|
||||
$classroom_name = (isset($classroom['classroom_name'])) ? $classroom['classroom_name'] : '';
|
||||
$course_id = (isset($classroom['course_id'])) ? $classroom['course_id'] : '';
|
||||
$section_id = (isset($classroom['section_id'])) ? $classroom['section_id'] : '';
|
||||
$is_active = (isset($classroom['is_active'])) ? $classroom['is_active'] : '';
|
||||
$action_url = base_url() . 'admin/assign-class-teacher/' . $id;
|
||||
|
||||
?>
|
||||
<div class="admin_tempblock">
|
||||
<div class="admin_tempsec">
|
||||
<div class="admin_sec">
|
||||
<?php
|
||||
if (!empty($this->session->flashdata('success'))) { ?>
|
||||
<div class="alert alert-success">
|
||||
<a href="#" class="close" data-dismiss="alert">×</a>
|
||||
<strong>Success!</strong> <?php echo $this->session->flashdata('success'); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
if (!empty($this->session->flashdata('error'))) {
|
||||
?>
|
||||
<div class="alert alert-danger">
|
||||
<a href="#" class="close" data-dismiss="alert">×</a>
|
||||
<strong>Failed!</strong> <?php echo $this->session->flashdata('error'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="subsec_sec">
|
||||
<div class="subject_l subject_l_full_width">
|
||||
<div class="subject_lsec">
|
||||
<div class="subject_lhead"><?php echo $title; ?></div>
|
||||
<div class="subject_lhead" style="font-size: 16px;"><?php echo $classroom_name; ?></div>
|
||||
<hr>
|
||||
<?php
|
||||
// echo '<pre>';
|
||||
// print_r($classroom_subjects);
|
||||
?>
|
||||
<form id="classroomfrom" method="post" action="<?= $action_url; ?>">
|
||||
|
||||
<div class="form-group assign_subject">
|
||||
<label>Select Class Teacher Subject <span class="text-danger font-weight-bold">*</span></label>
|
||||
<!-- <input type="text" name="class"> -->
|
||||
<select name="subject_id" id="subject_id" class="selectpicker" data-live-search="true" required>
|
||||
<option value="" data-course_name="">-- Select Option --</option>
|
||||
<?php foreach ($classroom_subjects as $cs_value) {
|
||||
|
||||
$selected = '';
|
||||
|
||||
if ($cs_value['is_class_teacher'] == 'yes') {
|
||||
$selected = 'selected';
|
||||
}
|
||||
|
||||
?>
|
||||
<option value="<?= $cs_value['subject_id']; ?>" <?= $selected; ?> data-course_name="<?= $cs_value['subject_name']; ?>"><?= $cs_value['subject_name']; ?></option>
|
||||
<?php
|
||||
} ?>
|
||||
</select>
|
||||
<label id="subject_id-error" class="error" for="subject_id"></label>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<input type="submit" name="update" value="Update" class="subject_addbtn">
|
||||
<a href="<?= base_url(); ?>admin/ae-classroom/<?= $id ?>"><button type="button" class=" ml-2 subject_addbtn bg-dark">Back</button></a>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.bundle.min.js"></script> -->
|
||||
<script defer src="<?php echo base_url(); ?>assets_admin/js/bootstrap-select.min.js"></script>
|
||||
<script>
|
||||
$('.isClassTeacher').on('change', function(i, v) {
|
||||
|
||||
$('.isClassTeacher').not(this).prop('checked', false);
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
function toggle(which) {
|
||||
|
||||
|
||||
// var teacherId = $("input[name='teacher_id[which]']").val();
|
||||
|
||||
$("input[name='teacher_id[]']").each(function(i, v) {
|
||||
alert(i);
|
||||
console.log(v);
|
||||
});
|
||||
|
||||
// console.log(teacherId);
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//multiple select js start
|
||||
$('select').selectpicker();
|
||||
//multiple select js end
|
||||
var CName = $('#subject_id :selected').data('course_name')
|
||||
|
||||
$("#classroomfrom").validate({
|
||||
|
||||
// ignore: "input[type='text']:hidden",
|
||||
rules: {
|
||||
classroom_name: {
|
||||
required: true,
|
||||
rangelength: [2, 50],
|
||||
inputregx: true
|
||||
},
|
||||
|
||||
},
|
||||
messages: {
|
||||
|
||||
subject_id: {
|
||||
required: "Please select class teacher subject"
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
Reference in New Issue
Block a user