-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrefered.php
executable file
·49 lines (38 loc) · 1.1 KB
/
refered.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
<?php
/*session_start();
$servername = "localhost";
$username = "root";
$password = "sarthak2007";
$dbname = "SOC";
$comments=$_POST['comments'];
$lic=$_POST['doc'];
$aadhar=$_SESSION['a'];*/
session_start();
$aadhar=$_SESSION['a'];
$comments=$_POST['comments'];
$conn = new mysqli('localhost','root','sarthak2007','SOC');
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$state=$_POST['state'];
$city=$_POST['city'];
$speciality=$_POST['speciality'];
$doctor=$_POST['doctor'];
//echo $doctor;
$sql="SELECT * FROM patient where AADHAR=".$aadhar;
$result=$conn->query($sql);
$row=$result->fetch_assoc();
$name=$row['Name'];
$sql="SELECT * FROM doctor where LicenseID='".$_SESSION['LicenseID']."'";
$result=$conn->query($sql);
$row=$result->fetch_assoc();
$named=$row['Name'];
$sql = "INSERT INTO ".$doctor."_referred (Aadhar,Patient_Name,Comments,Date,Doctor)
VALUES (".$aadhar.",'".$name."','".$comments."',NOW(),'".$named."')";
if ($conn->query($sql) === TRUE) {
header('Location:final.php');
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>