-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGuest.php
More file actions
146 lines (129 loc) · 3.6 KB
/
Copy pathGuest.php
File metadata and controls
146 lines (129 loc) · 3.6 KB
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
<!DOCTYPE html>
<html>
<title>Guest Entry Form</title>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="assets/css/bootstrap.css">
<style>
form {
border: 1px solid #f1f1f1;
}
input, select{
width: 100%;
padding: 12px 10px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
section{
margin-left: 40%;
margin-right: 40%;
}
button {
background-color: royalblue;
color: white;
padding: 12px 10px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
}
button:hover {
opacity: 0.8;
}
.imgcontainer {
text-align: center;
margin: 24px 0 12px 0;
}
img.avatar {
width: 30%;
border-radius: 20%;
height: 40%;
}
.container {
padding: 16px;
}
.btn {
width: 70px;
float: left;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<section>
<h2 style="color:red;">ENTRY FORM</h2>
</section>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-6 xs-12">
<form name="myform" method="post"action="Guest_db.php" onsubmit="return validateForm()">
<div class="imgcontainer">
<img src= "img/abes.png" alt="Image" class="avatar">
</div>
<label><b>Name</b></label>
<input type="text" placeholder="Enter Name" name="uname" id="name" required>
<label><b>Contact</b></label>
<input type="text" placeholder="Enter contact number" name="phone" id="contact"required>
<label for="radio"><b>Gender</b></label>
<input type="radio" name="gender" id="gender" value="Male" > Male
<input type="radio" name="gender" id="gender" value="Female" > Female<br>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "abes";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$s="SELECT * from department";
$rs=$conn->query($s);
?>
<label><b>Select Department</b></label>
<select name="dep" id="dep" >
<?php
while($rows=$rs->fetch_assoc())
{
echo"<option value=".$rows['dep_name'].">".$rows['dep_name']."</option>";
}
?>
</select>
<label><b>Select Faculty Name</b></label>
<select name="emp" id="emp">
<option value="AS">Anand Srivastava</option>
<option value="RM">Rashmi Mishra</option>
</select>
<label><b>In-Time</b></label>
<input type="time" name="int" >
<label><b>Out-Time</b></label>
<input type="time" name="out" >
<label><b>Date</b></label>
<input type="date" name="date" >
<button type="submit" name="submit" value="Save">Submit</button>
<button type="buton" class="btn btn-danger">Cancel</button>
</form>
</div>
<div class="col-md-6 xs-12">
<?php
include("entryform.php");
?>
</div>
</div>
</div>
<script>
function validateForm(){
var name=document.myform.name.value;
var phone=document.myform.phone.value;
if(name==null||phone==""|| phone.length<10){
alert("The fields cannot be blank");
return false;
}
}
</script>
</body>
</html>