-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd.php
More file actions
121 lines (97 loc) · 4.53 KB
/
Copy pathadd.php
File metadata and controls
121 lines (97 loc) · 4.53 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
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script type="text/javascript"></script>
<link href="https://fonts.googleapis.com/css?family=Josefin+Sans&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/bootstrap.min.css">
<script src="../js/jquery-3.2.1.min.js"></script>
<script src="../js/bootstrap.js"></script>
<style type="text/css">
.btn btn-outline-success
{
margin: 50px;
}
#wer
{
margin : 30px;
}
</style>
</head>
<body>
<?php
global $conn;
if(isset($_POST['submit'])){
$servername = "localhost:3308";
$username = "bhavya";
$password = "1111";
$database="myDB";
// Create connection
$conn = mysqli_connect($servername, $username, $password,$database);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
@$user=mysqli_real_escape_string($conn,$_POST['id']);
@$sym=mysqli_real_escape_string($conn,$_POST['sym']);
@$sugg=mysqli_real_escape_string($conn,$_POST['sugg']);
@$file=mysqli_real_escape_string($conn,$_POST['file']);
$dataTime = date("Y-m-d");
// Get image name
$image = $_FILES['image']['name'];
// Get text // image file directory
$target = "images1/".basename($image);
if(move_uploaded_file($_FILES['image']['tmp_name'], $target)) {
$msg = "Image uploaded successfully";
}else{
$msg = "Failed to upload image";
}
$sql = "INSERT INTO information(id,sym,sugg,file,dt)
VALUES('$user','$sym','$sugg','$image','$dateTime')";
//
// $sql1="SELECT doc, email from doctor WHERE email='$email'";
// $result=mysqli_query($conn,$sql1);
// $result=mysqli_query($conn,$sql);
if (mysqli_query($conn, $sql)) {
echo "<script>alert('Data Uploaded Successfully!!')</script>";
header("Location: details.php");
}
else{
echo "Error creating database: " . mysqli_error($conn);
}
mysqli_close($conn);
}
?>
<a href="//24timezones.com/Ahmadabad/time" style="text-decoration: none" class="clock24" id="tz24-1582633593-c1423-eyJob3VydHlwZSI6MTIsInNob3dkYXRlIjoiMSIsInNob3dzZWNvbmRzIjoiMSIsInNob3d0aW1lem9uZSI6IjEiLCJ0eXBlIjoiZCIsImxhbmciOiJlbiJ9" title="time now Ahmadabad" target="_blank" rel="nofollow">india</a>
<script type="text/javascript" src="//w.24timezones.com/l.js" async></script>
<section id="wer">
<form action="add.php" method="post">
<h2 class="text-center ">Add details</h2>
<div class="form-group col-md-8">
<label for="exampleFormControlInput1" >Patient ID</label>
<input type="text" required="required" name="id" class="form-control" id="exampleFormControlInput1" placeholder="enter Patient ID">
</div>
<div class="form-group col-md-8">
<label for="exampleFormControlInput1" > Symptoms </label>
<input type="text" required="required" name="sym" class="form-control" id="exampleFormControlInput1" placeholder="enter patients symptoms">
</div>
<div class="form-group col-md-8">
<label for="exampleFormControlTextarea1"> Suggestions...</label>
<textarea class="form-control" required="required" name="sugg" id="exampleFormControlTextarea1" rows="3"></textarea>
</div>
<div class="form-group col-md-8">
<label for="exampleFormControlFile1">Please select your prescription image</label>
<input type="file" required="required" f class="form-control-file" id="exampleFormControlFile1" name="image">
</div>
<button type="submit" name="submit" class="btn btn-outline-success"> Submit </button>
</form>
</section>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<!-- Footer -->
</body>