init
This commit is contained in:
301
.htac_nav.php
Normal file
301
.htac_nav.php
Normal file
@@ -0,0 +1,301 @@
|
||||
<?php
|
||||
require_once('/var/www/html/.hta_config/crm_config.php');
|
||||
if($_SESSION['user_type']=='admin'){
|
||||
$all_leads_url = '/admin/cleads';
|
||||
} else
|
||||
$all_leads_url = '/cleads';{}
|
||||
?>
|
||||
<section class="bg-[#443780] py-1.5 px-4" style="position: fixed; width: 100%; z-index: 10;">
|
||||
<div class="container mx-auto flex flex-row place-content-between text-[#fff] ">
|
||||
<div>
|
||||
<p>CRM</p>
|
||||
</div>
|
||||
<div class="flex flex-row space-x-4 place-items-center">
|
||||
<div class="flex flex-row space-x-4">
|
||||
<a href="/notifications" class=""><i class="fa fa-bell">
|
||||
<!-- <span class="" style="background-color: #FF0000; padding-left: 4px; padding-right: 4px; border-radius: 50%; ">1</span> -->
|
||||
</i></a>
|
||||
|
||||
<a href="/logout" class="bg-[#E4C1F9] text-[#443780] px-4 rounded-full"><i class="fa fa-sign-out">Logout</i></a>
|
||||
</div>
|
||||
<?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();
|
||||
$usersNames = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$num_rows = $stmt->rowCount();
|
||||
foreach($usersNames as $user_name){
|
||||
$nameParts = explode(" ", $user_name['name']);
|
||||
$firstInitial = substr($nameParts[0], 0, 1);
|
||||
$lastInitial = substr($nameParts[count($nameParts) - 1], 0, 1);
|
||||
echo ' <div style="display: flex; flex-direction: row; place-items: center">
|
||||
<p>Hi <span>'.$nameParts[0].'</span></p>
|
||||
<p class="p-2" style="background: linear-gradient(180deg, #E4C1F9 0%, rgba(129, 126, 242, 0.91) 100%); border-radius: 50%; font-size: 20px; color: #fff; font-weight: bold;">'.$firstInitial.$lastInitial.'</p>
|
||||
</div>';
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div style="display: flex; flex-direction: row;">
|
||||
<div style="position: fixed; height: 100%;">
|
||||
<nav class="main-menu">
|
||||
<ul style="padding-top: 100px;">
|
||||
<li>
|
||||
<a href="<?php echo $all_leads_url; ?>">
|
||||
<i class="fa fa-2x"><img src="/assets/all-lead.png" alt="" /></i>
|
||||
<span class="nav-text" style="text-transform: capitalize;">All Leads</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<?php
|
||||
if($_SESSION['user_type']=='user'){
|
||||
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);
|
||||
?>
|
||||
<li>
|
||||
<a href="/cleads/by-business-verticals/?bv=<?php echo $access_data; ?>">
|
||||
<i class="fa fa-2x"><img src="/assets/bv.png" alt="" /></i>
|
||||
<!-- <i class="fa fa-square fa-2x"></i> -->
|
||||
<span class="nav-text" style="text-transform: capitalize;">
|
||||
<?php echo $access_data_not_undescore; ?>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
}else{
|
||||
try {
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$stmt = $conn->prepare("SELECT * FROM business_verticals");
|
||||
$stmt->execute();
|
||||
$bv_rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$num_rows = $stmt->rowCount();
|
||||
foreach($bv_rows as $bv_row){ $access_data_not_undescore = str_replace("_", " ",$bv_row['bv']);?>
|
||||
<li>
|
||||
<a href="/cleads/by-business-verticals/?bv=<?php echo $bv_row['bv']; ?>">
|
||||
<i class="fa fa-2x"><img src="/assets/bv.png" alt="" /></i>
|
||||
<!-- <i class="fa fa-square fa-2x"></i> -->
|
||||
<span class="nav-text" style="text-transform: capitalize;">
|
||||
<?php echo $access_data_not_undescore; ?>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<a href="/cleads/my-leads">
|
||||
<i class="fa fa-2x"><img src="/assets/my-lead.png" alt="" /></i>
|
||||
<!-- <i class="fa fa-square fa-2x"></i> -->
|
||||
<span class="nav-text">
|
||||
My Leads
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/add-csv">
|
||||
<i class="fa fa-2x"><img src="/assets/csv.png" alt="" /></i>
|
||||
<!-- <i class="fa fa-file fa-2x"></i> -->
|
||||
<span class="nav-text">
|
||||
Upload CSV
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
if($_SESSION['user_type']=='admin'){?>
|
||||
<li>
|
||||
<a href="/admin/users">
|
||||
<i class="fa fa-user fa-2x"></i>
|
||||
<span class="nav-text">
|
||||
Users
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/admin/business-verticals">
|
||||
<i class="fa fa-2x"><img src="/assets/all-lead.png" alt="" /></i>
|
||||
<span class="nav-text">
|
||||
Business Verticals
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php }
|
||||
?>
|
||||
</ul>
|
||||
<ul class="logout">
|
||||
<li>
|
||||
<a href="/logout">
|
||||
<i class="fa fa-power-off fa-2x"></i>
|
||||
<span class="nav-text">
|
||||
Logout
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="right pl-12 pt-6" style="width: 100%; display: flex; flex-direction: column; margin: 30px; background-color: #FFF; border-radius: 10px; box-shadow: 0px 0px 20px 0px #E6E5F4;">
|
||||
<style>
|
||||
@import url(//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css);
|
||||
/* @import url(https://fonts.googleapis.com/css?family=Titillium+Web:300); */
|
||||
.fa-2x {
|
||||
font-size: 2em;
|
||||
}
|
||||
.fa {
|
||||
position: relative;
|
||||
display: table-cell;
|
||||
width: 60px;
|
||||
height: 36px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
font-size:20px;
|
||||
}
|
||||
|
||||
li>a>i>img{
|
||||
padding-left: 10px;
|
||||
}
|
||||
.main-menu:hover,nav.main-menu.expanded {
|
||||
width:250px;
|
||||
overflow:visible;
|
||||
}
|
||||
|
||||
.main-menu {
|
||||
/* background:#212121; */
|
||||
background: #E6E5F4;
|
||||
border-right:1px solid #e5e5e5;
|
||||
position:relative;
|
||||
top:0;
|
||||
bottom:0;
|
||||
height:100%;
|
||||
left:0;
|
||||
width:60px;
|
||||
overflow:hidden;
|
||||
-webkit-transition:width .05s linear;
|
||||
transition:width .05s linear;
|
||||
-webkit-transform:translateZ(0) scale(1,1);
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.main-menu>ul {
|
||||
/* margin:7px 0; */
|
||||
}
|
||||
|
||||
.main-menu li {
|
||||
position:relative;
|
||||
display:block;
|
||||
width:250px;
|
||||
}
|
||||
|
||||
.main-menu li>a {
|
||||
position:relative;
|
||||
display:table;
|
||||
border-collapse:collapse;
|
||||
border-spacing:0;
|
||||
color:#363650;
|
||||
font-family: arial;
|
||||
font-size: 14px;
|
||||
text-decoration:none;
|
||||
-webkit-transform:translateZ(0) scale(1,1);
|
||||
-webkit-transition:all .1s linear;
|
||||
transition:all .1s linear;
|
||||
|
||||
}
|
||||
|
||||
.main-menu .nav-icon {
|
||||
position:relative;
|
||||
display:table-cell;
|
||||
width:60px;
|
||||
height:36px;
|
||||
text-align:center;
|
||||
vertical-align:middle;
|
||||
font-size:18px;
|
||||
}
|
||||
|
||||
.main-menu .nav-text {
|
||||
position:relative;
|
||||
display:table-cell;
|
||||
vertical-align:middle;
|
||||
width:190px;
|
||||
font-family: 'Titillium Web', sans-serif;
|
||||
}
|
||||
|
||||
.main-menu>ul.logout {
|
||||
position:absolute;
|
||||
left:0;
|
||||
bottom:0;
|
||||
}
|
||||
|
||||
.no-touch .scrollable.hover {
|
||||
overflow-y:hidden;
|
||||
}
|
||||
|
||||
.no-touch .scrollable.hover:hover {
|
||||
overflow-y:auto;
|
||||
overflow:visible;
|
||||
}
|
||||
|
||||
a:hover,a:focus {
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
nav {
|
||||
-webkit-user-select:none;
|
||||
-moz-user-select:none;
|
||||
-ms-user-select:none;
|
||||
-o-user-select:none;
|
||||
user-select:none;
|
||||
}
|
||||
|
||||
nav ul,nav li {
|
||||
outline:0;
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
.main-menu li:hover>a,nav.main-menu li.active>a,.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus,.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus,.no-touch .dashboard-page nav.dashboard-menu ul li:hover a,.dashboard-page nav.dashboard-menu ul li.active a {
|
||||
color:#fff;
|
||||
background: linear-gradient(90deg, rgba(70, 68, 142, 0.91) 0%, rgba(120, 117, 244, 0.91) 100%);
|
||||
border-radius: 20px;
|
||||
/* background-color:#000000; */
|
||||
}
|
||||
/* .area {
|
||||
float: left;
|
||||
background: #E6E5F4;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
} */
|
||||
@font-face {
|
||||
font-family: 'Titillium Web';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Titillium WebLight'), local('TitilliumWeb-Light'), url(http://themes.googleusercontent.com/static/fonts/titilliumweb/v2/anMUvcNT0H1YN4FII8wpr24bNCNEoFTpS2BTjF6FB5E.woff) format('woff');
|
||||
}
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user