-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathbio_add.php
More file actions
44 lines (28 loc) · 843 Bytes
/
Copy pathbio_add.php
File metadata and controls
44 lines (28 loc) · 843 Bytes
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
<?php
include_once 'config/config.php';
var_dump($_POST);
if (isset($_POST['submit']))
{
$bf=$_POST['biofile'];
echo $bf;
$handle = fopen($bf, 'r');
if ( ! $handle ) {
echo 'File does not exists in this location';
echo mysqli_error($connection_obj);
exit;
}
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$q="INSERT INTO employee_attendance (`Employee_attendance_id`,`Employee_id`, `Checkin_time`, `Checkout_time`, `Bio_date`) values('".$data[0]."','".$data[1]."','".$data[2]."','".$data[3]."','".$data[4]."')";
$status = mysqli_query($connection_obj,$q);
}
if($status)
{
header("location:./Biosuccess.php");
}
else
{
//header("location:./500.php");
echo mysqli_error($connection_obj);
}
}
?>