-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathchange_dp.php
69 lines (62 loc) · 2.24 KB
/
change_dp.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
<?php
include_once 'header_h.php';
?>
<?php
$eid = $_SESSION['employee_id'];
?>
<?php
if (isset($_POST['submit'])) {
include_once 'config/config.php';
$img = addslashes($_POST['img']);
if (move_uploaded_file($_FILES['img']['tmp_name'], "./$img")) {
//echo "copy success";
}
$q = "update employee set img='$img' where Employee_id='$eid'";
$status = mysqli_query($connection_obj, $q);
if ($status) {
echo '<script language="javascript">';
echo 'alert("DP updated")';
echo "</script>";
header("location:./dashbord.php");
} else {
echo "insert error" . mysqli_error($connection_obj);
//header("location:./500.php");
}
}
?>
<form method="post" enctype="multipart/form-data">
<section class="content">
<div class="container-fluid">
<div class="block-header">
<h2>EMPLOYEE</h2>
</div>
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="card">
<div class="body">
<h2 class="card-inside-title">Image:</h2>
<div class="row clearfix">
<div class="col-sm-12">
<div class="form-group">
<div class="form-line">
<input type="file" name="img" class="form-control" />
</div>
</div>
<center>
<input class="btn btn-primary waves-effect" name="submit" type="submit"
value="SUBMIT">
<input type="reset" name="close" class="btn btn-primary waves-effect"
value="RESET">
</center>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</form>
<?php
include_once 'footer_h.php';
?>