template list by verticals
This commit is contained in:
@@ -89,21 +89,33 @@
|
||||
<div class="" >
|
||||
<p><b>Quick Action</b></p>
|
||||
<div class="flex flex-row place-items-center " style="border: 1px solid #939393; background-color: #D9D9D9; border-radius: 6px">
|
||||
<select onchange="changeBvValue();" name="bv" id="businessVerticals" style="width: 100px; border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;">
|
||||
<option value="0">-Select-</option>
|
||||
<?php
|
||||
try {
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$stmt = $conn->prepare("SELECT bv FROM business_verticals");
|
||||
$stmt->execute();
|
||||
$verticalsRows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$selectedBV = [];
|
||||
foreach($usersCleads as $userEmail){
|
||||
$selectedBV[] = $userEmail['user'];
|
||||
}
|
||||
foreach($verticalsRows as $verticalsData){
|
||||
$isUserSelected = in_array($verticalsData['bv'], $selectedBV) ? 'selected' : '';
|
||||
echo '<option value="'.$verticalsData['bv'].'" '.$isUserSelected.'>'.$verticalsData['bv'].'</option>';
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
};
|
||||
?>
|
||||
<option value="bip">BIP</option>
|
||||
</select>
|
||||
<div class="xzmdropdown-wrapper ">
|
||||
<button class="xzmdropdown-btn"><i class="fa fa-envelope" style="font-size: 20px"></i></button>
|
||||
<div class="xzmdropdown-content">
|
||||
<a href="?send-email-id=33">Welcome mail</a>
|
||||
<a href="?send-email-id=5">Introduction mail</a>
|
||||
<div class="xzmdropdown-item">
|
||||
<a href="?send-email-id=21">DNP</a>
|
||||
<a href="?send-email-id=16">MTT</a>
|
||||
<a href="?send-email-id=22">SEN</a>
|
||||
<a href="?send-email-id=20">PPTTC</a>
|
||||
<a href="?send-email-id=19">NTTA</a>
|
||||
<a href="?send-email-id=24">CDA</a>
|
||||
<a href="?send-email-id=26">TEFL</a>
|
||||
<a href="?send-email-id=25">TESOL LEVEL 7</a>
|
||||
</div>
|
||||
<div id="templateList" class="xzmdropdown-content">
|
||||
</div>
|
||||
</div> |
|
||||
<div>
|
||||
@@ -546,6 +558,78 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function changeBvValue(){
|
||||
let verticalsDropDown = document.getElementById('businessVerticals');
|
||||
let bvValue = verticalsDropDown.value;
|
||||
console.log(bvValue);
|
||||
|
||||
let atheneumData = [
|
||||
{templateName: "Welcome mail", templateID: "33", verticals: "atheneum"},
|
||||
{templateName: "Introduction mail", templateID: "5", verticals: "atheneum"},
|
||||
{templateName: "DNP", templateID: "21", verticals: "atheneum"},
|
||||
{templateName: "MTT", templateID: "16", verticals: "atheneum"},
|
||||
{templateName: "SEN", templateID: "22", verticals: "atheneum"},
|
||||
{templateName: "PPTTC", templateID: "20", verticals: "atheneum"},
|
||||
{templateName: "NTT", templateID: "19", verticals: "atheneum"},
|
||||
{templateName: "CDA", templateID: "24", verticals: "atheneum"},
|
||||
{templateName: "TEFL", templateID: "26", verticals: "atheneum"},
|
||||
{templateName: "TESOL LEVEL 7", templateID: "25", verticals: "atheneum"},
|
||||
{templateName: "TESOL", templateID: "30", verticals: "atheneum"},
|
||||
{templateName: "ECCE", templateID: "27", verticals: "atheneum"},
|
||||
{templateName: "Education administration & management", templateID: "30", verticals: "atheneum"},
|
||||
{templateName: "10% OFF", templateID: "34", verticals: "atheneum"},
|
||||
{templateName: "15% OFF", templateID: "36", verticals: "atheneum"}
|
||||
];
|
||||
let teenybeansData = [
|
||||
{templateName: "UNO", templateID: "19", verticals: "teenybeans"},
|
||||
{templateName: "PRIMERO", templateID: "17", verticals: "teenybeans"},
|
||||
{templateName: "ILC", templateID: "27", verticals: "teenybeans"},
|
||||
{templateName: "Complete Package", templateID: "28", verticals: "teenybeans"},
|
||||
{templateName: "Bespoke- Marketing solution", templateID: "32", verticals: "teenybeans"},
|
||||
{templateName: "Bespoke- Design solution", templateID: "31", verticals: "teenybeans"},
|
||||
{templateName: "Bespoke- Academic solution", templateID: "30", verticals: "teenybeans"}
|
||||
];
|
||||
let iimttData = [
|
||||
{templateName: "B2B- Introduction", templateID: "25", verticals: "iimtt"},
|
||||
{templateName: "B2B- Followup", templateID: "18", verticals: "iimtt"},
|
||||
{templateName: "B2C- Introduction", templateID: "22", verticals: "iimtt"},
|
||||
{templateName: "B2C-Followup", templateID: "23", verticals: "iimtt"},
|
||||
];
|
||||
let bipData = [
|
||||
{templateName: "Introduction", templateID: "24", verticals: "bip"},
|
||||
{templateName: "School visit invitation", templateID: "26", verticals: "bip"}
|
||||
];
|
||||
let buzzappData = [
|
||||
{templateName: "Introduction", templateID: "20", verticals: "buzzapp"},
|
||||
{templateName: "Follow up", templateID: "29", verticals: "buzzapp"}
|
||||
];
|
||||
|
||||
let templateList = document.getElementById('templateList');
|
||||
templateList.innerHTML = ''; // Clear the previous list items
|
||||
|
||||
let selectedData;
|
||||
if (bvValue === 'atheneum') {
|
||||
selectedData = atheneumData;
|
||||
} else if (bvValue === 'teenybeans') {
|
||||
selectedData = teenybeansData;
|
||||
} else if(bvValue === 'iimtt') {
|
||||
selectedData = iimttData;
|
||||
} else if(bvValue === 'buzzapp') {
|
||||
selectedData = buzzappData;
|
||||
} else if(bvValue === 'bip') {
|
||||
selectedData = bipData;
|
||||
} else {
|
||||
selectedData = []; // No data for other selections, you can add more datasets as needed
|
||||
}
|
||||
|
||||
selectedData.forEach(data => {
|
||||
const anchorLink = document.createElement('a');
|
||||
anchorLink.text = data.templateName;
|
||||
anchorLink.href = `?send-email-id=${data.templateID}`;
|
||||
templateList.appendChild(anchorLink);
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const copyButtons = document.querySelectorAll('.copy-btn');
|
||||
|
||||
@@ -558,7 +642,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(inputElement.value)
|
||||
.then(() => {
|
||||
button.classList.add('copied');
|
||||
button.classList.add('copied');
|
||||
setTimeout(() => {
|
||||
button.classList.remove('copied');
|
||||
inputElement.blur(); // Remove focus from input element
|
||||
@@ -588,9 +672,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// function fetchCountries() {
|
||||
// fetch('https://api.siliconpin.com/v3/list/country/')
|
||||
// .then(res => res.json())
|
||||
@@ -780,7 +861,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
position: absolute;
|
||||
background-color: #EAEAEA;
|
||||
min-width: 120px;
|
||||
width: 160px;
|
||||
width: 260px;
|
||||
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
|
||||
z-index: 1;
|
||||
border: 1px solid #939393;
|
||||
|
||||
Reference in New Issue
Block a user