-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathram.php
125 lines (114 loc) · 4.55 KB
/
ram.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
<?php
if(count($_POST)>0) {
require_once("db.php");
$sql = "INSERT INTO emp1 (First_name,Last_name, gender, dob, salary, department ,departmanager ,hiredate) VALUES ('" . $_POST["First_Name"] . "','" . $_POST["Last_name"] . "','" . $_POST["gender"] . "','" . $_POST["dob"] . "','" . $_POST["salary"] . "','" . $_POST["depart"] . "','" . $_POST["manager"]. "','" . $_POST["joindate"] . "')";
echo $sql;
mysqli_query($conn,$sql);
$current_id = mysqli_insert_id($conn);
if(!empty($current_id)) {
$message = "New Employee Details are Added Successfully";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="tutorial-boostrap-merubaha-warna">
<meta name="author" content="ilmu-detil.blogspot.com">
<title>Tutorial CRUD JSON DATA</title>
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
$( "#datepicker" ).datepicker({ dateFormat: 'yy-mm-dd' });
} );
</script>
<script>
$( function() {
$( "#datepicker1" ).datepicker({ dateFormat: 'yy-mm-dd' });
} );
</script>
</script>
<style type="text/css">
.navbar-default {
background-color: #3b5998;
font-size: 18px;
color: #ffffff;
}
</style>
</head>
<body>
<?php
include ("Header.php");
?>
<div class="container">
<div class="container" style="color:green">
<h1 class="text-center" style="margin-top:100px;">Employee Details</h1>
</div>
<div class="container" style="width:50%; height:83%; solid gray;padding:20px;">
<form name="frmUser" method="post" action="">
<div class="form-group">
<label for="id1">First_Name</label>
<input class="form-control" type="text" required="required" name="First_Name" placeholder="Enter Name">
</div>
<div class="form-group">
<label>Last Name</label>
<input type="text" class="form-control" name="Last_name" placeholder="Last_Name">
<span class="help-block"></span>
</div>
<div class="form-group">
<label for="inputAge">Gender</label>
<select class="form-control" name="gender">
<option value="">Gender</option>
<option value="M">M</option>
<option value="F">F</option>
</select> <span class="help-block"></span>
</div>
<div class="form-group ">
<label for="inputLName">D.O.B</label>
<input type="text" class="form-control" id="datepicker" name="dob" placeholder="Date Of Birth (YYYY-MM-DD)">
<span class="help-block"></span>
</div>
<div class="form-group">
<label for="id2">Salary</label>
<input class="form-control" type="text" required="required" name="salary" id="id2" placeholder="Enter SAlary">
</div>
<div class="form-group ">
<label for="inputLName">Department</label>
<input type="text" class="form-control" name="depart" placeholder="department">
<span class="help-block"></span>
</div>
<div class="form-group">
<label for="inputAge">Department Manager</label>
<select class="form-control" name="manager">
<option value="">Manager</option>
<option value="self">Self</option>
</select>
<span class="help-block"></span>
</div>
<div class="form-group">
<label for="inputAge">Join Date</label>
<input type="text" class="form-control" name="joindate" id="datepicker1" placeholder="Join Date (YYYY-MM-DD)">
<span class="help-block"></span>
</div>
<br>
<div style="text-align:center">
<button type="submit" name="submit" value="Submit" class="btn btn-primary">Submit</button>
<a class="btn btn btn-default" href="index1.php">Back</a>
</div>
</div>
</div>
</form>
</div>
<br>
<br>
<br>
<?php
include ("footer.php");
?>
</body></html>