Viewing file: appointments.php (7.57 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include ('conn.php');
require_once "auth.php";
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title><?php include('title.php') ?></title>
<!-- Fav Icon Link -->
<link rel="shortcut icon" type="image/png" href="images/fav.png">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- themify icons CSS -->
<link rel="stylesheet" href="css/themify-icons.css">
<!-- Animations CSS -->
<link rel="stylesheet" href="css/animate.css">
<!-- Main CSS -->
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/red.css" id="style_theme">
<link rel="stylesheet" href="css/responsive.css">
<!-- morris charts -->
<link rel="stylesheet" href="charts/css/morris.css">
<!-- jvectormap -->
<link rel="stylesheet" href="css/jquery-jvectormap.css">
<link rel="stylesheet" href="datatable/dataTables.bootstrap4.min.css">
<style>
table {
border-collapse: collapse;
width: 100%;
}
th,
td {
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
th {
background-color: #4CAF50;
color: white;
}
table {
border-collapse: collapse;
width: 100%;
}
th,
td {
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
th {
background-color: #4CAF50;
color: white;
}
.message-container {
display: none;
}
.message-container {
display: none;
}
.message-container.active {
display: block;
}
</style>
<script src="js/modernizr.min.js"></script>
</head>
<body>
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<div class="wrapper">
<?php include('sidebar.php') ?>
<div id="content">
<?php include('topbar.php') ?>
<div class="row no-margin-padding" style="width: auto;">
<div class="col-md-6">
<h3 class="block-title">Appointments</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="index.php">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">Appointments</li>
<li class="breadcrumb-item active">Appointments List</li>
</ol>
</div>
</div>
<div class="container-fluid" style="width: auto; ">
<?php
include 'conn.php';
if (isset($_POST['delete_appo'])) {
$appo_id = $_POST['id'];
$query = "DELETE FROM appointments WHERE id='$appo_id'";
mysqli_query($con, $query);
}
$app = mysqli_query($con, "SELECT * FROM appointments");
?>
<div class="content-wrapper">
<table class="table table-bordered table-striped">
<tr style="font-size: 14px;" >
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Department</th>
<th>Doctor-Name</th>
<th>Date</th>
<th>Time</th>
<th>Message</th>
<th>Action</th>
</tr>
<?php
while ($appo = mysqli_fetch_array($app)) {
?>
<tr>
<td><?php echo $appo['name']; ?></td>
<td><?php echo $appo['email']; ?></td>
<td><?php echo $appo['phone']; ?></td>
<td><?php echo $appo['department']; ?></td>
<td><?php echo $appo['doctor_name']; ?></td>
<td><?php echo $appo['date']; ?></td>
<td><?php echo $appo['time']; ?></td>
<td>
<?php
$appoMessage = $appo['appo_message'];
$words = explode(" ", $appoMessage);
$first10Words = implode(" ", array_slice($words, 0, 5));
?>
<div class="text-container">
<p class="initial-text">
<?php echo $first10Words; ?>
</p>
<p class="additional-text" style="display: none;">
<?php echo $appo['appo_message']; ?>
</p>
<button class="read-more-button btn btn-success ">Show More</button>
<button class="read-less-button btn btn-warning " style="display: none;">Show Less</button>
</div>
</td>
<td>
<form method="POST" action="">
<input type="hidden" name="id" value="<?php echo $appo['id']; ?>">
<button class="btn btn-outline-danger" type="submit" name="delete_appo">Delete Appointment</button>
</form>
<a href="" style="width:186px;" class="btn btn-outline-success approve-btn">Action</a>
<div class="message-container">
<form action="approve.php" method="GET">
<textarea class="message-textarea" name="message" placeholder="Add a message"></textarea>
<input type="hidden" name="id" value="<?php echo htmlspecialchars_decode($appo['email']); ?>">
<button class="btn btn-outline-success" type="submit">Approve</button>
</form>
<form action="reject.php" method="GET">
<textarea class="message-textarea" name="message" placeholder="Add a message"></textarea>
<input type="hidden" name="id" value="<?php echo htmlspecialchars_decode($appo['email']); ?>">
<button class="btn btn-outline-warning" style="width:90px;" type="submit">Reject</button>
</form>
</div>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
</div>
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
$("#expandButton_<?php echo $doctorID; ?>").click(function() {
$("#expandedSection_<?php echo $doctorID; ?>").toggle();
});
});
</script>
<script>
$(document).ready(function() {
$(".approve-btn").click(function(event) {
event.preventDefault();
var messageContainer = $(this).next(".message-container");
messageContainer.addClass("active");
});
$(".send-message-btn").click(function() {
var messageTextarea = $(this).prev(".message-textarea");
var message = messageTextarea.val();
messageTextarea.val("");
$(this).closest(".message-container").removeClass("active");
});
});
$(document).ready(function() {
$(".read-more-button").click(function() {
var container = $(this).closest(".text-container");
var initialText = container.find(".initial-text");
var additionalText = container.find(".additional-text");
var readMoreButton = container.find(".read-more-button");
var readLessButton = container.find(".read-less-button");
additionalText.show();
readLessButton.show();
initialText.hide();
readMoreButton.hide();
});
$(".read-less-button").click(function() {
var container = $(this).closest(".text-container");
var initialText = container.find(".initial-text");
var additionalText = container.find(".additional-text");
var readMoreButton = container.find(".read-more-button");
var readLessButton = container.find(".read-less-button");
initialText.show();
readMoreButton.show();
additionalText.hide();
readLessButton.hide();
});
});
</script>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="datatable/jquery.dataTables.min.js"></script>
<script src="datatable/dataTables.bootstrap4.min.js"></script>
<script src="js/custom.js"></script>
<script src="js/custom-datatables.js"></script>
</body>
</html>
|