Files
crm_php/.htac_nav copy 2.php
2024-05-01 18:13:22 +05:30

157 lines
4.1 KiB
PHP

<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<div class="topnav" id="myTopnav">
<a href="/logout">Logout</a>
<div class="dropdown">
<button class="dropbtn">Leads by type<i class="fa fa-caret-down"></i></button>
<div class="dropdown-content">
<?php
require_once('.hta_config/crm_config.php');
try {
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $conn->prepare("SELECT * FROM users WHERE email=:email");
$stmt->bindParam(':email', $_SESSION['email']);
$stmt->execute();
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
$num_rows = $stmt->rowCount();
foreach($rows as $row){
$user_access_data = explode(",", $row['access']);
foreach($user_access_data as $access_data){
$access_data_not_undescore = str_replace("_", " ", $access_data);
echo '<a href="/cleads/by-business-verticals/?bv='.$access_data.'" style="text-transform: capitalize;">'.$access_data_not_undescore.'</a>';
}
}
} catch (PDOException $e) {
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
}
?>
</div>
</div>
<?php if($_SESSION['user_type'] == "admin"){echo '<a href="/forms">Forms</a><a href="/bv">Business Verticals</a><a href="/users">Users</a>';} ?>
<?php
// if($_SESSION['user_type'] == "admin"){echo '<a href="/cleads/?type=admin">All Leads</a>';}else{echo '<a href="/cleads/?type=user">All Leads</a>';}
?>
<a href="/cleads">All Leads</a>
<a href="/" class="">Home</a>
<a href="/notifications" class="">Notifications</a>
<a href="javascript:void(0);" style="font-size:15px;" class="icon" onclick="myFunction()">&#9776;</a>
</div>
<!-- <div style="padding-bottom: 64px;"></div> -->
<script>
function myFunction() {
var x = document.getElementById("myTopnav");
if (x.className === "topnav") {
x.className += " responsive";
} else {
x.className = "topnav";
}
}
</script>
<style>
/* body {margin:0;font-family:Arial} */
.topnav {
overflow: hidden;
background-color: #333;
}
.topnav a {
float: right;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
.active {
background-color: #04AA6D;
color: white;
}
.topnav .icon {
display: none;
}
.dropdown {
float: right;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 17px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 138px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 6px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.topnav a:hover, .dropdown:hover .dropbtn {
background-color: #555;
color: white;
}
.dropdown-content a:hover {
background-color: #ddd;
color: black;
}
.dropdown:hover .dropdown-content {
display: block;
}
@media screen and (max-width: 600px) {
.topnav a:not(:first-child), .dropdown .dropbtn {
display: none;
}
.topnav a.icon {
float: right;
display: block;
}
}
@media screen and (max-width: 600px) {
.topnav.responsive {position: relative;}
.topnav.responsive .icon {
position: absolute;
right: 0;
top: 0;
}
.topnav.responsive a {
float: none;
display: block;
text-align: left;
}
.topnav.responsive .dropdown {float: none;}
.topnav.responsive .dropdown-content {position: relative;}
.topnav.responsive .dropdown .dropbtn {
display: block;
width: 100%;
text-align: left;
}
}
</style>