-
Notifications
You must be signed in to change notification settings - Fork 23
/
act_attendance_updt.php
187 lines (158 loc) · 8.55 KB
/
act_attendance_updt.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<?php
include './Database/Controler.php';
include 'role.php';
//print_r($_SESSION["att"]);
?>
<script>
function like(rn)
{
var i=rn;
$.ajax({
type: "GET",
url:"at_clr.php",
data:"lid="+document.getElementById(i).style.color,
success:function(result)
{
if(document.getElementById(i).style.color=="green")
{
$("#").html(result);
$("#ch"+i).val(result);
var c="red";
document.getElementById(i).style.color=c;
}
else
{
$("#").html(result);
result='1';
$("#ch"+i).val(result);
var c="green";
document.getElementById(i).style.color=c;
}
}
});
}
</script>
<h2>Attendance Sheet</h2>
</div>
</div>
<!-- /. ROW -->
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<br>
 <b>Faculty Name:</b> <?php echo $_SESSION["my_fac"]; ?>
   <b> Subject:</b><?php
foreach($_SESSION["sn"] as $sn)
{
echo $sn->sub_name;
}
?>
    <b> Date:</b><?php echo $_SESSION["att"]["dt"]; ?>
    <b> Division:</b><?php echo $_SESSION["att"]["div"];
?>
<br>
<?php
if($_SESSION["new_att"]){
?>
<div style="float:right;">
<form method="post">
<button type="submit" id="all_pr" name="all_pr" class="btn btn-success">All Present</button>
<button type="submit" id="all_ab" name="all_ab" class="btn btn-danger">All Absent</button> 
</form>
</div><br><br>
<!-- Advanced Tables -->
<center>
<form method="post" role="form" enctype="multipart/form-data">
<?php
$_SESSION["atotal"]=sizeof($_SESSION["q1"]);
//echo "hi".$_SESSION["sid"];
$cnt=0;
foreach ($_SESSION["new_att"] as $k => $v)
{
$cnt++;
?>
<a href="#">
<i class="fa fa-user fa-2x" id="<?php echo $v->s_enrl;?>" name="<?php echo $v->s_enrl;?>"
<?php
if(isset($_REQUEST["all_pr"]))
{
echo 'style="color:green;"';
}
elseif(isset($_REQUEST["all_ab"]))
{
echo 'style="color:red;"';
}
else
{
if($v->present=='1')
{
echo 'style="color:green;"';
}
else
{
echo 'style="color:red;"';
}
}
?>
onClick="return like(<?php echo $v->s_enrl;?>);">
<?php echo "<br><h6>".$v->s_rn."</h6>"; ?>
</i>
</a>
<input type="hidden" value="<?php echo $v->s_enrl; ?>" id="<?php echo "r".$cnt; ?>" name="<?php echo "r".$cnt; ?>">
<input type="hidden" name="<?php echo "ch".$v->s_enrl; ?>" id="<?php echo "ch".$v->s_enrl; ?>"
<?php
if(isset($_REQUEST["all_pr"]))
{
echo 'value="1"';
}
elseif(isset($_REQUEST["all_ab"]))
{
echo 'value="0"';
}
else
{
if($v->present=='1')
{
echo 'value="1"';
}
else
{
echo 'value="0"';
}
}
?>
>
 
<?php
}
?>
<center><br>
<button type="submit" id="att_submit_updt" name="att_submit_updt" value="submit" class="btn btn-primary"style="height: 100%; width: 30%;">Submit</button>
</center> <br>
</form>
<?php
}
else
{
echo "<br><center><b><h3>No Student Available...<br>Please Add students First...</h3></b></center><br>";
echo "<a href='bulk_stu_det.php'><center><b>Add Multiple Stuudent From here</b></center></a><br>";
}
?>
</center>
</div>
</div>
</div>
<!-- end Context Classes -->
</div>
</div>
<!-- /. ROW -->
</div>
</div>
<!-- /. PAGE INNER -->
</div>
<!-- /. PAGE WRAPPER -->
<!-- /. WRAPPER -->
<!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME-->
<?php
include 'footer.php';
?>