BBnepal-Accounts/application/views/admin/generate-student-certificate.php

326 lines
23 KiB
PHP
Raw Normal View History

2024-07-10 12:43:19 +00:00
<div class="row">
<div class="col-md-8"></div>
<?php
$urlparam = urlencode(serialize($download_url));
?>
</div>
<div class="wraper responsive-width" style="height:100% !important;">
<main class="" id="main">
<!-- <div class="main-wrap" style="page-break-after: always;">
<div class="dashboard-cover">
</div>
</div> -->
<?php
// echo '<pre>';
// print_r($student_info);
?>
<div class="from-group">
<a href="<?= base_url(); ?>admin/student/certificates"><button type="button" class="btn btn-success btn-sm btn-dark">Back</button></a>
</div>
<div class="admin_tempblock">
<div class="admin_tempsec">
<div class="admin_sec">
<div class="subsec_sec">
<div class="subject_l_full_width">
<!-- <?php
if (!empty($this->session->flashdata('certificateSuccess'))) { ?>
<div class="alert alert-success">
<a href="#" class="close" data-dismiss="alert">&times;</a>
<strong>Success!</strong> <?php echo $this->session->flashdata('success'); ?>
</div>
<?php
}
if (!empty($this->session->flashdata('certificateFailed'))) {
?>
<div class="alert alert-danger">
<a href="#" class="close" data-dismiss="alert">&times;</a>
<strong>Failed!</strong> <?php echo $this->session->flashdata('failed'); ?>
</div>
<?php } ?> -->
<div class="subject_lsec">
<div class="subject_lhead"><?php echo 'Certificate Details'; ?></div>
<?php
$studentId = (isset($student_info['student_id'])) ? $student_info['student_id'] : '';
$studentName = (isset($student_info['name'])) ? $student_info['name'] : '';
$dob = (isset($student_info['dob'])) ? $student_info['dob'] : '';
$course = (isset($student_info['course_name'])) ? $student_info['course_name'] : '';
$section = (isset($student_info['section_name'])) ? $student_info['section_name'] : '';
$rollNo = (isset($student_info['roll_no'])) ? $student_info['roll_no'] : '';
$contactNumber = (isset($student_info['mobile'])) ? $student_info['mobile'] : '';
$emergencyContactName = (isset($student_info['emergency_contact_name'])) ? $student_info['emergency_contact_name'] : '';
$emergencyContactNumber = (isset($student_info['emergency_contact_number'])) ? $student_info['emergency_contact_number'] : '';
$addressArray = array();
if (isset($student_info['address1']) && $student_info['address1'] != '') {
array_push(
$addressArray,
$student_info['address1']
);
}
if (isset($student_info['address2']) && $student_info['address2'] != '') {
array_push(
$addressArray,
$student_info['address2']
);
}
if (isset($student_info['state']) && $student_info['state'] != '') {
array_push(
$addressArray,
$student_info['state']
);
}
if (isset($student_info['country']) && $student_info['country'] != '') {
array_push(
$addressArray,
$student_info['country']
);
}
$certificateId = (isset($student_certificate_info['id'])) ? $student_certificate_info['id'] : 0;
$studentAddress = (isset($student_certificate_info['address'])) ? $student_certificate_info['address'] : implode(', ', $addressArray);
$academicSessionStartYear = (isset($student_certificate_info['session_starts'])) ? $student_certificate_info['session_starts'] : (int) $issue_year;
$academicSessionEndsYear = (isset($student_certificate_info['session_ends'])) ? $student_certificate_info['session_ends'] :
(int) $issue_year;
$fatherName = (isset($student_certificate_info['father_name'])) ? $student_certificate_info['father_name'] : '';
$motherName = (isset($student_certificate_info['mother_name'])) ? $student_certificate_info['mother_name'] : '';
$examination = (isset($student_certificate_info['examination'])) ? $student_certificate_info['examination'] : '';
$examinationYear = (isset($student_certificate_info['examination_year'])) ? $student_certificate_info['examination_year'] : (int) $issue_year;
$securedMark = (isset($student_certificate_info['secured_mark'])) ? $student_certificate_info['secured_mark'] : '';
$remarks = (isset($student_certificate_info['remarks'])) ? $student_certificate_info['remarks'] : '';
$admissionNumber = (isset($student_certificate_info['admission_number'])) ? $student_certificate_info['admission_number'] : '';
$registrationNumber = (isset($student_certificate_info['registration_number'])) ? $student_certificate_info['registration_number'] : '';
$symbolNumber = (isset($student_certificate_info['symbol_number'])) ? $student_certificate_info['symbol_number'] : '';
$type = (isset($student_certificate_info['type'])) ? $student_certificate_info['type'] : '';
$isGenerated = (isset($student_certificate_info['created_on'])) ? true : false;
?>
<!-- <?= $isGenerated ?> -->
<!-- If the certificate is already generated then dispalying in table view for view and print option. -->
<?php if ($isGenerated) { ?>
<table id="tbl" class="display table-responsive">
<thead>
<tr>
<!-- <th></th> -->
<th>Student Name</th>
<th>Class</th>
<th>Roll No</th>
<th>Certificate Type</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<!-- <td class=" p-0"><span class="fa fa-circle text-success text-small"></span></td> -->
<td><?= $studentName ?></td>
<td><?= $course ?></td>
<td><?= $rollNo ?></td>
<td>
<?php
if ($type == 'tc') {
echo 'Transfer Certificate';
} else if ($type == 'cc') {
echo 'Character Certificate';
} else if ($type == 'tcc') {
echo 'Transfer & Character Certificate';
}
?>
</td>
<td>
<a href="<?php echo base_url(); ?>admin/view-certificate?data=<?= $urlparam; ?>&type=<?= $type ?>" data-toggle="tooltip" title="View" target="_blank">
<i class="fa fa-eye p-2 h6" style="color:#032da1" aria-hidden="true"></i>
</a>
<!-- <a href="<?php echo base_url(); ?>admin/download-certificate?data=<?= $urlparam; ?>&type=<?= $type ?>" data-toggle="tooltip" title="Download" target="_blank">
<i class="fa fa-download p-2 h6" style="color:#032da1" aria-hidden="true"></i>
</a> -->
</td>
</tr>
</tbody>
</table>
<hr>
<?php } ?>
<form action="<?php echo base_url() ?>Admin/create_studentCertificate" class="mb-5" method="post" id="userForm">
<input type="hidden" name="student_id" id="student_name" class="form-control" value="<?= $studentId; ?>">
<input type="hidden" name="batch_id" id="batch_id" class="form-control" value="<?= $student_info['batch_id']; ?>">
<input type="hidden" name="course_id" id="course_id" class="form-control" value="<?= $student_info['course_id']; ?>">
<input type="hidden" name="section_id" id="section_id" class="form-control" value="<?= $student_info['section_id']; ?>">
<input type="hidden" name="gender" id="gender" class="form-control" value="<?= $student_info['gender']; ?>">
<input type="hidden" name="certificateId" id="certificateId" class="form-control" value="<?= $certificateId ?>">
<div class="subject_lformarea">
<div class="row">
<div class="col form-group">
<label for="">Student Name <span class="text-danger font-weight-bold">*</span></label>
<input type="text" name="student_name" id="student_name" class="form-control" value="<?= $studentName; ?>" placeholder="Student name" readonly>
</div>
<div class="col form-group">
<label for="">Class <span class="text-danger font-weight-bold">*</span></label>
<input type="text" name="student_class" id="student_class" class="form-control" value="<?= $course; ?>" placeholder="Class" readonly>
</div>
<div class="col form-group">
<label for="">Section <span class="text-danger font-weight-bold">*</span></label>
<input type="text" name="student_section" id="student_section" class="form-control" value="<?= $section; ?>" placeholder="Section" readonly>
</div>
<div class="col form-group">
<label for="">Roll Number <span class="text-danger font-weight-bold">*</span></label>
<input type="text" name="student_roll_no" id="student_roll_no" class="form-control" value="<?= $rollNo; ?>" placeholder="Roll Number" readonly>
</div>
</div>
<div class="row">
<div class="col form-group">
<label for="">Date Of Birth</label>
<!-- <input type="date" name="dob" value="<?php echo $dob ?>" class="form-control" placeholder=""> -->
<div class="po-calendar">
<input type="text" style="background-color: transparent;" name="dob" class="nepal-date form-control" value="<?php echo $dob ?>" placeholder="">
<i class="fas fa-calendar-alt cal-icon"></i>
</div>
</div>
<div class="col form-group">
<label for="">Address <span class="text-danger font-weight-bold">*</span></label>
<input type="text" name="student_address" id="student_address" class="form-control" value="<?= $studentAddress; ?>" placeholder="Address" required>
</div>
</div>
<hr>
<label class="font-weight-bold">Academic Session <span class="text-danger font-weight-bold">*</span></label>
<div class="row">
<div class="col form-group">
<input type="number" name="academic_session_starts" id="academic_session_starts" class="form-control" max="<?= (int) $issue_year ?>" value="<?= (int) $academicSessionStartYear - 1 ?>" placeholder="School Joined Year">
</div>
<div class="col form-group">
<input type="number" name="academic_session_ends" id="academic_session_ends" class="form-control" max="<?= (int) $issue_year ?>" value="<?= $academicSessionEndsYear ?>" placeholder="Ends">
</div>
</div>
<hr>
<label class="font-weight-bold">Parents Details <span class="text-danger font-weight-bold">*</span></label>
<div class="row">
<div class="col form-group">
<input type="text" name="student_father_name" id="student_father_name" class="form-control" placeholder="Father's Name" value="<?= $fatherName ?>" required>
</div>
<div class="col form-group">
<input type="text" name="student_mother_name" id="student_mother_name" class="form-control" placeholder="Mother's Name" value="<?= $motherName ?>" required>
</div>
</div>
<hr>
<label class="font-weight-bold">Examination Detail </label>
<div class="row">
<div class="col form-group">
<label for="">Examination <span class="text-danger font-weight-bold">*</span></label>
<select name="examination" class="scountry form-control" id="examination">
<option value="" selected> Select Exam</option>
<?php foreach ($offline_exams as $oe_key => $offline_exam) { ?>
<option value="<?= $offline_exam['exam_name'] ?>" <?= $examination == $offline_exam['exam_name'] ? 'selected' : '' ?>><?= $offline_exam['exam_name'] ?></option>
<?php } ?>
</select>
</div>
<div class="col form-group">
<label for="">Examination Year <span class="text-danger font-weight-bold">*</span></label>
<input type="number" name="examination_year" id="examination_year" class="form-control" max="<?= (int) $issue_year ?>" value="<?= $examinationYear ?>" placeholder="Examination Year" required>
</div>
<div class="col form-group">
<label for="">Secured Marks / Grade <span class="text-danger font-weight-bold">*</span></label>
<input type="text" name="secured_mark" id="secured_mark" class="form-control" placeholder="Mark / Grade" value="<?= $securedMark ?>" required>
</div>
</div>
<div class="row">
<div class="col form-group">
<label for="">Remarks <span class="text-danger font-weight-bold">*</span></label>
<input type="text" name="remarks" id="remarks" class="form-control" placeholder="Remarks" value="<?= $remarks ?>" required>
</div>
</div>
<hr>
<label class="font-weight-bold">Additional Info </label>
<div class="row">
<div class="col form-group">
<label for="">Admission Number </label>
<input type="text" name="admission_number" id="admission_number" class="form-control" value="<?= $admissionNumber ?>" placeholder="Admission Number">
</div>
<div class="col form-group">
<label for="">Registration Number </label>
<input type="text" name="registration_number" id="registration_number" class="form-control" value="<?= $registrationNumber ?>" placeholder="Registration Number">
</div>
<div class="col form-group">
<label for="">Symbol Number </label>
<input type="text" name="symbol_number" id="symbol_number" class="form-control" value="<?= $symbolNumber ?>" placeholder="Symbol Number">
</div>
</div>
<hr>
<div class="row mb-4">
<div class="col-md-12 my-2">
<h6 class="font-weight-bold">Certificate Type<span class="text-danger font-weight-bold">*</span></h6>
</div>
<div class="col-md-6 col-height">
<div class="register-row">
<select name="certificate_type" class="scountry form-control" id="certificate_type">
<option value="" selected>--Select--</option>
<option value="tc" <?= $type == 'tc' ? 'selected' : '' ?>>Transfer Certificate</option>
<option value="cc" <?= $type == 'cc' ? 'selected' : '' ?>>Character Certificate</option>
<option value="tcc" <?= $type == 'tcc' ? 'selected' : '' ?>>Combined Transfer & Character</option>
</select>
</div>
</div>
</div>
<input type="submit" class="col subject_addbtn" value="<?= $type != '' ? 'Updae Info' : 'Generate' ?>" name="submit_info">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<script defer src="<?php echo base_url(); ?>assets_admin/js/bootstrap-select.min.js"></script>
<script>
$(document).ready(function() {
$('#tbl').DataTable({
// "lengthMenu": [
// [25, 50, 100, 150, -1],
// [25, 50, 100, 150, "All"]
// ]
"bPaginate": false,
"bLengthChange": false,
"bFilter": true,
"bInfo": false,
"searching": false, // Search Box will Be Disabled
"ordering": false,
});
});
</script>