-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnewfunc.php
More file actions
52 lines (43 loc) · 1.13 KB
/
newfunc.php
File metadata and controls
52 lines (43 loc) · 1.13 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
<?php
$con=mysqli_connect("localhost","root","","systemdb");
if(isset($_POST['update_data']))
{
$contact=$_POST['contact'];
$status=$_POST['status'];
$query="update appointmenttb set payment='$status' where contact='$contact';";
$result=mysqli_query($con,$query);
if($result)
header("Location:updated.php");
}
function display_specs() {
global $con;
$query="select distinct(spec) from doctb";
$result=mysqli_query($con,$query);
while($row=mysqli_fetch_array($result))
{
$spec=$row['spec'];
echo '<option data-value="'.$spec.'">'.$spec.'</option>';
}
}
function display_docs()
{
global $con;
$query = "select * from doctb";
$result = mysqli_query($con,$query);
while( $row = mysqli_fetch_array($result) )
{
$username = $row['username'];
$price = $row['docFees'];
$spec = $row['spec'];
echo '<option value="' .$username. '" data-value="'.$price.'" data-spec="'.$spec.'">'.$username.'</option>';
}
}
if(isset($_POST['doc_sub']))
{
$username=$_POST['username'];
$query="insert into doctb(username)values('$username')";
$result=mysqli_query($con,$query);
if($result)
header("Location:adddoc.php");
}
?>