-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstore.php
More file actions
110 lines (107 loc) · 3.44 KB
/
store.php
File metadata and controls
110 lines (107 loc) · 3.44 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
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Store Details </title>
</head>
<body style="background-color:skyblue">
<hr />
<center> <h2> Store Details </h2> </center>
<hr />
<center>
<form #action="details.php" method = "post">
<br />
<table>
<tr>
<td><br />SID       </td>
<td><br /><input type="name" name="storeid" /><font color="RED" SIZE="2">*</font>            </td>
</tr>
<tr>
<td><br />Name       </td>
<td><br /><input type="name" name="name" /><font color="RED" SIZE="2">*</font>            </td>
</tr>
<tr>
<td><br />Street Name       </td>
<td><br /><input type="name" name="streetname" /><font color="RED" SIZE="2">*</font>            </td>
</tr>
<tr>
<td><br /> No Of Employee       </td>
<td><br /><input type="name" name="noe" />            </td>
</tr>
<tr>
<td> <br /> Location       </td>
<td><br /><select name="location" multiple>
<option value="Arunachal Pradesh">Arunachal Pradesh</option>
<option value="Assam">Assam</option>
<option value="Andhra Pradesh">Andhra Pradesh</option>
<option value="Rajasthan">Rajasthan</option>
<option value="Punjab">Punjab</option>
<option value="Haryana">Haryana</option>
<option value="Uttar Pradesh">Uttar Pradesh</option>
<option value="Gujarat">Gujarat</option>
<option value="Hyderabad">Hyderabad</option>
<option value="Banglore">Banglore</option>
<option value="Kerla">Kerla</option>
<option value="Orissa">Orissa</option>
<option value="West Bengal">West Bengal</option>
<option value="Other">Other</option>
</select><font color="RED" SIZE="2">*</font></td>
</tr>
<tr>
<td><br /> If Other       </td>
<td><br /><input type="name" name="othr">             </td>
</tr>
<tr>
</table>
<br /><br /><input type ="submit" value="Submit">
</center>
</form>
<?php
$con = mysql_connect("localhost","root","");
if(!$con)
{
die("Connection Failed");
}
if(!(mysql_select_db("medical_inventory", $con)))
{
die ("Database Not Selected");
}
if (isset($_POST['storeid']) && isset($_POST['name']) && isset($_POST['streetname']) && isset($_POST['noe']))
$query = "INSERT INTO store (SID,Name,Streetname,No_of_Employee) VALUES ('$_POST[storeid]','$_POST[name]','$_POST[streetname]','$_POST[noe]')";
if (isset ($query))
$sql = mysql_query($query,$con);
if (isset ($sql))
if (!$sql)
{
echo "<br /> <font size='2' color='red'>*Required Fields are Mandotary</font>";
}
?>
<?php
$con = mysql_connect("localhost","root","");
if(!$con)
{
die("Connection Failed");
}
if(!(mysql_select_db("medical_inventory", $con)))
{
die ("Database Not Selected");
}
if (isset($_POST['storeid']) && isset($_POST['location']))
{
if($_POST['location'] == "Other")
$query = "INSERT INTO storelocation VALUES ('$_POST[storeid]','$_POST[othr]')";
else
$query = "INSERT INTO storelocation VALUES ('$_POST[storeid]','$_POST[location]')";
}
if (isset ($query))
$sql = mysql_query($query,$con);
if (isset ($sql))
if (!$sql)
{
echo "<br /> <font size='2' color='red'>*Required Fields are Mandotary</font>";
}
else
header ("Location:option.php");
?>
</body>
</html>