Skip to content

Commit c96e963

Browse files
doctor
1 parent 9877436 commit c96e963

9 files changed

+197
-0
lines changed

DocAppointment.html

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<html>
2+
<head>
3+
4+
</head>
5+
6+
<body>
7+
8+
<?php
9+
$servername = "localhost";
10+
$username = "username";
11+
$password = "password";
12+
$dbname = "myDB";
13+
14+
// Create connection
15+
$conn = mysqli_connect($servername, $username, $password, $dbname);
16+
// Check connection
17+
if (!$conn) {
18+
die("Connection failed: " . mysqli_connect_error());
19+
}
20+
21+
$sql = "SELECT * FROM 'calendar'";
22+
$result = mysqli_query($conn, $sql);
23+
24+
if (mysqli_num_rows($result) > 0) {
25+
// output data of each row
26+
while($row = mysqli_fetch_assoc($result)) {
27+
if($row["id_doc"] == //foreign key toy giatrou){
28+
echo ": " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>";
29+
}
30+
}
31+
} else {
32+
echo "0 results";
33+
}
34+
35+
mysqli_close($conn);
36+
?>
37+
38+
</body>
39+
</html>

DocList.html

Whitespace-only changes.

DocLogin.html

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<html>
2+
<head>
3+
</head>
4+
5+
6+
<body>
7+
<form action="LoginCheck.php" method="post">
8+
9+
<label for="uname"><b>Username</b></label>
10+
<input type="text" placeholder="Enter Username" name="uname" required>
11+
12+
<label for="psw"><b>Password</b></label>
13+
<input type="password" placeholder="Enter Password" name="psw" required>
14+
15+
<button type="submit" >Login</button>
16+
17+
</form>
18+
</body>
19+
</html>

DocProf.html

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<html>
2+
<head>
3+
<meta charset="UTF-8">
4+
5+
6+
<?php
7+
$link = mysqli_connect("localhost", "root", "", "doc");
8+
9+
function DelProf() {
10+
$del = "DELETE FROM 'docs'";
11+
$sql = mysqli_query($link,$del);
12+
13+
}
14+
?>
15+
</head>
16+
17+
<body align="center">
18+
<label for="fname"><b>First Name</b></label>
19+
<p name="fname">Marianna <button onclick="location.href='DocProfUpd.html'">✏️</button><button>🗑️</button> </p> <br>
20+
21+
<label for="lname"><b>Last Name</b></label>
22+
<p name="lname">Ioannidou <button onclick="location.href='DocProfUpd.html'">✏️</button><button>🗑️</button> </p> <br>
23+
24+
<label for="exp"><b>Expertize</b></label>
25+
<p name="exp">Mpourdas <button onclick="location.href='DocProfUpd.html'">✏️</button><button>🗑️</button> </p> <br>
26+
27+
<label for="loc"><b>Location</b></label>
28+
<p name="loc">Skg <button onclick="location.href='DocProfUpd.html'">✏️</button><button>🗑️</button> </p> <br>
29+
30+
<label for="tel"><b>Telephone</b></label>
31+
<p name="tel">2310415968 <button onclick="location.href='DocProfUpd.html'">✏️</button><button onclick="DelProf()">🗑️</button> </p> <br>
32+
</body>
33+
</html>

DocProfDel.php

Whitespace-only changes.

DocProfUpd.html

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<html>
2+
3+
<head>
4+
5+
</head>
6+
7+
<body>
8+
<form action="DocProfUpd.php" method="post">
9+
10+
<label for="fname"><b>First Name</b></label>
11+
<input type="text" name="fname"> </input> <br>
12+
13+
<label for="lname"><b>Last Name</b></label>
14+
<input type="text" name="lname"> </input> <br>
15+
16+
<label for="exp"><b>Expertize</b></label>
17+
<input type="text" name="exp"> </input> <br>
18+
19+
<label for="loc"><b>Location</b></label>
20+
<input type="text" name="loc"> </input> <br>
21+
22+
<label for="tel"><b>Telephone</b></label>
23+
<input type="text" pattern="[0-9]{10}" name="tel"> </input> <br>
24+
25+
<>
26+
27+
<button type="submit"> Save Changes </button>
28+
29+
</form>
30+
</body>

DocProfUpd.php

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
session_start();
4+
5+
$link = mysqli_connect("localhost", "root", "", "doc");
6+
7+
$fname = $_POST['fname'];
8+
if(isset($_POST['fname']) && $_POST['fname'] != ""){
9+
$sql = mysqli_query($link,"UPDATE `docs` SET `fname` = '".$fname."'");
10+
}
11+
12+
$lname = $_POST['lname'];
13+
if(isset($_POST['lname']) && $_POST['lname'] != ""){
14+
$sql = mysqli_query($link,"UPDATE `docs` SET `lname` = '".$lname."'");
15+
}
16+
17+
$loc = $_POST['loc'];
18+
if(isset($_POST['loc']) && $_POST['loc'] != ""){
19+
$sql = mysqli_query($link,"UPDATE `docs` SET `loc` = '".$loc."'");
20+
}
21+
22+
$exp = $_POST['exp'];
23+
if(isset($_POST['exp']) && $_POST['exp'] != ""){
24+
$sql = mysqli_query($link,"UPDATE `docs` SET `exp` = '".$exp."'");
25+
}
26+
27+
$tel = $_POST['tel'];
28+
if(isset($_POST['tel']) && $_POST['tel'] != ""){
29+
$sql = mysqli_query($link,"UPDATE `docs` SET `tel` = '".$tel."'");
30+
}
31+
32+
33+
34+
header("Location: DocProf.html");
35+
36+
?>

LoginCheck.php

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
session_start();
4+
5+
$link = mysqli_connect("localhost", "root", "", "doc");
6+
7+
$uname = $_POST['uname'];
8+
$psw = $_POST['psw'];
9+
10+
if($uname && $psw){
11+
$check = mysqli_query($link,"SELECT * FROM credentinals WHERE username='".$uname."'");
12+
$rows = mysqli_num_rows($check);
13+
if(mysqli_num_rows($check) != 0){ //αν βρέθηκε εγγραφή
14+
while ($row = mysqli_fetch_assoc($check)){
15+
$db_username = $row['username'];
16+
$db_password = $row['password'];
17+
if ($db_password == $psw) {
18+
header("Location: DocProf.html");
19+
}
20+
else {
21+
header("Location: DocLogin.html");
22+
}
23+
}
24+
}
25+
}
26+
?>

connect.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
$servername = "localhost";
3+
$username = "root";
4+
$password = "";
5+
$databasename="doc";
6+
7+
// Create connection
8+
$conn = mysqli_connect($servername, $username, $password,$databasename);
9+
10+
// Check connection
11+
if (!$conn) {
12+
die("Connection failed: " . mysqli_connect_error());
13+
}
14+
?>

0 commit comments

Comments
 (0)