-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcandidate_list.php
137 lines (122 loc) · 5.81 KB
/
candidate_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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
require_once("header.php");
require_once("sidebar.php");
$can = $conn->query("SELECT * FROM `candidate` WHERE candidate.status='candidate'");
if (isset($_GET['srtId'])) {
$id = $_GET['srtId'];
$type = $_GET['type'];
if ($type == 'yes') {
$conn->query("UPDATE `candidate` SET `shortlisted` = 'no' WHERE `candidate`.`id` = $id;"); ?>
<script>
window.location.href = "candidate_list.php";
</script>
<?php
} else {
$conn->query("UPDATE `candidate` SET `shortlisted` = 'yes' WHERE `candidate`.`id` = $id;"); ?>
<script>
window.location.href = "candidate_list.php";
</script>
<?php
}
}
?>
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Candidate List</a></li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Candidate List</h3>
<a href="shortlist_cnd.php" class="float-right btn btn-info">Shortlisted Candidate</a>
</div>
<!-- /.card-header -->
<div class="card-body">
<table id="myTable" class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>photo</th>
<th>Email</th>
<th>Phone</th>
<th>Gender</th>
<th>Shortlisted</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php while ($c = $can->fetch_assoc()) { ?>
<tr>
<td><?php echo $c['id'] ?>
</td>
<td><?php echo $c['name'] ?>
</td>
<td><img width="50" height="50"
src="./assets/images/<?php echo $c['photo']; ?>" />
</td>
<td><?php echo $c['email'] ?>
</td>
<td><?php echo $c['phone'] ?>
</td>
<td><?php echo $c['gender'] ?>
</td>
<td><?php echo $c['shortlisted'] ?>
</td>
<td>
<?php if ($c['shortlisted'] == "no") { ?>
<a href="candidate_list.php?srtId=<?php echo $c['id'] ?>&type=no"
class="btn btn-sm btn-info" title="Add to shortlist"><i
class="fas fa-user-check"></i></a>
<?php
} else { ?>
<a href="candidate_list.php?srtId=<?php echo $c['id'] ?>&type=yes"
class="btn btn-sm btn-danger" title="Add to shortlist"><i
class="fas fa-user-times"></i></a>
<?php
}
?>
<a href="candidate_details.php?id=<?php echo $c['id'] ?>"
class="btn btn-sm btn-info" title="VIew Details"><i
class="fas fa-address-card"></i></a>
<!-- <a href="" class="btn btn-sm btn-info" title="Edit"><i class="fas fa-edit"></i></a>
<a href="candidate_list.php?delId=<?php echo $c['id'] ?>"
onclick="return confirm('Are you sure?')" title="delete" class="btn btn-sm
btn-danger"><i class="fas fa-trash"></i></a> -->
<a href="C_update.php?id=<?php echo $c['id']; ?>"
class="btn btn-sm btn-info"><i class="fas fa-edit"></i></a>
<a href="C_delete.php?id=<?php echo $c['id'];?>"
class="btn btn-sm btn-danger" onclick="return confirm('Are you sure?')"><i
class="fas fa-trash"></i></a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<!-- /.card -->
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<?php require("footer.php");?>
<script>
jQuery(document).ready(function($) {
$('#myTable').DataTable({});
});
</script>