BBnepal-Accounts/application/views/admin/view-student.php

672 lines
32 KiB
PHP
Raw Normal View History

2024-07-10 12:43:19 +00:00
<style>
.img-fluid {
width: 160px;
height: 198px;
object-fit: cover;
max-width: 160px;
max-height: 198px;
}
.w-60 {
width: 70%;
}
.student-detailss {
display: flex;
flex-direction: column;
justify-content: center;
text-align: left;
}
.student-details-footers {
display: flex;
flex-direction: column;
text-align: center;
width: 100%;
}
.student-details-footers span {
font-size: 10px;
color: black;
font-weight: 600;
width: 100%;
}
.student-details-footers img {
width: 60px;
height: 30px;
object-fit: contain;
margin: auto;
}
.student-info-single {
display: flex;
align-items: center;
justify-content: center;
}
.student-info-single h6 {
font-size: 11px;
color: #0E2F9E;
font-weight: 600;
}
/* .student-info-single p{
font-size:11px;
font-weight:500;
padding-left:5px;
} */
.student-info-single p {
font-size: 11px;
font-weight: 500;
padding-left: 5px;
width: auto;
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
line-clamp: 2 !important;
-webkit-box-orient: vertical;
margin-top: -2px;
}
.student-card-footer {
background: transparent linear-gradient(89deg, #0D2D73 0%, #3F63A9 100%) 0% 0% no-repeat padding-box;
border-radius: 0px 0px 15px 15px;
opacity: 1;
padding: 10px 20px 10px 20px;
}
.student-card-footer p {
font-size: 9px;
color: white;
font-weight: 400;
text-align: center;
}
/*password css*/
.con-pass {
position: absolute;
top: 8px;
right: 8px;
cursor: pointer;
color: #878a8d;
}
.error {
color: red;
}
</style>
<div class="wraper responsive-width">
<main class="long-tbl-main" id="main">
<div class="from-group">
<a href="<?= base_url(); ?>admin/student"><button type="button" class="btn btn-success btn-sm btn-dark">Back</button></a>
</div>
<!-- admin template section -->
<div class="admin_tempblock">
<div class="admin_tempsec">
<div class="admin_sec">
<div class="subsec_sec">
<div class="subject_r">
<div class="subject_lsec">
<div class="subject_lhead">View Student</div>
<?php if ($this->session->flashdata('success')) { ?>
<div class="alert alert-success alert-dismissible fade show mb-3" role="alert">
<p><?php echo $this->session->flashdata('success') ?></p>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<?php } ?>
<div class="application-toggle-btn view-student-tab ">
<ul class="nav nav-pills">
<li>
<a href="<?= base_url() ?>admin/view-student/<?= $student_id ?>" class="active">Student Info</a>
</li>
<li>
<a href="#">View Attendance</a>
</li>
<li>
<a href="<?= base_url() ?>admin/view-student-payments/<?= $student_id ?>">Fee &amp; Payments</a>
</li>
</ul>
</div>
<div class="applicatn-wrap">
<?php
$i = 1;
if ($student) {
foreach ($student as $app) {
// dd($app);
if (empty($app['photo'])) {
$profileimg = base_url() . "common_assets/user.png";
} else if (file_exists('assets_student/application/' . $app['photo'])) {
$profileimg = base_url() . "assets_student/application/" . $app['photo'];
} else {
if ($app['gender'] == 'Male')
$profileimg = base_url() . "common_assets/male_image.jpg";
else
$profileimg = base_url() . "common_assets/female_image.jpg";
}
?>
<img src="<?= $profileimg; ?>" class="img-thumbnail img-fluid border-primary p-0 rounded-circle applicant-img" style="width: 150px; height: 150px !important;">
<div class="applicant-detl-wrap">
<ul>
<li>
<span class="applicant_lbl">Name <span style="font-weight : 600" class="float-right mr-4">:</span></span>
<span class="applicant_detl"><?= $app['name']; ?></span>
</li>
<li>
<span class="applicant_lbl">IEMIS No. <span style="font-weight : 600" class="float-right mr-4">:</span></span>
<span class="applicant_detl"><?= !empty($app['iemis']) ? $app['iemis'] : '-' ?></span>
</li>
<li>
<span class="applicant_lbl">Course<span style="font-weight : 600" class="float-right mr-4">:</span></span>
<span class="applicant_detl"> <?= $app['course_name']; ?></span>
</li>
<li>
<span class="applicant_lbl">Section<span style="font-weight : 600" class="float-right mr-4">:</span></span>
<span class="applicant_detl"> <?= (!empty($section_name['section_name'])) ? $section_name['section_name'] : ' -- '; ?></span>
</li>
<li>
<span class="applicant_lbl">Batch<span style="font-weight : 600" class="float-right mr-4">:</span></span>
<span class="applicant_detl"> <?= $app['b_name']; ?></span>
</li>
<li>
<span class="applicant_lbl">Email<span style="font-weight : 600" class="float-right mr-4">:</span></span>
<span class="applicant_detl"> <?= $app['email']; ?></span>
</li>
<li>
<span class="applicant_lbl">Contact number<span style="font-weight : 600" class="float-right mr-4">:</span></span>
<span class="applicant_detl"><?= $app['mobile']; ?></span>
</li>
<li>
<span class="applicant_lbl">Date of birth<span style="font-weight : 600" class="float-right mr-4">:</span></span>
<span class="applicant_detl"><?= $app['dob']; ?></span>
</li>
<li>
<span class="applicant_lbl">Gender<span style="font-weight : 600" class="float-right mr-4">:</span></span>
<span class="applicant_detl"> <?= $app['gender']; ?></span>
</li>
<li>
<span class="applicant_lbl">Father Name<span style="font-weight : 600" class="float-right mr-4">:</span></span>
<span class="applicant_detl"> <?= (!empty($app['father_name'])) ? $app['father_name'] : '-'; ?></span>
</li>
<li>
<span class="applicant_lbl">Mother Name<span style="font-weight : 600" class="float-right mr-4">:</span></span>
<span class="applicant_detl"> <?= (!empty($app['mother_name'])) ? $app['mother_name'] : '-'; ?></span>
</li>
<li>
<span class="applicant_lbl">Parent Name<span style="font-weight : 600" class="float-right mr-4">:</span></span>
<span class="applicant_detl"> <?= $app['emergency_contact_name']; ?></span>
</li>
<li>
<span class="applicant_lbl">Parent PAN Number<span style="font-weight : 600" class="float-right mr-4">:</span></span>
<span class="applicant_detl"> <?= $app['parent_pan']; ?></span>
</li>
<li>
<span class="applicant_lbl">Address<span style="font-weight : 600" class="float-right mr-4">:</span></span>
<span class="applicant_detl"> <?= $app['address1'] . "<br>" . $app['address2'] . "<br>" . $app['state'] . "<br>" . $app['country'] . "<br>" . $app['zipcode']; ?></span>
</li>
<li>
<span class="applicant_lbl">Applied on<span style="font-weight : 600" class="float-right mr-4">:</span></span>
<span class="applicant_detl"> <?= $app['registered_on']; ?></span>
</li>
<?php if (isset($app['has_sibling']) && $app['has_sibling'] == 'no') { ?>
<li>
<form action="<?= base_url() ?>admin/update_siblings_parent" id="sibling_form" method="post">
<span class="applicant_lbl mt-3">
<label for="sibling"><input type="checkbox" id="sibling" name="sibling" value="yes"> Has sibling? </label>
</span>
<span class="applicant_detl">
<div id="sibling_outer_div" style="display: none" class="mt-3">
<label class="" for="sibling_id">Sibling Id <span style="color:red">*</span></label>
<input type="text" name="sibling_id" id="sibling_id" class="form-control" placeholder="Sibling Id">
<span style="color:red" id="sibling_id_err"></span>
<div>
<input type="submit" name="" value="Update Sibling" class="btn btn-primary btn-sm mt-2">
</div>
</div>
<input type="hidden" name="sibling_parent_id" id="sibling_parent">
<input type="hidden" name="student_id" value="<?= $app['id'] ?>">
</span>
</form>
</li>
<?php } ?>
</ul>
</div>
</div>
<div class="subject_lhead">View Documents
<div><small>Allowed uploads : (gif, jpg, png, jiff, jfif)</small></div>
</div>
<div class="applicant-docs-wrap">
<form id="admission-register" action="<?php echo base_url(); ?>admin/documents_reupload" method="post" enctype="multipart/form-data">
<input type="hidden" name="appid" id="appid" class="form-control" value="<?php echo $app['id']; ?>" />
<div class="applicant-docs-row">
<label>Passport size photo</label>
<!-- id added -->
<div class="view-reupload-btn ">
<div class="upload-btn" data-toggle="modal" data-target="#viewPhoto">View</div>
<div class="reupload">
<input onchange="readURL(this);" type="file" name="photo" id="photo" class="form-control" />
<label for="photo" class="upload-btn" id="uploadBtn">Re-Upload</label>
</div>
</div>
</div>
<div class="applicant-docs-row">
<label>School Certificate</label>
<!-- id added -->
<div class="view-reupload-btn ">
<div class="upload-btn" data-toggle="modal" data-target="#viewCertificate">View</div>
<div class="reupload">
<input onchange="readURL(this);" type="file" name="school" id="school" class="form-control" />
<label for="school" class="upload-btn" id="uploadBtn">Re-Upload</label>
</div>
</div>
</div>
<div class="applicant-docs-row">
<label>Exam Results</label>
<!-- id added -->
<div class="view-reupload-btn ">
<div class="upload-btn" data-toggle="modal" data-target="#viewResult">View</div>
<div class="reupload">
<input onchange="readURL(this);" type="file" name="exam" id="exam" class="form-control" />
<label for="exam" class="upload-btn" id="uploadBtn">Re-Upload</label>
</div>
</div>
</div>
<div class="applicant-docs-row">
<label>Medical Certificate</label>
<!-- id added -->
<div class="view-reupload-btn ">
<div class="upload-btn" data-toggle="modal" data-target="#viewMedical">View</div>
<div class="reupload">
<input onchange="readURL(this);" type="file" name="medical" id="medical" class="form-control" />
<label for="medical" class="upload-btn" id="uploadBtn">Re-Upload</label>
</div>
</div>
</div>
<input type="hidden" name="student_id" value="<?= $student_id ?>">
</div>
</div>
<input type="submit" value="Submit files" class="btn btn-success">
<a href="<?php echo base_url() ?>admin/editInfo-student/<?= $student_id ?>">
<button type="button" class="btn btn-dark ml-3">Edit Info</button>
</a>
<button type="button" class="btn btn-primary btn-load ml-3" onclick="coursedel(<?php echo $student_id ?>)" data-toggle="modal" data-target="#changePasswordModal">Change Password</button>
<?php if ($app['is_active'] == 'yes') { ?>
<button type="button" class="btn btn-info btn-load ml-3" onclick="disableddel(<?php echo $student_id ?>)" data-toggle="modal" data-target="#unableStudent">Enabled</button>
<?php } else { ?>
<button type="button" class="btn btn-danger btn-load ml-3" onclick="ubabledel(<?php echo $student_id ?>)" data-toggle="modal" data-target="#disabledStudent">Disabled</button>
<?php } ?>
<?php }
} else {
echo '<p>Student is not assigned to any course</p>';
} ?>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- admin template section end -->
</main>
<!--End right-top side-->
</div>
<!-- unable student -->
<div class="viewDoc delete-modal-wrap">
<div class="modal fade" id="unableStudent" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<div class="delete-modal">
<form method="POST" id="suspend_student" action="<?php echo base_url('admin/suspend-student') ?>">
<input name="student_id" type="hidden" id="unbid" />
<input type="hidden" name="status" value="1" />
<h4>Reason for disabled Student ? </h4>
<p>
<textarea class="form-control" name="reason" rows="4"></textarea>
<label id="reason-error" class="error mt-3 mb-2 text-left text-danger" for="reason"></label>
</p>
<div class="delete-modal-btn">
<button type="submit" class="subject_addbtn subject_addbtn_red">Disable</button>
<button type="button" class="subject_addbtn subject_addbtn_cancel" data-dismiss="modal">Cancel</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Disabled student -->
<div class="viewDoc delete-modal-wrap">
<div class="modal fade" id="disabledStudent" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<div class="delete-modal">
<form method="POST" id="resume_student" action="<?php echo base_url('admin/suspend-student') ?>">
<i class="fa fa-undo" style="font-size:40px;color: green;"></i>
<input type="hidden" id="disid" name="student_id" />
<input type="hidden" name="status" value="0" />
<h4>Are you sure?</h4>
<p>Are you sure you want to resume Student ?</p>
<div class="delete-modal-btn">
<button type="submit" class="text-white subject_addbtn bg-success">Enable Student</button>
<button type="button" class="subject_addbtn subject_addbtn_cancel" data-dismiss="modal">Cancel</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Change Password Modal -->
<div class="viewDoc delete-modal-wrap">
<div class="modal fade" id="changePasswordModal" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<div class="delete-modal text-left">
<form action="<?php echo base_url() ?>admin/student-change-password" class="w-70 mb-4" method="post" id="changePasswordForm">
<div class="container">
<h4 class="text-center my-3">Change Password</h4>
<input type="hidden" name="student_id" id="btid" />
<div class="form-group">
<label for="">Password<span class="text-danger font-weight-bold">*</span></label>
<div class="password-wrp">
<input type="password" name="password" id="password" class="form-control" placeholder="Enter your password">
<span class="passwrd-icon icon-y"><i class="far fa-eye"></i></span>
</div>
</div>
<div class="form-group mb-3">
<label for="">Confirm Password<span class="text-danger font-weight-bold">*</span></label>
<div class="password-wrp">
<input type="password" id="confirm-password" name="confirm_password" class=" form-control" placeholder="Enter your password">
<span class="con-pass icon-y eye-icon"><i class="far fa-eye"></i></span>
</div>
</div>
<button class="text-white subject_addbtn btn-success">Submit</button>
<button type="button" class="subject_addbtn subject_addbtn_cancel " data-dismiss="modal">Cancel</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- modals -->
<div class="view-doc">
<div class="modal fade" id="viewPhoto" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<div class="document-view-wrap">
<img src="<?= base_url(); ?>assets_student/application/<?= $app['photo']; ?>" alt="" />
</div>
</div>
</div>
</div>
<div class="modal fade" id="viewCertificate" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<div class="document-view-wrap">
<img src="<?= base_url(); ?>assets_student/application/<?= $app['school_certificate']; ?>" alt="" />
</div>
</div>
</div>
</div>
<div class="modal fade" id="viewResult" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<div class="document-view-wrap">
<img src="<?= base_url(); ?>assets_student/application/<?= $app['exam_result']; ?>" alt="" />
</div>
</div>
</div>
</div>
<div class="modal fade" id="viewMedical" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<div class="document-view-wrap">
<img src="<?= base_url(); ?>assets_student/application/<?= $app['medical_cerificate']; ?>" alt="" />
</div>
</div>
</div>
</div>
</div>
<!-- modals -->
<script>
$(document).ready(function() {
$('.user-drpdown').click(function() {
$('.drpdown-items').toggle();
});
});
</script>
<script type="text/javascript">
function coursedel(icn) {
// alert(icn);
$('#btid').val(icn);
}
function disableddel(icn) {
// alert(icn);
$('#unbid').val(icn);
}
function ubabledel(icn) {
$('#disid').val(icn);
}
$(".con-pass").click(function() {
$(".con-pass").toggleClass("icon-y");
var input = $("#confirm-password");
if (input.attr("type") == "password") {
$(".con-pass").addClass("icon-y");
input.attr("type", "text");
} else {
$(".con-pass").removeClass("icon-y");
input.attr("type", "password");
}
});
$(".passwrd-icon").click(function() {
$(".passwrd-icon").toggleClass("icon-y");
var input = $("#password");
if (input.attr("type") == "password") {
$(".passwrd-icon").addClass("icon-y");
input.attr("type", "text");
} else {
$(".passwrd-icon").removeClass("icon-y");
input.attr("type", "password");
}
});
jQuery.validator.addMethod("passwordregex", function(value, element) {
return this.optional(element) || /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$#!%*?&])[A-Za-z\d@$!#%*?&]{6,16}$/.test(value);
}, 'Your password must be atleast 6 characters long, which inculdes one upper case, one numerical value and one special character.');
var validator = $("#changePasswordForm").validate({
ignore: ":hidden",
rules: {
password: {
required: true,
minlength: 6,
passwordregex: true
},
confirm_password: {
required: true,
minlength: 6,
equalTo: '#password'
},
},
messages: {
password: {
required: 'Please enter a valid password',
minlength: 'Password should be more than 6 characters'
},
confirm_password: {
required: 'Please re-enter your password',
equalTo: "Passwords doesn't match. Please provide a password same as above"
},
},
submitHandler: function(form) {
form.submit();
}
});
$("#suspend_student").validate({
rules: {
"reason": {
required: true,
minlength: 25
}
},
submitHandler: function() {
form.submit();
} // end submitHandler
});
$('#changePasswordModal').on('hidden.bs.modal', function(e) {
validator.resetForm();
$(this).find('#changePasswordForm')[0].reset();
$(".passwrd-icon, .con-pass").addClass("icon-y");
});
function readURL(input) {
let fileSize = input.files[0].size;
extension = $(input).val().split('.').pop().toLowerCase();
var fileExtension = ['jfif', 'jpeg', 'jpg', 'png', 'gif', 'jiff'];
if ($.inArray($(input).val().split('.').pop().toLowerCase(), fileExtension) == -1) {
alert("Only formats are allowed : " + fileExtension.join(', '));
input.value = '';
return;
}
}
</script>
<script type="text/javascript">
jQuery.validator.addMethod("alphanumeric_regex", function(value, element) {
return this.optional(element) || /^[a-zA-Z0-9 -#]{1,50}$/.test(value);
}, 'Please enter alpha characters only');
$("#sibling_form").validate({
rules: {
sibling_id: {
required: true,
alphanumeric_regex: true
}
},
submitHandler: function() {
form.submit();
} // end submitHandler
});
$(function() {
$("#sibling").change(function() {
if (this.checked) {
$('#sibling_outer_div').show();
} else {
$('#sibling_outer_div').hide();
}
});
$('#sibling_id').change(function() {
let val = $(this).val();
if (val.length > 0) {
$.ajax({
url: '<?php echo base_url() ?>' + 'admin/ajax_check_if_exists',
data: {
value: val,
column: 'studentId',
table: 'students',
required: 'parent_username'
},
type: 'POST',
async: false,
success: function(data) {
console.log(data);
$('#sibling_id_err').empty();
if (data == 'failed') {
console.log('failed');
$('#sibling_id_err').text('There is no student with provided Id : ' + val);
$('#sibling_id').val('');
$('#sibling_parent').val('');
} else {
console.log(data);
$('#sibling_parent').val(data);
}
}
});
}
})
})
</script>