-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert.php
More file actions
141 lines (135 loc) · 3.54 KB
/
insert.php
File metadata and controls
141 lines (135 loc) · 3.54 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
<?php
require('database.php');
$status = "";
if(isset($_POST['new']) && $_POST['new']==1){
$product =$_REQUEST['product'];
$quan = $_REQUEST['quan'];
$price = $_REQUEST['price'];
$ins_query="insert into inventory
(`Products`,`Quantity(unit/kg)`,`Price(unit/kg)`)values
('$product','$quan','$price')";
mysqli_query($conn,$ins_query)
or die(mysql_error());
$status = "New Record Inserted Successfully.
</br></br><a href='view.php'>View Inserted Record</a>";
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert New Record</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway:400,500,600&Cinzel">
<style>
body{
margin: 0;
padding: 0;
width: 100%;
height: 100%;
width: 100%;
height: 100%;
margin-top: 25px;
background: url("https://images.pexels.com/photos/3473569/pexels-photo-3473569.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940.jpg") no-repeat 50% 50%;
top: 0;
display: table;
background-size: cover;
}
.content h1{
font-family: 'Raleway', sans-serif;
color: #f9f3f4;
font-size: 200%;
text-shadow: 0 0 300px #000;
}
.content{
max-width: 500px;
margin: auto;
text-align: center;
}
.form{
text-align: center;
color: #f9f3f4;
}
a{
text-decoration: none;
color: white;
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
font-size: 20px;
}
.content .a span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
form{
text-align: center;
font-size: 25px;
font-family:'Raleway', sans-serif;
}
button{
border-radius: 7px;
color: #000;
text-decoration: none;
font-family: 'Raleway', sans-serif;
font-size: 20px;
border: 3px solid;
padding: 10px 16px;
font-weight: bold;
display: inline-block;
margin-right: 25px;
margin-top: 25px;
transition: all 0.5s;
cursor: pointer;
}
input {
width: 300px;
height: 25px;
padding-bottom: 15px;
border-radius: 15px;
}
::placeholder{
font-size: 20px;
text-align: center;
font-family: 'Raleway', sans-serif;
}
</style>
<div align="right">
<div id="google_translate_element"></div>
<span><script type="text/javascript">
//<![CDATA[
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
}, 'google_translate_element');
}
//]]>
</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</script></span></div>
</head>
<body>
<div class="form">
<div class="a">
<a href="welcome.html">Back to home</a>
| <a href="dashboard.php">Dashboard</a>
| <a href="view.php">View Records</a>
</div>
<div class="content">
<h1>Insert New Record</h1>
<form name="form" method="post" action="">
<input type="hidden" name="new" value="1" />
<input type="text" name="product" placeholder="Enter Product" required /><br><br>
<input type="number" name="quan" placeholder="Enter Quantity" required /><br><br>
<input type="number" name="price" placeholder="Enter Price" required /><br><br>
<button name="submit" id="submit" type="submit" value="Submit">Submit</button>
</form>
<p style="color:#FF0000;"><?php echo $status; ?></p>
</div>
</div>
</body>
</html>