-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcandidates_list.php
104 lines (80 loc) · 3.11 KB
/
candidates_list.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<h1 class="page-header">Promoted Students </h1>
<div class="col-md-12">
<div class="row">
<div class="alert alert-success" id="correct"> Student is now removed from Promotion!</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Students List</h3>
</div>
<div class="panel-body">
<form id="promote" method="POST" >
<table id="students" class="table table-bordered">
<center> <button class="btn btn-info" onclick="confirm('ARE YOU SURE YOU WANT THEM TO REMOVED FROM LIST?')" type="submit">Remove</button></center>
<input type="hidden" name="sy" id="sy" value="<?php echo $_GET['sy'] ?>">
<thead>
<tr id="heads">
<th style="width:10%">REG NO.</th>
<th style="width:20%">Name</th>
<th style="width:10%">Gender</th>
<th style="width:10%">Curriculum</th>
<th style="width:10%"><center><label><input type="checkbox" id="selectall">Select All</label></center></th>
</tr>
</thead>
<tbody>
<?php
include 'db.php';
$sql= mysqli_query($conn, "SELECT * FROM student_info left join program on student_info.PROGRAM=program.PROGRAM_ID WHERE STUDENT_ID IN (SELECT STUDENT_ID FROM promotion_candidates) ");
while($row = mysqli_fetch_assoc($sql)) {
?>
<tr>
<td><?php echo $row['LRN_NO'] ?></td>
<td><?php echo $row['LASTNAME'] . ' ' . $row['FIRSTNAME']. ' ' . $row['MIDDLENAME'] ?></td>
<td><?php echo $row['GENDER'] ?></td>
<td><?php echo $row['PROGRAM'] ?></td>
<td><center><input type="checkbox" name="id[]" class="checkitems" value="<?php echo $row['STUDENT_ID'] ?>"></center></td>
</tr>
<?php
} mysqli_close($conn);
?>
</form>
</tbody>
</table>
</div>
</div>
</div>
<script type="text/javascript">
$(function() {
$("#students").dataTable(
{ "aaSorting": [[ 0, "asc" ]] }
);
});
</script>
<script>
jQuery(document).ready(function(){
$('#correct').hide()
jQuery("#promote").submit(function(e){
e.preventDefault();
var formData = jQuery(this).serialize();
var sy =$('#sy').val();
$.ajax({
type: "POST",
url: "del_promote.php",
data: formData,
success: function(html){
if(html=='true' )
{
$("#correct").slideDown();
var delay = 2000;
setTimeout(function(){ window.location.href='rms.php?page=candidates_list&sy='+sy; }, delay);
} }
});
return false;
});
});
</script>
<script>
$("#selectall").click(function()
{ $('.checkitems').prop("checked", $(this).prop("checked"));
});
</script>