-
Notifications
You must be signed in to change notification settings - Fork 0
/
post.php
77 lines (71 loc) · 2.15 KB
/
post.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<style>
div.ex
{
width:95%;
padding:10px;
border:5px solid gray;
margin:0px;
background-color :#e0ffff;
}
</style>
</head>
<body>
<?php
$time=time();
$TodayDate=date("Y-m-d",$time);
include 'db_connection.php';
/* $sql_delete = "DELETE FROM bloodrequestpost
WHERE DATEDIFF(removedate,'$TodayDate') = 0
OR DATEDIFF(removedate,'$TodayDate') < 0";*/
$sql_delete = "DELETE FROM bloodrequestpost
WHERE DATEDIFF(removedate,'$TodayDate') < 0";
mysqli_query($con,$sql_delete);
?>
<?php
if(isset($_POST['submit']))
{
$email = $_POST['email'];
$headline = $_POST['headline'];
$bloodgroup = $_POST['blood'];
$description = $_POST['description'];
// $time=time();
//$removedate=date_format(date_modify(date_create(date("Y-m-d",$time)),"+3 days"),"Y-m-d");
$removedate=$_POST['to'];
include 'db_connection.php';
$sql="INSERT INTO bloodrequestpost (email,headline, bloodgroup, description, removedate)
VALUES
('$email','$headline','$bloodgroup','$description','$removedate')";
mysqli_query($con,$sql);
}
$sql_post = "select * from bloodrequestpost";
if($query_run= mysqli_query($con,$sql_post)){
while($query_row= mysqli_fetch_assoc($query_run)){
$headlines=$query_row['headline'];
$bloodgroups=$query_row['bloodgroup'];
$descriptions=$query_row['description'];
$date=$query_row['removedate'];
?>
<div class="ex">
<hr><aside>
<style>
h3{color:blue};
</style>
<?
echo '<h3>'.$headlines.'</h3>';
echo '<b>Blood Group :'.$bloodgroups.'</b><br>';
echo 'DATE :'.'<b>'.$date.'<b>';
echo '<p>'.$descriptions.'</p>';
?>
</aside>
</div>
<?
}
}
?>
</body>
</html>