-
Notifications
You must be signed in to change notification settings - Fork 0
/
receive.php
135 lines (101 loc) · 3.54 KB
/
receive.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
126
127
128
129
130
131
132
133
134
135
<!---------------------------->
<!--html start-->
<!---------------------------->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="samra_anwar.css">
</head>
<body>
<!--internal css-->
<style>
.Donor_bg {
height: 140vh;
}
</style>
<div class="Donor_bg">
<div id="container">
<div id="header">
<h1>Donate Medicine or Help Messes </h1>
</div>
<div id="nav">
<ul>
<li> <a href="dashboard.php"><b>Home</b></a></li>
<li> <a href="donor.php"><b>Donor</b> </a></li>
<li><a href="receive.php"><b>Receiver</b> </a></li>
<li><a href="about.php"> <b>About</b> </a></li>
<li> <a href="signup.php"><b>login/signup</b> </a></li>
<li> <a href="login.php"><b>LogOut</b> </a></li>
</ul>
</div>
</div>
<div class="form">
<form action="receive.php" method="post">
<div class="field-wrap">
<input type="text" name="reciever" placeholder="Name of Reciever">
</div>
<div class="field-wrap">
<input type="text" name="number" placeholder="Number of Reciever">
</div>
<div class="field-wrap">
<input type="text" name="medicine" placeholder="name of medicine">
</div>
<div class="field-wrap">
<input type="date" name="edate" placeholder="exp date of medicine">
</div>
<div class="field-wrap">
<input type="text" name="quantity" placeholder="quantity of medicine">
</div>
<div class="field-wrap">
<input type="text" name="city" placeholder="name of city">
</div>
<div class="field-wrap">
<input type="text" name="pharmasy" placeholder="name of pharmasy">
</div>
<!-- <button type="submit" class="button button-block" name="submit">Donate</button>-->
<button type="submit" onclick="myFunction()" class="button button-block" name="submit" />Reciever</button>
</form>
</div><!-- tab-content -->
</div> <!-- /form -->
</div>
</div>
</body>
<script>
function myFunction() {
alert("Thank You For Recieving");
}
</script>
<!---------------------------->
<!--php start-->
<!---------------------------->
<?php
include('dbcon.php');
if(isset($_POST['submit'])){
$reciever=$_POST['reciever'];
$number=$_POST['number'];
$medicine=$_POST['medicine'];
$edate=$_POST['edate'];
$company=$_POST['company'];
$quantity=$_POST['quantity'];
$city=$_POST['city'];
$pharmasy=$_POST['pharmasy'];
$qry1="INSERT INTO `reciever`(`re_reciever`, `re_number`,`re_medicine`, `re_date`,`re_manufacturer`, `re_quantity`,`re_city`, `re_pharmacy`) VALUES ('$reciever','$number','$medicine','$edate','$company','$quantity','$city','$pharmasy')";
// execute query and show results or error
if ($connection->query($qry1) === TRUE) {
echo "Medicine Recieved Successfully";
}else{
echo "Error in inserting: ".$connection->error;
}
}
?>
<!---------------------------->
<!--php end-->
<!---------------------------->
</html>
<!---------------------------->
<!--html end-->
<!---------------------------->