JezK
Edit File: header.php
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Video Consultation</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="robots" content="all,follow"> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/custom.css"> <link rel="stylesheet" href="css/font-awesome.min.css"> <link rel="stylesheet" href="css/fontastic.css"> <!-- Google fonts - Roboto --> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700"> <!-- Custom Scrollbar--> <link rel="stylesheet" href="css/jquery.mCustomScrollbar.css"> <!-- theme stylesheet--> <link rel="stylesheet" href="css/style.default.css" id="theme-stylesheet"> <link rel="stylesheet" href="build/css/intlTelInput.css" /> <link rel="stylesheet" type="text/css" href="css/daterangepicker.css" /> <link rel="stylesheet" type="text/css" href="css/dataTables.bootstrap4.min.css"> <script src="jquery/jquery.min.js"></script> <!-- Favicon--> <!-- <link rel="shortcut icon" href="img/favicon.ico"> --> <!-- Tweaks for older IEs--> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script><![endif]--> </head> <?php include('classes/class_professional_videoconsultation.php'); $videocon=new professional_videoconsultation(); $recentPractCountry = $videocon->practManCountry; $recentPractCountryID = $videocon->practManCountryID; //print_r($_SESSION['signup_type']); exit; if(!isset($_SESSION['pid'])) { echo "<script>window.location='index.php';</script>"; } $page=basename($_SERVER['PHP_SELF']); $mybusinessdet=$videocon->getBusiness('id',$_SESSION['pid']); $_SESSION['bussinessName'] = $mybusinessdet[0]['business_name']; $hbusinesspic="img/dummybusinesspic.png"; $headerlogoBP="img/avatar-7.jpg"; $bussinessName = isset($mybusinessdet[0]['business_name'])? $mybusinessdet[0]['business_name'] : '-'; if(isset($mybusinessdet['0']['business_pic']) && file_exists("../uploads/".$mybusinessdet['0']['business_pic'])) { $hbusinesspic="../uploads/".$mybusinessdet['0']['business_pic']; $headerlogoBP="../uploads/".$mybusinessdet['0']['business_pic']; } $val=(isset($mybusinessdet['0']['owner']) && $mybusinessdet['0']['owner']!='')?$mybusinessdet['0']['owner']:$mybusinessdet['0']['professional_name']; $availability = $mybusinessdet['0']['available_status']; // $notifications = $videocon->listNotificationUser($_SESSION['pid']); // print_r($notifications);exit; ?> <style> /* Container */ .toggle-container { display: flex; align-items: center; gap: 10px; font-family: Arial, sans-serif; } /* Hide the default checkbox */ .toggle-input { display: none; } /* Custom switch */ .toggle-label { position: relative; width: 50px; height: 26px; background: #ccc; border-radius: 50px; cursor: pointer; transition: background 0.3s; } /* Circle (slider) */ .toggle-label::before { content: ""; position: absolute; width: 22px; height: 22px; top: 2px; left: 2px; background: white; border-radius: 50%; transition: 0.3s; } /* When checked, change background and move the circle */ .toggle-input:checked + .toggle-label { background: #4CAF50; } .toggle-input:checked + .toggle-label::before { transform: translateX(24px); } /* Status text */ .status { font-weight: bold; } </style> <body> <!-- Side Navbar --> <nav class="side-navbar"> <div class="side-navbar-wrapper"> <div class="sidenav-header d-flex align-items-center justify-content-center"> <div class="sidenav-header-inner text-center"> <!-- <img src="img/avatar-7.jpg" alt="person" class="img-fluid rounded-circle"> --> <a href="dashboard.php"><h2 class="text-dark mb-1 pb-2"><img src="img/logo1.png" alt="logo" style=" width:180px !important; height:41px !important"></h2></a> </div> <div class="sidenav-header-logo"> <a href="index.php" class="brand-small text-center"> <img src="img/logo1.png" alt="logo" width= "100px" height="34px"> <!-- <strong>LO</strong><strong class="text-primary">GO</strong> --> </a> </div> </div> <div class="main-menu"> <ul id="side-sub-menu" class="side-menu list-unstyled border border-left-0 border-right-0"> <li> <a href="dashboard.php"><img class="img" src="<?php echo $hbusinesspic;?>" width="30" /><?php echo $val;?></a> </li> </ul> <ul id="side-main-menu" class="side-menu list-unstyled"> <li> <a href="dashboard.php" <?php if($page == "dashboard.php"){echo 'class="active"';}else{}?>> <i><?php if($page == "dashboard.php"){echo '<img src="img/dashboard_selected.png">';}else{ echo '<img src="img/dashboard.png">';}?> </i>Dashboard</a> </li> <li> <a href="appointment.php" <?php if($page == "appointment.php"){echo 'class="active"';}else{}?>> <i><?php if($page == 'appointment.php'){echo '<img src="img/appointments_selected.png">';}else{echo '<img src="img/appointments.png">';}?></i>Appointments</a> </li> <li> <a href="availability.php" <?php if($page == "availability.php" || $page =="availabilityView.php"){echo 'class="active"';}else{}?>> <i><?php if($page == 'availability.php' || $page =="availabilityView.php"){echo '<img src="img/availability_selected.png">';}else{echo '<img src="img/availability.png">';}?></i>Availability</a> </li> <?php if($_SESSION['signup_type']==1){ ?> <li> <a href="businessConfig.php" <?php if($page == "businessConfig.php" ){echo 'class="active"';}else{}?>><i><?php if($page == 'businessConfig.php'){echo '<img src="img/call-configuration_selected.png">';}else{echo '<img src="img/call-configuration.png">';}?></i>Business Config</a> </li> <?php } if(isset($_SESSION['professional_management']) || $_SESSION['signup_type']==1){ ?> <li> <a href="professionalMng.php" <?php if($page == "professionalMng.php" || $page=="addProfessional.php" ||$page=="professionalView.php" ||$page =="professionalEdit.php"){echo 'class="active"';}else{}?>><i><?php if($page == 'professionalMng.php' || $page=="addProfessional.php" ||$page=="professionalView.php" ||$page =="professionalEdit.php"){echo '<img src="img/call-configuration_selected.png">';}else{echo '<img src="img/call-configuration.png">';}?></i>Professional Mng</a> </li> <?php } ?> <li> <a href="callConfiguration.php" <?php if($page == "callConfiguration.php"){echo 'class="active"';}else{}?>><i><?php if($page == 'callConfiguration.php'){echo '<img src="img/call-configuration_selected.png">';}else{echo '<img src="img/call-configuration.png">';}?></i>Call Configuration</a> </li> <li> <a href="transaction.php" <?php if($page == "transaction.php" || $page=="paymentView.php"){echo 'class="active"';}else{}?>> <i><?php if($page == 'transaction.php' || $page=="paymentView.php"){echo '<img src="img/transactions_selected.png">';}else{echo '<img src="img/transactions.png">';}?></i>Transactions</a> </li> <li> <a href="userNotifications.php" <?php if($page == "userNotifications.php"){echo 'class="active"';}else{}?>> <i><?php if($page == 'userNotifications.php'){echo '<img src="img/documents_selected.png">';}else{echo '<img src="img/report.png">';}?></i>Notifications</a> </li> <li> <a href="myProfile.php" <?php if($page == "myProfile.php"){echo 'class="active"';}else{}?>> <i><?php if($page == 'myProfile.php'){echo '<img src="img/updateprofile_selected.png">';}else{echo '<img src="img/updateprofile.png">';}?></i>My Profile</a> </li> <li> <a href="consultationHistory.php" <?php if($page == "consultationHistory.php" || $page == "consultationHistoryView.php"){echo 'class="active"';}else{}?>> <i><?php if($page == "consultationHistory.php" || $page == "consultationHistoryView.php"){echo '<img src="img/updateprofile_selected.png">';}else{echo '<img src="img/updateprofile.png">';}?></i>Video Session About</a> </li> <li> <a href="settings.php" <?php if($page == "settings.php"){echo 'class="active"';}else{}?>> <i><?php if($page == 'settings.php'){echo '<img src="img/settings_selected.png">';}else{echo '<img src="img/settings.png">';}?></i>Settings</a> </li> <li> <a href="reportProblem.php" <?php if($page == "reportProblem.php"){echo 'class="active"';}else{}?>> <i><?php if($page == 'reportProblem.php'){echo '<img src="img/report_selected.png">';}else{echo '<img src="img/report.png">';}?></i>Report a Problem</a> </li> <li> <a href="logout.php" <?php if($page == "logout.php"){echo 'class="active"';}else{}?>> <i><?php if($page == 'logout.php'){echo '<img src="img/logout_selected.png">';}else{echo '<img src="img/logout.png">';}?></i>Logout</a> <!-- <a href="logout.php"> <i class="icon-interface-windows"></i>Logout</a> --> </li> </ul> </div> <!-- <div class="admin-menu"> <h5 class="sidenav-heading">Second menu</h5> <ul id="side-admin-menu" class="side-menu list-unstyled"> <li> <a href="#"> <i class="icon-screen"> </i>Demo</a> </li> <li> <a href="#"> <i class="icon-flask"> </i>Demo <div class="badge badge-info">Special</div> </a> </li> <li> <a href=""> <i class="icon-flask"> </i>Demo</a> </li> <li> <a href=""> <i class="icon-picture"> </i>Demo</a> </li> </ul> </div> --> </div> </nav> <div class="page"> <!-- navbar--> <header class="header"> <nav class="navbar"> <div class="container-fluid"> <div class="navbar-holder d-flex align-items-center justify-content-between"> <div class="navbar-header"><a id="toggle-btn" href="#" class="menu-btn"><i class="icon-bars"> </i></a> <a href="index.php" class="navbar-brand"> <div class="brand-text d-none d-md-inline-block text-dark"><span>Dashboard </span> <strong class="text-primary"></strong></div> </a> <!-- Business Title in Center --> </div> <div class="text-center flex-grow-1"> <h4 class="m-0 font-weight-bold text-dark">Bussiness: <?php echo $bussinessName; ?></h4> </div> <ul class="nav-menu list-unstyled d-flex flex-md-row align-items-md-center"> <?php if($mybusinessdet['0']['addedby_id'] != 0) { ?> <li class="nav-item dropdown"> <div class="toggle-container"> <span class="status"><?php echo $availability ? "Available" : "Unavailable"; ?></span> <input type="checkbox" id="availability-toggle" class="toggle-input" <?php echo $availability ? "checked" : ""; ?>> <label for="availability-toggle" class="toggle-label"></label> </div> </li> <?php } ?> <!-- Notifications dropdown--> <li class="nav-item dropdown"> <a id="notifications" rel="nofollow" data-target="#" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link"><i class="fa fa-bell show"></i><span class="badge badge-warning" id="n-count"></span></a> <ul aria-labelledby="notifications" class="dropdown-menu notification-h" id="unread"> </ul> </li> <!-- Messages dropdown--> <!-- <li class="nav-item dropdown"> <a id="messages" rel="nofollow" data-target="#" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link"><i class="fa fa-envelope"></i><span class="badge badge-info">10</span></a> <ul aria-labelledby="notifications" class="dropdown-menu"> <li> <a rel="nofollow" href="#" class="dropdown-item d-flex"> <div class="msg-profile"> <img src="img/avatar-1.jpg" alt="..." class="img-fluid rounded-circle"></div> <div class="msg-body"> <h3 class="h5">Jason Doe</h3><span>sent you a direct message</span><small>3 days ago at 7:58 pm - 10.06.2014</small> </div> </a> </li> <li> <a rel="nofollow" href="#" class="dropdown-item d-flex"> <div class="msg-profile"> <img src="img/avatar-2.jpg" alt="..." class="img-fluid rounded-circle"></div> <div class="msg-body"> <h3 class="h5">Frank Williams</h3><span>sent you a direct message</span><small>3 days ago at 7:58 pm - 10.06.2014</small> </div> </a> </li> <li> <a rel="nofollow" href="#" class="dropdown-item d-flex"> <div class="msg-profile"> <img src="img/avatar-3.jpg" alt="..." class="img-fluid rounded-circle"></div> <div class="msg-body"> <h3 class="h5">Ashley Wood</h3><span>sent you a direct message</span><small>3 days ago at 7:58 pm - 10.06.2014</small> </div> </a> </li> <li> <a rel="nofollow" href="#" class="dropdown-item all-notifications text-center"> <strong> <i class="fa fa-envelope"></i>Read all messages </strong></a> </li> </ul> </li>--> <!-- Languages dropdown --> <li class="nav-item dropdown"> <a id="languages" rel="nofollow" data-target="#" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link language dropdown-toggle"> <img src="<?php echo $headerlogoBP;?>" alt="person" width="30px" height="30px" class="img-fluid rounded-circle"> <!-- <span class="text-dark d-none d-sm-inline-block">English</span> --> </a> <ul aria-labelledby="languages" class="dropdown-menu"> <li> <a rel="nofollow" href="myProfile.php" class="dropdown-item"> <!-- <img src="img/flags/16/DE.png" alt="English" class="mr-2"> --> <span>Profile</span> </a> </li> <li> <a rel="nofollow" href="settings.php" class="dropdown-item"> <!-- <img src="img/flags/16/FR.png" alt="English" class="mr-2"> --> <span>Settings</span> </a> </li> <li> <a rel="nofollow" href="logout.php" class="dropdown-item"> <!-- <img src="img/flags/16/FR.png" alt="English" class="mr-2"> --> <span>Logout</span> </a> </li> </ul> </li> <!-- Log out--> <!-- <li class="nav-item"> <a href="login.php" class="nav-link logout"> <span class="d-none d-sm-inline-block">Logout</span><i class="fa fa-sign-out"></i></a> </li> --> </ul> </div> </div> </nav> </header> <script> function unreadNotification(){ $.post( "ajax.php", { action:"unreadnotifications", }, function(data) { if(!data) { $data=''; } else if (data !='') { var chartdata=data.split('#####') var x = chartdata[0]; var y = chartdata[1]; // alert(y) $("#unread").html(''); $("#unread").append(y); $("#n-count").html(''); $("#n-count").append(x); } } ); } setInterval(function(){ unreadNotification(); }, 5000); const toggleInput = document.getElementById("availability-toggle"); const statusText = document.querySelector(".status"); toggleInput.addEventListener("change", function () { statusText.textContent = this.checked ? "Available" : "Unavailable"; $.ajax({ url: "ajax.php", type: "POST", data: { action: "updateAvailability", availability: this.checked ? 1: 0, pid: "<?php echo $_SESSION['pid']; ?>" }, success: function (data) { // Handle the response from the server } }); }); </script>