-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathattendance.php
151 lines (136 loc) · 4.96 KB
/
attendance.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
<?php
session_start();
include("header.php");
include("dbconnection.php");
$result = mysql_query("SELECT * FROM branch");
$resultemp = mysql_query("SELECT * FROM employees where empid!='100'");
if(isset($_POST[Submit]))
{
$resultatt = mysql_query("SELECT * FROM attendance where empid='$_POST[employeename]' ");
}
else
{
$resultatt = mysql_query("SELECT * FROM attendance");
}
?>
<div id="templatemo_content">
<div id="templatemo_content_left">
<div class="header_02">Employees Attendance report</div>
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
<table width="409" border="1">
<tr>
<th width="181" scope="row"><label for="branchname2">Branch Name</label> </th>
<td width="212"><select name="branchname" id="branchname" va>
<option></option>
<?php
while($row = mysql_fetch_array($result))
{
echo "<option value='". $row['branchid'] . "'>" . $row['branchname']. "</option>";
}
?>
</select></td>
</tr>
<tr>
<th scope="row"><label for="employeename">Employee Name</label> </th>
<td><select name="employeename" id="employeename">
<?php
while($row = mysql_fetch_array($resultemp))
{
echo "<option value='". $row['empid'] . "'>" . $row['fname']. " ". $row['lname'] ."</option>";
}
?>
</select></td>
</tr>
<tr>
<th scope="row"><label for="month">Month
/
Year
</label> </th>
<td><select name="month" id="month">
<option value="01">January</option>
<option value="02">February</option>
<option value="03">March</option>
<option value="04">April</option>
<option value="05">May</option>
<option value="06">June</option>
<option value="07">July</option>
<option value="08">August</option>
<option value="09">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
<select name="year" id="year">
<?php
for($yr = 2013; $yr <= 2015; $yr++)
{
echo "<option value='$yr'>$yr</option>";
}
?>
</select></td>
</tr>
<tr>
<th scope="row"> </th>
<td> </td>
</tr>
<tr>
<th scope="row"> </th>
<td><input type="submit" name="submit" id="submit" value="Submit" /></td>
</tr>
</table>
<br />
<table width="614" border="1">
<tr>
<th width="108" scope="row"><strong>Employee ID</strong></th>
<th width="181"><strong> Employe Name</strong></th>
<th width="155"><strong>Login Time</strong></th>
<th width="142"><strong>Logout Time</strong></th>
<th width="142"> Working hours</th>
</tr>
<?php
while($rwarray = mysql_fetch_array($resultatt))
{
$resultempa = mysql_query("SELECT * FROM employees where empid='$rwarray[empid]'");
$resarr = mysql_fetch_array($resultempa);
$resulatt = mysql_query("SELECT TIMEDIFF( '$rwarray[logout]', '$rwarray[logintime]' )");
$resarra = mysql_fetch_array($resulatt);
echo "<tr>
<td> $rwarray[empid]</td>
<td> $resarr[fname] $resarr[lname]</td>
<td> $rwarray[logintime]</td>
<td> $rwarray[logout]</td>
<td> $resarra[0]</td>
</tr>";
}
?>
</table>
<p> </p>
</form>
<p> </p>
<div class="rc_btn_02"></div>
<div class="margin_bottom_40"></div>
<div class="cleaner"></div>
</div> <!-- end of content left -->
<div id="templatemo_content_right">
<div class="content_right_section">
<div class="header_02">Admin Menu</div>
<?php
if($_SESSION["logintype"] = "Admin")
{
include("adminsidebar.php");
}
else
{
include("empsidebar.php");
}
?>
<div class="margin_bottom_20"></div>
<div class="margin_bottom_20"></div>
<div class="margin_bottom_20"></div>
</div>
</div> <!-- end of content right -->
<div class="cleaner"></div>
</div>
<?php
include("footer.php");
?>