|
Server IP : 2a02:4780:3:1493:0:3736:a38e:7 / Your IP : 216.73.216.60 Web Server : LiteSpeed System : Linux sg-nme-web1393.main-hosting.eu 4.18.0-553.77.1.lve.el8.x86_64 #1 SMP Wed Oct 8 14:21:00 UTC 2025 x86_64 User : u926327694 ( 926327694) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u926327694/domains/smsoft.in/public_html/demo/fonts/../../smart/../mda/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
$page_title = 'Exam Result';
include 'header.php';
?>
<div class="content-wrapper">
<section class="content mt-4">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<?php include('alert-msg.php'); ?>
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title"><?php echo $page_title; ?></h3>
</div>
<form action="add-exam-result.php" method="POST" enctype="multipart/form-data">
<div class="card-body">
<div class="row">
<div class="col-md-12"><b>Search Student for add exam result</b></div>
<div class="col-md-4">
<div class="form-group">
<label>Class</label>
<select class="form-control select2" name="class">
<option value="">--All--</option>
<?php
$sel_class=mysqli_query($con,"SELECT DISTINCT Class FROM `DimStudent_Table` Where Class != ''");
while($row_class=mysqli_fetch_array($sel_class))
{
?>
<option value="<?php echo $row_class['Class']; ?>"><?php echo $row_class['Class']; ?></option>
<?php
}
?>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Division</label>
<select class="form-control select2" name="division">
<option value="">--All--</option>
<?php
$sel_division=mysqli_query($con,"SELECT DISTINCT Division FROM `DimStudent_Table` where Division != ''");
while($row_division=mysqli_fetch_array($sel_division))
{
?>
<option value="<?php echo $row_division['Division']; ?>"><?php echo $row_division['Division']; ?></option>
<?php
}
?>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Combination</label>
<select class="form-control select2" name="combination">
<option value="">--All--</option>
<?php
$sel_class=mysqli_query($con,"SELECT DISTINCT Combination FROM `DimStudent_Table` Where Combination != ''");
while($row_class=mysqli_fetch_array($sel_class))
{
?>
<option value="<?php echo $row_class['Combination']; ?>"><?php echo $row_class['Combination']; ?></option>
<?php
}
?>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Course</label>
<select class="form-control select2" name="course">
<option value="">--All--</option>
<?php
$sel_class=mysqli_query($con,"SELECT DISTINCT Course FROM `DimStudent_Table` Where Course != ''");
while($row_class=mysqli_fetch_array($sel_class))
{
?>
<option value="<?php echo $row_class['Course']; ?>"><?php echo $row_class['Course']; ?></option>
<?php
}
?>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Search</label>
<input type="text" class="form-control" name="search" />
</div>
</div>
<div class="col-md-12">
<hr />
<b>Select Exam, Year and Subject</b>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Year</label>
<select class="form-control select2 exam_year_list" name="year" required>
<option value="">--Select--</option>
<?php
$sel_Year=mysqli_query($con,"SELECT DISTINCT Year FROM `DimExam_Table` Where Year != ''");
while($row_Year=mysqli_fetch_array($sel_Year))
{
?>
<option value="<?php echo $row_Year['Year']; ?>"><?php echo $row_Year['Year']; ?></option>
<?php
}
?>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Exam</label>
<select class="form-control select2 exam_list" name="exam_list" required>
<option value="">--Select--</option>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Exam Subject</label>
<select class="form-control subjects_list" name="subjects_list[]" multiple size="5" required>
</select>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary" name="btnSubmit">Search</button>
</div>
</form>
</div>
<?php if(isset($_POST['btnSubmit']))
{
$class = $_POST['class'] ?? '';
$division = $_POST['division'] ?? '';
$combination = $_POST['combination'] ?? '';
$course = $_POST['course'] ?? '';
$search = $_POST['search'] ?? '';
$year = $_POST['year'] ?? '';
$exam_list = $_POST['exam_list'] ?? '';
$subjects_list = $_POST['subjects_list'] ?? '';
$explodeExam = explode('~',$exam_list);
$exam_id = $explodeExam[0];
$exam_name = $explodeExam[1];
?>
<div class="card card-primary">
<div class="card-header">
<div class="row">
<div class="col-md-8">
<h3 class="card-title"><b>Exam: </b><?php echo $exam_name; ?> (<?php echo $exam_id; ?>)</h3>
</div>
<div class="col-md-4">
<h3 class="card-title"><b>Year: </b><?php echo $year; ?></h3>
</div>
</div>
</div>
<div class="card-body">
<form action="bulk-assign-subject-submit.php" method="POST">
<div class="row">
<div class="col-md-12">
<div class="table-responsive mt-4" style="width:100%; clear:both;">
<table width="100%" class="table table-striped table-bordered table-hover" id="data_table">
<thead>
<tr>
<th>Exam ID</th>
<th>Year</th>
<th>Student ID</th>
<th>Name</th>
<th>Roll Number</th>
<th>Class/Division</th>
<th>Combination</th>
<th>Course</th>
<?php
if(!empty($subjects_list) && count($subjects_list) > 0) {
foreach($subjects_list as $sub) {
$explodeSub = explode('~',$sub);
$sub_id = $explodeSub[0];
$sub_name = $explodeSub[1];
?>
<th><?php echo $sub_name; ?> (<?php echo $sub_id; ?>)</th>
<?php
}
}
?>
</tr>
</thead>
<tbody>
<?php
$query = "SELECT * FROM `DimStudent_Table` where (`Class`='$class' OR '$class' = '') and (`Division`='$division' OR '$division' = '') and (`Combination`='$combination' OR '$combination' = '') and (`Course`='$course' OR '$course' = '') and (`Student_ID` LIKE '%$search%' OR `Name` LIKE '%$search%' OR `Roll_Number` LIKE '%$search%' OR `Combination` LIKE '%$search%' OR `Course` LIKE '%$search%' OR `Place` LIKE '%$search%' OR '$search' = '')";
$result = mysqli_query($con,$query);
$count = 1;
while($row = mysqli_fetch_array($result) )
{
$id = $row['Student_ID'];
?>
<tr class="odd gradeX">
<td><?php echo $exam_id; ?></td>
<td><?php echo $year; ?></td>
<td><?php echo $id; ?></td>
<td><?php echo $row['Name']; ?></td>
<td><?php echo $row['Roll_Number']; ?></td>
<td><?php echo $row['Class']; ?>/<?php echo $row['Division']; ?></td>
<td><?php echo $row['Combination']; ?></td>
<td><?php echo $row['Course']; ?></td>
<?php
if(!empty($subjects_list) && count($subjects_list) > 0) {
foreach($subjects_list as $sub) {
$explodeSub = explode('~',$sub);
$sub_id = $explodeSub[0];
$sel_result = mysqli_query($con, "select Obtain_Makrs from FactExamresults_Table where Year = '$year' and Student_ID = '$id' and Exam_id = '$exam_id' and Subject_Id = '$sub_id'");
$row_result = mysqli_fetch_array($sel_result);
$Obtain_Makrs = '';
if(!empty($row_result)) {
$Obtain_Makrs = $row_result['Obtain_Makrs'];
}
?>
<td><div contentEditable='true' class='edit' id='<?php echo $year."~~".$id."~~".$exam_id."~~".$sub_id; ?>'><?php echo $Obtain_Makrs; ?></div></td>
<?php
}
}
?>
</tr>
<?php
$count ++;
}
?>
</tbody>
</table>
</div>
</div>
</div>
</form>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
</section>
</div>
<?php include 'footer.php'; ?>
<script>
$(function () {
$("#data_table").DataTable({
"lengthChange": false,
"autoWidth": false,
"paging": false,
"columnDefs": [
{ "targets": [0], "visible": false, "searchable": false },
{ "targets": [1], "visible": false, "searchable": false }
],
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"],
//"pageLength": 10,
}).buttons().container().appendTo('.dataTables_wrapper .col-md-6:eq(0)');
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$('.edit').click(function(){
$(this).addClass('editMode');
});
$(".edit").focusout(function(){
$(this).removeClass("editMode");
var id = this.id;
var value = $(this).text().trim();
if(value == '') {
return;
}
if (!/^\d+(\.\d+)?$/.test(value)) { // Allows integers or decimals
alert("Please enter a valid numeric value.");
$(this).text("");
return;
}
$.ajax({
url: 'update-exam-marks.php',
type: 'post',
data: { Data1:id, value:value},
success:function(response){
console.log('Save successfully');
}
});
});
});
</script>
<script>
$("#select_all").change(function(){
var status = $(this).prop("checked");
$('.chk_receipt').each(function(){
$(this).prop("checked",status);
if(status)
{
$(this).parents("span").addClass("checked");
}
else
{
$(this).parents("span").removeClass("checked");
}
});
});
$('.chk_receipt').change(function(){
if($(this).prop("checked") == false){
$("#select_all").prop("checked",false);
$("#select_all").parents("span").removeClass("checked");
}
if ($('.chk_receipt:checked').length ==$('.chk_receipt').length ){
$("#select_all").prop("checked",true);
$("#select_all").parents("span").addClass("checked");
}
});
</script>
<script>
$(document).ready(function() {
$('.exam_year_list').on('change', function() {
var year = $(this).val();
if (year != '') {
$.ajax({
url: 'fetch_exams.php',
method: 'POST',
data: { year: year },
success: function(data) {
$('.exam_list').html(data);
$('.subjects_list').html('');
}
});
} else {
$('.exam_list').html('<option value="">--Select--</option>');
}
});
$('.exam_list').on('change', function() {
var exam_id = $(this).val();
if (exam_id != '') {
$.ajax({
url: 'fetch_subjects.php',
method: 'POST',
data: { exam_id: exam_id },
success: function(data) {
$('.subjects_list').html(data);
}
});
} else {
$('.subjects_list').html('');
}
});
});
</script>