-
Notifications
You must be signed in to change notification settings - Fork 0
/
donor.php
121 lines (93 loc) · 3.13 KB
/
donor.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
<!---------------------------->
<!--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: 120vh;
}
</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="donor.php" method="post">
<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" onclick="myFunction()" class="button button-block" name="submit" />Donate</button>
</form>
</div><
</div>
</div>
</div>
</body>
<script>
function myFunction() {
alert("Thank You For Donating");
}
</script>
<!---------------------------->
<!--php start-->
<!---------------------------->
<?php
include('dbcon.php');
if(isset($_POST['submit'])){
$medicine=$_POST['medicine'];
$edate=$_POST['edate'];
$company=$_POST['company'];
$quantity=$_POST['quantity'];
$city=$_POST['city'];
$pharmasy=$_POST['pharmasy'];
// insert data
$qry1="INSERT INTO `donor`(`do_medicine`, `do_date`,`do_manufacturer`, `do_quantity`,`do_city`, `do_pharmacy`) VALUES ('$medicine','$edate','$company','$quantity','$city','$pharmasy')";
// execute query and show results or error
if ($connection->query($qry1) === TRUE) {
echo "Medicine Donated Successfully";
}else{
echo "Error in inserting: ".$connection->error;
}
}
?>
<!---------------------------->
<!--php end-->
<!---------------------------->
</html>
<!---------------------------->
<!--html end-->
<!---------------------------->