356 lines
16 KiB
PHP
356 lines
16 KiB
PHP
<?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 COUNT(*) AS count FROM appointment WHERE email = :email AND view_status = 0");
|
|
$stmt->bindParam(':email', $_SESSION['email']);
|
|
$stmt->execute();
|
|
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
$total_notice = $result['count'];
|
|
} catch (PDOException $e) {
|
|
echo "Error: " . $e->getMessage();
|
|
}
|
|
try {
|
|
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
|
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
$stmt = $conn->prepare("SELECT COUNT(*) AS count FROM cleads WHERE user = :user AND date IS NOT NULL AND date >= CURRENT_DATE");
|
|
$stmt->bindParam(':user', $_SESSION['email']);
|
|
$stmt->execute();
|
|
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
$follow_date_count = $result['count'];
|
|
} catch (PDOException $e) {
|
|
echo "Error: " . $e->getMessage();
|
|
}
|
|
?>
|
|
<section class="bg-[#443780] py-1.5 px-4" style="position: fixed; width: 100%; z-index: 999;">
|
|
<div class="container mx-auto flex flex-row place-content-between text-[#fff] ">
|
|
<div class="flex flex-row place-items-center">
|
|
<img class=w-[70px] src="/assets/beanstalk-white-logo.webp" alt="beanstalkedu logo">
|
|
<p class="font-bold">CRM</p>
|
|
</div>
|
|
<div class="flex flex-row space-x-4 place-items-center">
|
|
<a href="/notifications" class="inline-flex">
|
|
<svg height="23px" width="23px" version="1.1" id="_x32_" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512 512" xml:space="preserve" fill="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <style type="text/css"> .st0{fill:#ffffff;} </style> <g> <path class="st0" d="M448.282,367.411H63.712c-19.812,0-35.928,16.114-35.928,35.924c0,19.814,16.116,35.932,35.928,35.932h384.57 c19.814,0,35.934-16.118,35.934-35.932C484.216,383.526,468.096,367.411,448.282,367.411z"></path> <path class="st0" d="M425.958,340.707c-8.653-14.375-13.226-30.765-13.226-47.396v-78.824c0-78.145-57.706-144.27-134.748-155.09 c5.693-6.534,8.793-14.759,8.793-23.474c0-19.81-16.12-35.924-35.934-35.924c-19.808,0-35.924,16.114-35.924,35.924 c0,9.324,3.729,18.272,10.326,24.996C152.058,75.478,99.269,139.562,99.269,214.488v78.824c0,16.627-4.573,33.016-13.224,47.396 l-1.45,2.41h342.813L425.958,340.707z"></path> <path class="st0" d="M201.956,470.773C206.051,494.663,226.61,512,250.84,512c24.235,0,44.8-17.337,48.896-41.227l0.32-1.86h-98.42 L201.956,470.773z"></path> </g> </g></svg>
|
|
<?php if($total_notice > 0){ ?>
|
|
<div class="bg-[#FF0000] rounded-full h-[18px] w-[18px] flex justify-center place-items-center -mt-[8px] -ml-[10px]">
|
|
<p class="text-center"><?php echo $total_notice; ?></p>
|
|
</div>
|
|
<?php } ?>
|
|
</a>
|
|
|
|
|
|
<div class="flex flex-row space-x-4">
|
|
<a href="/notifications" class="flex flex-row">
|
|
<?php
|
|
// if($total_notice > 0){
|
|
// echo ' <div class="bg-[#FF0000] rounded-full h-[18px] w-[18px] flex justify-center place-items-center -mt-[8px] -ml-[10px]">
|
|
// <p class="text-center">'.$total_notice.'</p>
|
|
// </div>';
|
|
// }
|
|
?>
|
|
</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>'.ucfirst($nameParts[0]).'</span></p>
|
|
<a href="/profile" class="p-2 uppercase" 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.'</a>
|
|
</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%; z-index: 997;">
|
|
<nav class="main-menu">
|
|
<ul style="padding-top: 100px;">
|
|
<li>
|
|
<a href="/leads">
|
|
<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="/leads?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="/leads?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>
|
|
<?php if(isset($_SESSION['user_type']) && $_SESSION['user_type'] == 'user'){ ?>
|
|
<a href="/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>
|
|
<?php } ?>
|
|
</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>
|
|
<li>
|
|
<a href="/admin/add-forms">
|
|
<i class="fa fa-2x"><img src="/assets/all-lead.png" alt="" /></i>
|
|
<span class="nav-text">
|
|
Add Forms
|
|
</span>
|
|
</a>
|
|
</li>
|
|
<?php }
|
|
?>
|
|
</ul>
|
|
<ul class="logout">
|
|
<li>
|
|
<a href="/profile">
|
|
<i class="fa fa-user fa-2x"></i>
|
|
<span class="nav-text">
|
|
Profile
|
|
</span>
|
|
</a>
|
|
</li>
|
|
<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('https://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>
|