Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67fc13a6ea | ||
|
|
1c9cf33900 | ||
|
|
b2e498fb57 | ||
|
|
37512c757f | ||
|
|
b9ab2af22b | ||
|
|
3ec1731dbd | ||
|
|
2eca9ab2c6 | ||
|
|
2056e1e4af | ||
|
|
0b92a5797e | ||
|
|
e643b06cc1 | ||
|
|
711a02e9b9 | ||
|
|
ebd724f221 | ||
|
|
08c4fef0b8 | ||
|
|
e8ab051112 | ||
|
|
ea7ca44d88 | ||
|
|
b8e3ac1023 | ||
|
|
e69e5201d0 | ||
|
|
ca5828dcbc | ||
|
|
d195bc0607 | ||
|
|
4be0d0963e | ||
|
|
87311669a1 | ||
|
|
9fb40c9bc8 | ||
|
|
ee5ef78a87 | ||
|
|
a5739b2a42 | ||
|
|
5b71c709b0 | ||
|
|
2ee61a386e | ||
|
|
a4b58c1db1 | ||
|
|
f4b51cf0fe | ||
|
|
6e42ea2dd0 | ||
|
|
5c35768926 | ||
|
|
ae58ceb8d8 | ||
| 01a5a6ef8d | |||
|
|
ef2bd86aa0 | ||
| 16efe49080 |
@@ -16,15 +16,6 @@ $web_page_meta_twitter_card='';
|
||||
require_once('.htac_nav.php');
|
||||
?>
|
||||
<div>
|
||||
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio quis numquam voluptatibus dolorem quo iste voluptate labore sapiente doloremque repudiandae impedit consectetur, perspiciatis exercitationem voluptates. Iste beatae nisi corrupti aspernatur.</p>
|
||||
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio quis numquam voluptatibus dolorem quo iste voluptate labore sapiente doloremque repudiandae impedit consectetur, perspiciatis exercitationem voluptates. Iste beatae nisi corrupti aspernatur.</p>
|
||||
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio quis numquam voluptatibus dolorem quo iste voluptate labore sapiente doloremque repudiandae impedit consectetur, perspiciatis exercitationem voluptates. Iste beatae nisi corrupti aspernatur.</p>
|
||||
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio quis numquam voluptatibus dolorem quo iste voluptate labore sapiente doloremque repudiandae impedit consectetur, perspiciatis exercitationem voluptates. Iste beatae nisi corrupti aspernatur.</p>
|
||||
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio quis numquam voluptatibus dolorem quo iste voluptate labore sapiente doloremque repudiandae impedit consectetur, perspiciatis exercitationem voluptates. Iste beatae nisi corrupti aspernatur.</p>
|
||||
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio quis numquam voluptatibus dolorem quo iste voluptate labore sapiente doloremque repudiandae impedit consectetur, perspiciatis exercitationem voluptates. Iste beatae nisi corrupti aspernatur.</p>
|
||||
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio quis numquam voluptatibus dolorem quo iste voluptate labore sapiente doloremque repudiandae impedit consectetur, perspiciatis exercitationem voluptates. Iste beatae nisi corrupti aspernatur.</p>
|
||||
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio quis numquam voluptatibus dolorem quo iste voluptate labore sapiente doloremque repudiandae impedit consectetur, perspiciatis exercitationem voluptates. Iste beatae nisi corrupti aspernatur.</p>
|
||||
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio quis numquam voluptatibus dolorem quo iste voluptate labore sapiente doloremque repudiandae impedit consectetur, perspiciatis exercitationem voluptates. Iste beatae nisi corrupti aspernatur.</p>
|
||||
<p style="text-align: center; font-size: 30px; font-weight: bold; margin-top:20%;">Beanstalkedu CRM</p>
|
||||
<p style="text-align: center; font-size: 30px; font-weight: bold; margin-top:20%;">Welcome to Beanstalkedu CRM Portal</p>
|
||||
</div>
|
||||
<?
|
||||
|
||||
@@ -18,7 +18,7 @@ try {
|
||||
foreach ($rows as $row) {
|
||||
$data = str_getcsv($row);
|
||||
// Prepare SQL statement
|
||||
$stmt = $conn->prepare("INSERT INTO cleads (name, email, phone, formname, note, details, origin, verticals, business_type, status) VALUES (:name, :email, :phone, 'crm-portal', :note, :details, :origin, '5', :business_type, 'New')");
|
||||
$stmt = $conn->prepare("INSERT INTO cleads (name, email, phone, formname, note, details, origin, verticals, business_type, status, country, state, lead_quality) VALUES (:name, :email, :phone, 'crm-portal', :note, :details, :origin, '5', :business_type, 'New', :country, :state, :lead_quality)");
|
||||
$stmt->bindParam(':name', $data[0]);
|
||||
$stmt->bindParam(':email', $data[1]);
|
||||
$stmt->bindParam(':phone', $data[2]);
|
||||
@@ -26,6 +26,9 @@ try {
|
||||
$stmt->bindParam(':details', $data[5]);
|
||||
$stmt->bindParam(':origin', $data[6]);
|
||||
$stmt->bindParam(':business_type', $data[8]);
|
||||
$stmt->bindParam(':country', $data[13]);
|
||||
$stmt->bindParam(':state', $data[14]);
|
||||
$stmt->bindParam(':lead_quality', $data[15]);
|
||||
|
||||
// Execute the SQL statement
|
||||
$stmt->execute();
|
||||
@@ -46,6 +49,8 @@ $conn = null;
|
||||
<p>TH(the first row) will not be added (Ignored), in every uploads the first row have to be there, as provided in the sample csv </p>
|
||||
<p><span style="font-weight: bold;">Origin:</span> Facebook-Ads, Google-Ads, Linkedin-Ads, Instagram, Messenger, Whatsapp, GMB, Linkedin, Inbound-Call, Outbound-Call, Others</p>
|
||||
<p><span style="font-weight: bold;">Verticals:</span> beanstalk, inhouse, teenybeans, iimtt, buzzapp, atheneum, teenybeans_curriculum</p>
|
||||
<p class="font-bold">Country list & code <a class="" style="color: #7875f4;" href="/assets/countries.csv" download="Country_List_&_Code.csv">Download</a></p>
|
||||
<p class="font-bold">State list & code <a class="" style="color: #7875f4;" href="/assets/states.csv" download="State_List_&_Code.csv">Download</a></p>
|
||||
</div>
|
||||
<div class="flex flex-col place-items-center mt-10 mb-[20%]">
|
||||
<div class="flex flex-col justify-center bg-[#F6F6F6] p-6 rounded-xl" style="min-width: 600px;">
|
||||
@@ -83,7 +88,7 @@ $conn = null;
|
||||
document.getElementById("spinner").style.display = "block";
|
||||
|
||||
setTimeout(() => {
|
||||
document.getElementById("uploadStatus").textContent = "Upload Complete";
|
||||
document.getElementById("uploadStatus").textContent = "Then: Click Upload Files";
|
||||
// Hide spinner after upload completion
|
||||
document.getElementById("spinner").style.display = "none";
|
||||
}, 2000); // Simulated upload time 2 seconds
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
max-width: 500px;
|
||||
box-shadow: 0px 0px 20px 0px #443780;
|
||||
border-radius: 2px;
|
||||
z-index: 100;
|
||||
z-index: 999;
|
||||
height: 100%;
|
||||
padding: 10px 20px 10px 20px;
|
||||
animation: slideInRight 0.5s forwards; /* Animation to slide in */
|
||||
|
||||
@@ -1,273 +0,0 @@
|
||||
<?php
|
||||
require_once('.hta_config/crm_config.php');
|
||||
require_once('.htac_header.php');
|
||||
require_once('.htac_nav.php');
|
||||
|
||||
try {
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch(PDOException $e) {
|
||||
echo "Connection failed: " . $e->getMessage();
|
||||
}
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$select_access = ['beanstalk', 'inhouse', 'teenybeans', 'iimtt', 'buzzapp', 'atheneum', 'teenybeans_curriculum'];
|
||||
$access_values_array = [];
|
||||
|
||||
foreach ($select_access as $access) {
|
||||
if (isset($_POST[$access])) {
|
||||
$access_values_array[] = $_POST[$access];
|
||||
}
|
||||
}
|
||||
$access_value = implode(',', $access_values_array);
|
||||
$name = $_POST['name'];
|
||||
$email = $_POST['email'];
|
||||
$phone = $_POST['phone'];
|
||||
$password = md5($_POST['pass']);
|
||||
$selected_states = implode(',', $_POST['states']); // Collect selected state values
|
||||
|
||||
try {
|
||||
$stmt = $conn->prepare("INSERT INTO users (name, email, mobile, access, pass, states) VALUES (:name, :email, :mobile, :access, :pass, :states)");
|
||||
$stmt->bindParam(':name', $name);
|
||||
$stmt->bindParam(':email', $email);
|
||||
$stmt->bindParam(':mobile', $phone);
|
||||
$stmt->bindParam(':access', $access_value);
|
||||
$stmt->bindParam(':pass', $password);
|
||||
$stmt->bindParam(':states', $selected_states); // Bind selected states
|
||||
$stmt->execute();
|
||||
|
||||
echo "Record added successfully";
|
||||
} catch(PDOException $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div style="display: flex; flex-direction: column; justify-content: center; align-items: center; margin-top: 30px; margin-bottom: 30px;">
|
||||
<form action="" method="post" style="width: 600px; max-width: 600px; border: 1px solid #36365050; padding: 20px; border-radius: 20px; box-shadow: 0px 0px 10px 0px #363650;">
|
||||
<p style="font-size: 25px; font-weight: bold; margin-top: 10px; margin-bottom: 10px;">Add new user</p>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<label for="name">Name:</label>
|
||||
<input type="text" name="name" id="name" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" />
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<label for="email">E-mail:</label>
|
||||
<input type="text" name="email" id="email" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" />
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<label for="phone">Phone:</label>
|
||||
<input type="text" name="phone" id="phone" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" />
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<label>
|
||||
Country:
|
||||
</label>
|
||||
<label for="national">National
|
||||
<input type="radio" name="country" id="national" onchange="checkCountry()" />
|
||||
</label>
|
||||
<label for="international">International
|
||||
<input type="radio" name="country" id="international" onchange="checkCountry()" />
|
||||
</label>
|
||||
</div>
|
||||
<!-- <div style="display: flex; flex-direction: column;">
|
||||
<label for="country">Country:</label>
|
||||
<select name="country" id="country" onchange="checkCountry();" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;">
|
||||
<option value="">Select Country</option>
|
||||
</select>
|
||||
</div> -->
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<p>Access:</p>
|
||||
<?php
|
||||
try {
|
||||
$stmt = $conn->prepare("SELECT * FROM business_verticals");
|
||||
$stmt->execute();
|
||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$num_rows = $stmt->rowCount();
|
||||
if ($num_rows >= 1) {
|
||||
foreach($rows as $row){ ?>
|
||||
<div>
|
||||
<input type="checkbox" name="<?php echo $row['bv']; ?>" id="<?php echo $row['bv']; ?>" value="<?php echo $row['bv']; ?>" />
|
||||
<label for="<?php echo $row['bv']; ?>" style="text-transform: uppercase;"><?php echo $row['bv']; ?></label>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
} else{
|
||||
echo "<p class='text-danger'>Not Found any Data</p>";
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div style="display: none; flex-direction: column;" id="state-access">
|
||||
<p style="font-size: 16px; font-weight: bold; margin-top: 10px;">Access by state:</p>
|
||||
<div id="selectedStateDisplay"></div>
|
||||
<div class="dropdown">
|
||||
<button class="dropbtn" id="selectStatesBtn">Select States</button>
|
||||
<div class="dropdown-content" id="stateDropdown">
|
||||
<!-- State options will be populated here -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<label for="pass">Password:</label>
|
||||
<input type="text" name="pass" id="pass" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" />
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<input type="submit" name="submit" id="submit" value="Submit" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); text-align: center; padding: 10px 20px 10px 20px; color: #fff; border-radius: 6px; float: right; margin-top: 30px;" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
function fetchCountries() {
|
||||
fetch('https://api.siliconpin.com/v3/list/country/')
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
const countryDropdown = document.getElementById('country');
|
||||
countryDropdown.innerHTML = '<option id="" value="">Select Country</option>';
|
||||
data.forEach(country => {
|
||||
const option = document.createElement('option');
|
||||
option.value = country.iso2;
|
||||
option.text = country.name;
|
||||
countryDropdown.appendChild(option);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
fetchCountries();
|
||||
|
||||
// function checkCountry(){
|
||||
// let getCountry = document.getElementById('country').value;
|
||||
// console.log(getCountry);
|
||||
// if(getCountry === "national"){
|
||||
// document.getElementById('state-access').style.display = 'flex';
|
||||
// } else{
|
||||
// document.getElementById('state-access').style.display = 'none';
|
||||
// }
|
||||
// }
|
||||
function checkCountry() {
|
||||
if (document.getElementById('national').checked) {
|
||||
document.getElementById('state-access').style.display = 'flex';
|
||||
} else {
|
||||
document.getElementById('state-access').style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function fetchStates() {
|
||||
fetch(`https://api.siliconpin.com/v3/list/country/state/?country=IN`)
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
const dropdownContent = document.getElementById('stateDropdown');
|
||||
dropdownContent.innerHTML = ''; // Clear previous content
|
||||
|
||||
data.forEach(state => {
|
||||
const checkboxDiv = document.createElement('div');
|
||||
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.name = 'states[]'; // You might want to use an array here if submitting form
|
||||
checkbox.value = state.iso2;
|
||||
checkbox.id = state.iso2;
|
||||
const label = document.createElement('label');
|
||||
label.textContent = state.name;
|
||||
label.style = 'text-transform: uppercase';
|
||||
label.setAttribute('for', state.iso2);
|
||||
checkboxDiv.appendChild(checkbox);
|
||||
checkboxDiv.appendChild(label);
|
||||
dropdownContent.appendChild(checkboxDiv);
|
||||
|
||||
// Add event listener to checkbox change
|
||||
checkbox.addEventListener('change', function() {
|
||||
updateSelectedStateDisplay();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function toggleDropdown() {
|
||||
const dropdownContent = document.getElementById('stateDropdown');
|
||||
dropdownContent.classList.toggle('show');
|
||||
}
|
||||
|
||||
// Update the selected state display
|
||||
function updateSelectedStateDisplay() {
|
||||
const selectedStates = Array.from(document.querySelectorAll('input[name="states[]"]:checked'))
|
||||
.map(checkbox => checkbox.parentNode.querySelector('label').textContent);
|
||||
const selectedStateDisplay = document.getElementById('selectedStateDisplay');
|
||||
selectedStateDisplay.textContent = 'Selected States: ' + selectedStates.join(', ');
|
||||
}
|
||||
|
||||
// Add an event listener to the button
|
||||
document.getElementById('selectStatesBtn').addEventListener('click', function(event) {
|
||||
// Prevent the default form submission behavior
|
||||
event.preventDefault();
|
||||
// Toggle the dropdown visibility
|
||||
toggleDropdown();
|
||||
});
|
||||
fetchStates();
|
||||
</script>
|
||||
<style>
|
||||
.dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
border: 1px solid #363650;
|
||||
border-radius: 5px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dropbtn {
|
||||
border: 1px solid #363650;
|
||||
padding: 6px;
|
||||
font-size: 16px;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.dropdown-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #f9f9f9;
|
||||
/* min-width: 160px; */
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
max-height: 230px; /* Adjust as needed */
|
||||
border: 1px solid #ddd;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.dropdown-content div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.dropdown-content div label {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.dropdown-content div:hover {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
.show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* For small screens */
|
||||
@media screen and (max-width: 767px) {
|
||||
#stateCheckboxes {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr); /* 2 columns */
|
||||
gap: 10px; /* Adjust the gap as needed */
|
||||
}
|
||||
}
|
||||
|
||||
/* For large screens */
|
||||
@media screen and (min-width: 768px) {
|
||||
#stateCheckboxes {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr); /* 3 columns */
|
||||
gap: 10px; /* Adjust the gap as needed */
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -40,7 +40,6 @@
|
||||
<tr>
|
||||
<th class="text-center border-b-2 p-3">Serial</th>
|
||||
<th class="text-center border-b-2 p-3">Business Verticals</th>
|
||||
<th class="text-center border-b-2 p-3">Time</th>
|
||||
<th class="text-center border-b-2 p-3">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -58,7 +57,6 @@
|
||||
<tr>
|
||||
<td class="border-y-2 p-2 text-center"><?php echo $bv_counter; ?></td>
|
||||
<td class="border-y-2 p-2 "><?php echo $row['bv']; ?></td>
|
||||
<td class="border-y-2 p-2 text-center"><?php echo $row['time']; ?></td>
|
||||
<td class="border-y-2 p-2">
|
||||
<div class="flex flex-row justify-center">
|
||||
<a href="/admin/edit-business-verticals/?id=<?php echo $row['id']; ?>">Edit</a> |
|
||||
@@ -110,7 +108,7 @@
|
||||
max-width: 500px;
|
||||
box-shadow: 0px 0px 20px 0px #443780;
|
||||
border-radius: 2px;
|
||||
z-index: 100;
|
||||
z-index: 999;
|
||||
height: 100%;
|
||||
padding: 10px 20px 10px 20px;
|
||||
animation: slideInRight 0.5s forwards; /* Animation to slide in */
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
// $phone = $_POST['phone'];
|
||||
// $password = md5($_POST['pass']);
|
||||
try {
|
||||
$select_access = ['beanstalk', 'inhouse', 'teenybeans', 'iimtt', 'buzzapp', 'atheneum', 'teenybeans_curriculum'];
|
||||
$select_access = ['beanstalk', 'inhouse', 'teenybeans', 'iimtt', 'buzzapp', 'atheneum', 'teenybeans_curriculum', 'akadmy'];
|
||||
$access_values_array = [];
|
||||
foreach ($select_access as $access) {
|
||||
if (isset($_POST[$access])) {
|
||||
|
||||
@@ -110,8 +110,8 @@
|
||||
<td class="border-y-2 p-2"><?php echo $row['email']; ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $row['mobile']; ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $row['time']; ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $row['access']; ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $row['states']; ?></td>
|
||||
<td title="<?php echo $row['access']; ?>" class="border-y-2 p-2 max-w-[150px] truncate overflow-hidden text-ellipsis whitespace-nowrap"><?php echo $row['access']; ?></td>
|
||||
<td title="<?php echo $row['states']; ?>" class="border-y-2 p-2 max-w-[150px] truncate overflow-hidden text-ellipsis whitespace-nowrap"><?php echo $row['states']; ?></td>
|
||||
<td class="border-y-2 p-2">
|
||||
<div class="flex flex-row justify-center">
|
||||
<a href="/admin/edit-user/?id=<?php echo $row['id']; ?>">Edit</a> |
|
||||
@@ -288,7 +288,7 @@
|
||||
max-width: 700px;
|
||||
box-shadow: 0px 0px 20px 0px #443780;
|
||||
border-radius: 2px;
|
||||
z-index: 100;
|
||||
z-index: 999;
|
||||
height: 100%;
|
||||
padding: 10px 20px 10px 20px;
|
||||
animation: slideInRight 0.5s forwards; /* Animation to slide in */
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
require_once('.hta_config/crm_config.php');
|
||||
require_once('.htac_header.php');
|
||||
require_once('.htac_nav.php');
|
||||
|
||||
$getLeadID = $_GET['id'];
|
||||
// echo $_GET['id'];
|
||||
// Below two fetch for edit data
|
||||
|
||||
@@ -15,7 +17,7 @@
|
||||
try {
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$stmt = $conn->prepare("UPDATE cleads SET name = :name, email = :email, phone = :phone, date = :date, status = :status, user = :user, country = :country, state= :state, city = :city, address = :address, profession = :profession, coupon_code = :coupon_code, gender = :gender, warm_status = :warm_status WHERE id = :id");
|
||||
$stmt = $conn->prepare("UPDATE cleads SET name = :name, email = :email, phone = :phone, date = :date, status = :status, user = :user, country = :country, state= :state, city = :city, address = :address, profession = :profession, coupon_code = :coupon_code, gender = :gender, warm_status = :warm_status, business_type = :business_type, lead_quality = :lead_quality WHERE id = :id");
|
||||
$stmt->bindParam(':name', $_POST['name']);
|
||||
$stmt->bindParam(':email', $_POST['email']);
|
||||
$stmt->bindParam(':phone', $_POST['phone']);
|
||||
@@ -30,6 +32,8 @@
|
||||
$stmt->bindParam(':coupon_code', $_POST['coupon_code']);
|
||||
$stmt->bindParam(':gender', $_POST['gender']);
|
||||
$stmt->bindParam(':warm_status', $_POST['warm_status']);
|
||||
$stmt->bindParam(':business_type', $_POST['business_type']);
|
||||
$stmt->bindParam(':lead_quality', $_POST['lead_quality']);
|
||||
$stmt->bindParam(':id', $_GET['id']);
|
||||
$stmt->execute();
|
||||
|
||||
@@ -49,16 +53,20 @@
|
||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
// var_dump($rows);
|
||||
foreach($rows as $row){
|
||||
$usersEmailForSendMessage = $row['email'];
|
||||
$usersNameforSendMessage = $row['name'];
|
||||
$usersNumberforSendMessage = $row['phone'];
|
||||
$nameParts = explode(" ", $row['name']);
|
||||
$firstInitial = substr($nameParts[0], 0, 1);
|
||||
$lastInitial = isset($nameParts[1]) ? substr($nameParts[1], 0, 1) : '';
|
||||
$name_letter = $firstInitial . $lastInitial;
|
||||
|
||||
if($row['status'] == 'New'){$conditional_background_color = 'background-color: #FFD9D9; border: 1px solid #FB5555; border-radius: 5px; color: #FB5555;';}
|
||||
elseif($row['status'] == 'Contacted'){$conditional_background_color = 'background-color: #D4FFFF; border: 1px solid #2C9C9C; border-radius: 5px; color: #2C9C9C;';}
|
||||
if($row['status'] == 'New'){$conditional_background_color = 'background-color: #D4FFFF; border: 1px solid #2C9C9C; border-radius: 5px; color: #2C9C9C;';}
|
||||
elseif($row['status'] == 'Contacted'){$conditional_background_color = 'background-color: #D0E9FF; border: 1px solid #1A91FF; border-radius: 5px; color: #1A91FF;';}
|
||||
elseif($row['status'] == 'Disqualified'){$conditional_background_color = 'background-color: #CECECE; border: 1px solid #3F4254; border-radius: 5px; color: #3F4254;';}
|
||||
elseif($row['status'] == 'Converted'){$conditional_background_color = 'background-color: #D4FDE7; border: 1px solid #40916C; border-radius: 5px; color: #40916C;';}
|
||||
elseif($row['status'] == 'Warm'){$conditional_background_color = 'background-color: #FFD9D9; border: 1px solid #FB5555; border-radius: 5px; color: #FB5555;';}
|
||||
elseif($row['status'] == 'Inactive'){$conditional_background_color = 'background-color: #FFD9D9; border: 1px solid #FB5555; border-radius: 5px; color: #FB5555;';}
|
||||
?>
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 p-6 space-x-4">
|
||||
<form method="post" class="w-full lg:col-span-2">
|
||||
@@ -81,11 +89,50 @@
|
||||
<button class="copy-btn fa fa-copy" data-input-id="phone"></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 p-3 border-b-2 border-[#D9D9D9] space-x-6" style="text-align: left;">
|
||||
<div class="grid grid-cols-3 p-3 border-b-2 border-[#D9D9D9] space-x-6" style="text-align: left;">
|
||||
<div>
|
||||
<p><b>Client ID</b></p>
|
||||
<p style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;"><?php echo $row['id']; ?></p>
|
||||
</div>
|
||||
<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 id="templateList" class="xzmdropdown-content"></div>
|
||||
</div> |
|
||||
<div>
|
||||
<div class="xzmdropdown-wrapper ">
|
||||
<button class="xzmdropdown-btn px-4"><i class="fab fa-whatsapp" style="font-size: 20px"></i></button>
|
||||
<div id="templateWhatsappList" class="xzmdropdown-content"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Form Name</b></p>
|
||||
<p style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;"><?php echo $row['formname']; ?></p>
|
||||
@@ -145,10 +192,34 @@
|
||||
<input class="w-full" type="text" name="profession" id="profession" value="<?php echo $row['profession']; ?>" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 p-3 border-b-2 border-[#D9D9D9] space-x-6" style="text-align: left;">
|
||||
<div class="grid grid-cols-3 p-3 border-b-2 border-[#D9D9D9] space-x-6" style="text-align: left;">
|
||||
<div>
|
||||
<p><b>Origin</b></p>
|
||||
<p style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;"><?php echo $row['origin']; ?></p>
|
||||
<p style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;"><?php echo $row['origin'] ?: "No origin"; ?></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Verticals</b></p>
|
||||
<select class="w-full" name="business_type" id="business_type" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;">
|
||||
<option value="">-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 * FROM business_verticals");
|
||||
$stmt->execute();
|
||||
$businessRows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
foreach($businessRows as $businessVerticals) {
|
||||
// Check if the current business vertical is the one selected
|
||||
$isBVSelected = ($row['business_type'] == $businessVerticals['bv']) ? 'selected' : '';
|
||||
echo '<option value="'.$businessVerticals['bv'].'" '.$isBVSelected.'>'.$businessVerticals['bv'].'</option>';
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Lead Status</b></p>
|
||||
@@ -164,7 +235,7 @@
|
||||
</select>
|
||||
<?php
|
||||
if ($row['status'] == 'Warm') {
|
||||
echo '<select class="w-full" name="warm_status" id="warm_status" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;">';
|
||||
echo '<select class="w-full" name="warm_status" id="warm_status" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;"><option value="0">-Select-</option>';
|
||||
$options = array("Proposal Sent", "Meeting Conducted", "Interested");
|
||||
foreach ($options as $option) {
|
||||
$selected = ($option == $row['warm_status']) ? 'selected' : '';
|
||||
@@ -186,9 +257,9 @@
|
||||
<p style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;"><?php echo $row['time']; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-3 p-3 border-b-2 border-[#D9D9D9] space-x-6" style="text-align: left;">
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 p-3 border-b-2 border-[#D9D9D9] space-x-6" style="text-align: left;">
|
||||
<div>
|
||||
<p><b>Follow Update</b></p>
|
||||
<p><b>Followup Date</b></p>
|
||||
<input class="w-full" type="date" name="date" id="date" value="<?php echo $row['date']; ?>" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;" />
|
||||
</div>
|
||||
<div>
|
||||
@@ -196,128 +267,183 @@
|
||||
<select id="user" name="user" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px; width: 100%;">
|
||||
<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 email FROM users");
|
||||
$stmt->execute();
|
||||
$usersRows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
try {
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$stmt = $conn->prepare("SELECT email FROM users");
|
||||
$stmt->execute();
|
||||
$usersRows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$stmtCleads = $conn->prepare("SELECT user FROM cleads WHERE id = :id");
|
||||
$stmtCleads->bindParam(':id', $_GET['id']);
|
||||
$stmtCleads->execute();
|
||||
$usersCleads = $stmtCleads->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$selectedEmails = [];
|
||||
foreach($usersCleads as $userEmail){
|
||||
$selectedEmails[] = $userEmail['user'];
|
||||
}
|
||||
foreach($usersRows as $userData){
|
||||
$isUserSelected = in_array($userData['email'], $selectedEmails) ? 'selected' : '';
|
||||
echo '<option value="'.$userData['email'].'" '.$isUserSelected.'>'.$userData['email'].'</option>';
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
};
|
||||
$stmtCleads = $conn->prepare("SELECT user FROM cleads WHERE id = :id");
|
||||
$stmtCleads->bindParam(':id', $_GET['id']);
|
||||
$stmtCleads->execute();
|
||||
$usersCleads = $stmtCleads->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$selectedEmails = [];
|
||||
foreach($usersCleads as $userEmail){
|
||||
$selectedEmails[] = $userEmail['user'];
|
||||
}
|
||||
foreach($usersRows as $userData){
|
||||
$isUserSelected = in_array($userData['email'], $selectedEmails) ? 'selected' : '';
|
||||
echo '<option value="'.$userData['email'].'" '.$isUserSelected.'>'.$userData['email'].'</option>';
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
};
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<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: 20px">
|
||||
<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="#">UNO</a>
|
||||
<a href="#">Primero</a>
|
||||
<div class="xzmdropdown-item">
|
||||
<a href="#">ILC</a>
|
||||
<a href="#">Complete package</a>
|
||||
<a href="#" class="bespoke-trigger">Bespoke</a>
|
||||
<div class="xzmdropdown-submenu">
|
||||
<a href="#">Academic</a>
|
||||
<a href="#">Buzzapp</a>
|
||||
<a href="#">Design Solution</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> |
|
||||
<div>
|
||||
<div class="xzmdropdown-wrapper ">
|
||||
<button class="xzmdropdown-btn px-4"><i class="fab fa-whatsapp" style="font-size: 20px"></i></button>
|
||||
<div class="xzmdropdown-content">
|
||||
<form method="post">
|
||||
<input type="hidden" name="leadid" value="<?php echo $_GET['id'] ?>" />
|
||||
<input type="hidden" name="useremail" value="<?php echo $_SESSION['email'] ?>" />
|
||||
<input type="hidden" name="templateid" value="" />
|
||||
<input type="submit" value="UNO">
|
||||
</form>
|
||||
<!-- <a href="#">UNO</a> -->
|
||||
|
||||
<form method="post">
|
||||
<input type="hidden" name="leadid" value="<?php echo $_GET['id'] ?>" />
|
||||
<input type="hidden" name="useremail" value="<?php echo $_SESSION['email'] ?>" />
|
||||
<input type="hidden" name="templateid" value="" />
|
||||
<input type="submit" value="Primero">
|
||||
</form>
|
||||
|
||||
<!-- <a href="#">Primero</a> -->
|
||||
<div class="xzmdropdown-item">
|
||||
<form method="post">
|
||||
<input type="hidden" name="leadid" value="<?php echo $_GET['id'] ?>" />
|
||||
<input type="hidden" name="useremail" value="<?php echo $_SESSION['email'] ?>" />
|
||||
<input type="hidden" name="templateid" value="" />
|
||||
<input type="submit" value="ILC">
|
||||
</form>
|
||||
<!-- <a href="#">ILC</a> -->
|
||||
|
||||
<form method="post">
|
||||
<input type="hidden" name="leadid" value="<?php echo $_GET['id'] ?>" />
|
||||
<input type="hidden" name="useremail" value="<?php echo $_SESSION['email'] ?>" />
|
||||
<input type="hidden" name="templateid" value="" />
|
||||
<input type="submit" value="Complete package">
|
||||
</form>
|
||||
<!-- <a href="#">Complete package</a> -->
|
||||
<a href="#" class="bespoke-trigger">Bespoke</a>
|
||||
<div class="xzmdropdown-submenu">
|
||||
<form method="post">
|
||||
<input type="hidden" name="leadid" value="<?php echo $_GET['id'] ?>" />
|
||||
<input type="hidden" name="useremail" value="<?php echo $_SESSION['email'] ?>" />
|
||||
<input type="hidden" name="templateid" value="" />
|
||||
<input type="submit" value="Academic">
|
||||
</form>
|
||||
<!-- <a href="#">Academic</a> -->
|
||||
<form method="post">
|
||||
<input type="hidden" name="leadid" value="<?php echo $_GET['id'] ?>" />
|
||||
<input type="hidden" name="useremail" value="<?php echo $_SESSION['email'] ?>" />
|
||||
<input type="hidden" name="templateid" value="" />
|
||||
<input type="submit" value="Buzzapp">
|
||||
</form>
|
||||
<!-- <a href="#">Buzzapp</a> -->
|
||||
<form method="post">
|
||||
<input type="hidden" name="leadid" value="<?php echo $_GET['id'] ?>" />
|
||||
<input type="hidden" name="useremail" value="<?php echo $_SESSION['email'] ?>" />
|
||||
<input type="hidden" name="templateid" value="" />
|
||||
<input type="submit" value="Design Solution">
|
||||
</form>
|
||||
<!-- <a href="#">Design Solution</a> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Assign to</b></p>
|
||||
<select name="lead_quality" id="lead_quality" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px; width: 100%;">
|
||||
<?php
|
||||
$leadQualityList = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
||||
foreach($leadQualityList as $quality){
|
||||
$isQualitySelected =($quality == $row['lead_quality']) ? 'selected' : '';
|
||||
echo '<option '.$isQualitySelected.' value='.$quality.'>Quality '.$quality.'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 10px; ">
|
||||
<div style="padding: 10px; display: flex; justify-content: space-between;">
|
||||
<a href="https://api.teenybeans.in/contactFormProcessorFileUpload/uploads/<?php echo $_GET['id']; ?>.xlsx" target="_blank" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); color: #fff; border-radius: 6px; padding: 10px 20px 10px 20px; float: right; cursor: pointer;">Download Lead as XLS</a>
|
||||
<input type="submit" id="update_data" name="update_data" value="Update" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); color: #fff; border-radius: 6px; padding: 10px 30px 10px 30px; float: right; cursor: pointer;" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
if (isset($_GET['send-email-id']) && $_GET['send-email-id']) {
|
||||
$url = "https://api.brevo.com/v3/smtp/email";
|
||||
$apiKey = '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';
|
||||
$data = [
|
||||
"to" => [
|
||||
[
|
||||
"email" => $usersEmailForSendMessage,
|
||||
"name" => $usersNameforSendMessage
|
||||
]
|
||||
],
|
||||
"templateId" => (int)$_GET['send-email-id'], // Ensure this is an integer
|
||||
"batchId" => "5c6cfa04-eed9-42c2-8b5c-6d470d978e9d"
|
||||
];
|
||||
$jsonData = json_encode($data);
|
||||
|
||||
$options = [
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json\r\n" .
|
||||
"api-key: $apiKey\r\n",
|
||||
'method' => 'POST',
|
||||
'content' => $jsonData,
|
||||
],
|
||||
];
|
||||
|
||||
$context = stream_context_create($options);
|
||||
$fp = @fopen($url, 'r', false, $context); // Suppress warnings to handle them manually
|
||||
|
||||
if ($fp === FALSE) {
|
||||
$error = error_get_last();
|
||||
echo 'Error occurred: ' . $error['message'];
|
||||
} else {
|
||||
$response = stream_get_contents($fp);
|
||||
$http_response_header = $http_response_header ?? [];
|
||||
$response_code = (int)substr($http_response_header[0], 9, 3);
|
||||
|
||||
if ($response === FALSE || $response_code >= 400) {
|
||||
echo 'Error reading response: ' . $response;
|
||||
} else {
|
||||
$templateName = $_GET['send-email-id'];
|
||||
$messageMethod = 'Email';
|
||||
try {
|
||||
$stmt = $conn->prepare("INSERT INTO communication (leadid, useremail, username, templateid, method) VALUES (:leadid, :useremail, :username, :templateid, :method)");
|
||||
$stmt->bindParam(':leadid', $_GET['id']);
|
||||
$stmt->bindParam(':useremail', $_SESSION['email']);
|
||||
$stmt->bindParam(':username', $_SESSION['name']);
|
||||
$stmt->bindParam(':templateid', $templateName);
|
||||
$stmt->bindParam(':method', $messageMethod);
|
||||
$stmt->execute();
|
||||
$sendSuccessMessage = "Email Sent successfully";
|
||||
// echo '<script>window.location.href = "/edit-lead/?id='.$_GET['id'].'"</script>';
|
||||
} catch (PDOException $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
// Close the file pointer
|
||||
fclose($fp);
|
||||
echo '<script>window.location.href = "/edit-lead/?id='.$_GET['id'].'"</script>';
|
||||
}
|
||||
} elseif (isset($_GET['send-whatsapp-id']) && $_GET['send-whatsapp-id']) {
|
||||
$url = "https://api.interakt.ai/v1/public/message/";
|
||||
$apiKey = 'Basic {{OTgyajd4bHFUSXItSW9PN1BTdzhOenNDaS0ya0NQeXByRE0tMnRyQ3FrUTo=}}';
|
||||
$data = [
|
||||
"fullPhoneNumber" => $usersNumberforSendMessage,
|
||||
"callbackData" => "some text here",
|
||||
"type" => "Template",
|
||||
"template" => [
|
||||
"name" => $_GET['send-whatsapp-id'],
|
||||
"languageCode" => "en",
|
||||
"headerValues" => [
|
||||
"header_variable_value"
|
||||
],
|
||||
"bodyValues" => [
|
||||
$usersNameforSendMessage
|
||||
]
|
||||
]
|
||||
];
|
||||
$jsonData = json_encode($data);
|
||||
|
||||
$options = [
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json\r\n" .
|
||||
"Authorization: $apiKey\r\n" .
|
||||
"Content-Length: " . strlen($jsonData) . "\r\n",
|
||||
'method' => 'POST',
|
||||
'content' => $jsonData,
|
||||
],
|
||||
];
|
||||
|
||||
$context = stream_context_create($options);
|
||||
$fp = fopen($url, 'r', false, $context);
|
||||
if ($fp === FALSE) {
|
||||
// echo 'Error occurred';
|
||||
echo $fp;
|
||||
} else {
|
||||
$response = stream_get_contents($fp);
|
||||
|
||||
if ($response === FALSE) {
|
||||
// echo 'Error reading response';
|
||||
// echo $response;
|
||||
} else {
|
||||
if(isset($_GET['send-whatsapp-id'])){
|
||||
$templateName = $_GET['send-whatsapp-id'];
|
||||
} elseif(isset($_GET['send-email-id'])){
|
||||
$templateName = $_GET['send-email-id'];
|
||||
}
|
||||
$messageMethod = 'WhatsApp';
|
||||
try {
|
||||
$stmt = $conn->prepare("INSERT INTO communication (leadid, useremail, username, templateid, method) VALUES (:leadid, :useremail, :username, :templateid, :method)");
|
||||
$stmt->bindParam(':leadid', $_GET['id']);
|
||||
$stmt->bindParam(':useremail', $_SESSION['email']);
|
||||
$stmt->bindParam(':username', $_SESSION['name']);
|
||||
$stmt->bindParam(':templateid', $templateName);
|
||||
$stmt->bindParam(':method', $messageMethod);
|
||||
$stmt->execute();
|
||||
$sendSuccessMessage = "WhatsApp Sent successfully";
|
||||
|
||||
} catch(PDOException $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
}
|
||||
// echo '<script>window.location.href="/edit-lead/?id='.$_GET['id'].'"</script>';
|
||||
// echo $response;
|
||||
}
|
||||
fclose($fp);
|
||||
echo '<script>window.location.href = "/edit-lead/?id='.$_GET['id'].'"</script>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="flex flex-col div-custom-margin" style="width: 100%;" >
|
||||
<div class="bg-[#F6F6F6] rounded-xl p-3">
|
||||
<div class="flex flex-row place-content-between" style="border-bottom: 2px solid #7E8299; border-style: dashed; padding-bottom: 3px;">
|
||||
<div class="flex-container-x2y place-content-between" style="border-bottom: 2px solid #7E8299; border-style: dashed; padding-bottom: 3px;">
|
||||
<p style="font-size: 25px; font-weight: bold;">Comments: <span><?php echo $totalRecords; ?></span></p>
|
||||
<button id="toggleButton" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); color: #fff; border-radius: 6px; padding: 6px 20px 6px 20px;">Add Comment</button>
|
||||
</div>
|
||||
@@ -341,9 +467,9 @@
|
||||
};
|
||||
?>
|
||||
<form class="" method="post" id="content" style="display: none;">
|
||||
<div class="flex flex-row" style="margin-top: 10px; border-bottom: 2px solid #7E8299; padding-bottom: 10px;">
|
||||
<input class="rounded-l-xl focus:outline-none w-1/2" type="text" name="comments" id="comments" style="border: 2px solid #363650; padding: 6px;" />
|
||||
<input class="rounded-r-xl focus:outline-none" type="submit" value="Save" name="save_comment" id="save_comment" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); color: #fff; padding: 8px 20px 8px 20px;" />
|
||||
<div class="flex flex-col space-y-4" style="margin-top: 10px; border-bottom: 2px solid #7E8299; padding-bottom: 10px;">
|
||||
<textarea class="rounded-md focus:outline-none w-full" rows="4" type="text" name="comments" id="comments" style="border: 2px solid #363650; padding: 6px;" ></textarea>
|
||||
<input class="rounded-md focus:outline-none" type="submit" value="Save" name="save_comment" id="save_comment" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); color: #fff; padding: 8px 20px 8px 20px;" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -379,12 +505,13 @@
|
||||
try {
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$stmt = $conn->prepare("INSERT INTO appointment (appt_date, email, name, leadid, comment) VALUES (:appt_date, :email, :name, :leadid, :comment)");
|
||||
$stmt = $conn->prepare("INSERT INTO appointment (appt_date, email, name, leadid, comment, lead_name) VALUES (:appt_date, :email, :name, :leadid, :comment, :lead_name)");
|
||||
$stmt->bindParam(':appt_date', $_POST['appt_date']);
|
||||
$stmt->bindParam(':email', $_SESSION['email']);
|
||||
$stmt->bindParam(':name', $_SESSION['name']);
|
||||
$stmt->bindParam(':leadid', $_GET['id']);
|
||||
$stmt->bindParam(':comment', $_POST['comment']);
|
||||
$stmt->bindParam(':lead_name', $_POST['lead_name']);
|
||||
$stmt->execute();
|
||||
$saved_message = "New Appointment save successfully";
|
||||
} catch(PDOException $e) {
|
||||
@@ -517,6 +644,54 @@
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col mt-3 bg-[#F6F6F6] rounded-xl">
|
||||
<div class="flex flex-row place-content-between p-3" style="border-bottom: 2px solid #7E8299; border-style: dashed;">
|
||||
<div class="flex flex-col">
|
||||
<p style="font-size: 20px; font-weight: bold;">Communication:</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="" style="max-height: 265px; overflow-y: auto;">
|
||||
<?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 communication WHERE leadid = :leadid ORDER BY time DESC");
|
||||
$stmt->bindParam(':leadid', $_GET['id']);
|
||||
$stmt->execute();
|
||||
$appt_data = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$appt_rowCount = count($appt_data);
|
||||
|
||||
foreach ($appt_data as $appt) {
|
||||
// Assuming 'comment' and 'date' fields are in the appointments table
|
||||
$apptDate = explode(' ', $appt['time']); // Split date and time
|
||||
if (is_numeric($appt['templateid'])) {
|
||||
$templateNameForPrint = 'Email Template ID ' . $appt['templateid'];
|
||||
} else {
|
||||
$templateNameForPrint = $appt['templateid'];
|
||||
}
|
||||
?>
|
||||
<div class="flex flex-col px-6" style="border-bottom: 2px solid #D9D9D9;">
|
||||
<div class="flex flex-row place-content-between align-items-center">
|
||||
<p style="font-size: 15px; font-weight: bold;"><?php echo $templateNameForPrint; ?></p>
|
||||
</div>
|
||||
<div class="grid grid-cols-2">
|
||||
<p class="text-[#7E8299] "><?php echo $appt['method']; ?> Send by <?php echo $appt['username']; ?></p>
|
||||
<div class="flex flex-col" style="border-left: 3px solid #7875F4;">
|
||||
<p style="font-weight: bold; padding-left: 6px;"><?php echo $apptDate[0]; ?></p>
|
||||
<p style="padding-left: 6px;"><?php echo $apptDate[1]; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- This IS Right Side DIV -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -535,6 +710,7 @@
|
||||
<label for="appt_date">Appointment Date</label>
|
||||
<input type="datetime-local" name="appt_date" id="appt_date" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;" />
|
||||
</div>
|
||||
<input type="text" name="lead_name" id="lead_name" value="<?php echo $usersNameforSendMessage; ?>">
|
||||
<div class="flex flex-col">
|
||||
<label for="appt-comment">Description (if needed)</label>
|
||||
<input type="text" name="comment" id="appt-comment" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;" />
|
||||
@@ -544,31 +720,182 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<p><?php if(isset($sendSuccessMessage)){echo $sendSuccessMessage;} ?></p>
|
||||
<script>
|
||||
const copyButtons = document.querySelectorAll('.copy-btn');
|
||||
copyButtons.forEach(button => {
|
||||
button.addEventListener('click', event => {
|
||||
event.preventDefault();
|
||||
const inputId = button.getAttribute('data-input-id');
|
||||
const inputElement = document.getElementById(inputId);
|
||||
if (inputElement && inputElement.value) {
|
||||
navigator.clipboard.writeText(inputElement.value)
|
||||
.then(() => {
|
||||
button.classList.add('copied');
|
||||
setTimeout(() => {
|
||||
button.classList.remove('copied');
|
||||
}, 1000);
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('Unable to copy:', err);
|
||||
});
|
||||
function changeBvValue(){
|
||||
let verticalsDropDown = document.getElementById('businessVerticals');
|
||||
let bvValue = verticalsDropDown.value;
|
||||
|
||||
let atheneumWhatsAppData = [
|
||||
{templateName : "AG_Welcome",templateID : "ag_welcome",verticals : "atheneum"},
|
||||
{templateName : "AG_introduction", templateID : "ag_introduction_", verticals : "atheneum"},
|
||||
{templateName : "DNP", templateID : "ag_dnp", verticals : "atheneum"},
|
||||
{templateName : "MTT", templateID : "mtt_lead_comms", verticals : "atheneum"},
|
||||
{templateName : "SEN", templateID : "ag_sen", verticals : "atheneum"},
|
||||
{templateName : "PPTTC", templateID : "ag_pptc", verticals : "atheneum"},
|
||||
{templateName : "NTT", templateID : "ag_ntt", verticals : "atheneum"},
|
||||
{templateName : "CDA", templateID : "ag_cda", verticals : "atheneum"},
|
||||
{templateName : "TEFL", templateID : "ag_tefl", verticals : "atheneum"},
|
||||
{templateName : "TESOL LEVEL 7", templateID : "ag_tesol_level_7", verticals : "atheneum"},
|
||||
{templateName : "TESOL", templateID : "ag_tesol", verticals : "atheneum"},
|
||||
{templateName : "ECCE", templateID : "ag_ecce", verticals : "atheneum"},
|
||||
{templateName : "Education Administration & Management", templateID : "ag_educational_administration_and_management", verticals : "atheneum"},
|
||||
{templateName : "10% off", templateID : "ag_10_percent_off", verticals : "atheneum"},
|
||||
{templateName : " 15% off", templateID : "ag_15_percent_off", verticals : "atheneum"}
|
||||
];
|
||||
|
||||
let teenybeansWhatsAppData = [
|
||||
{templateName : "Introduction_TEENY Beans",templateID : "_introductionteeny_beans",verticals : "teenybeans"},
|
||||
{templateName : "TB_DNP", templateID : "tb_dnp", verticals : "teenybeans"},
|
||||
{templateName : "TB_UNO", templateID : "tb_uno", verticals : "teenybeans"},
|
||||
{templateName : "TB_PRIMERO", templateID : "tb_primero", verticals : "teenybeans"},
|
||||
{templateName : "TB_ILC", templateID : "tb_ilc", verticals : "teenybeans"},
|
||||
{templateName : "TB_COMPLETE Package", templateID : "tb_complete_package", verticals : "teenybeans"},
|
||||
{templateName : "Bespoke_Marketing solution", templateID : "bespoke_marketing_solution", verticals : "teenybeans"},
|
||||
{templateName : "Bespoke_Design solution", templateID : "Bespoke_Design solution", verticals : "teenybeans"},
|
||||
{templateName : "Bespoke_Academic solution", templateID : "bespoke_academic_solution", verticals : "teenybeans"}
|
||||
];
|
||||
let buzzappWhatsAppData = [
|
||||
{templateName : "Introduction",templateID : "crm_buzzapp_Introduction",verticals : "buzzapp"},
|
||||
{templateName : " Follow up", templateID : "buzzapp_crm_followup", verticals : "buzzapp"}
|
||||
];
|
||||
let iimttWhatsAppData = [
|
||||
{templateName : "B2B Introduction New",templateID : "iimtt_b2b_introduction_new",verticals : "iimtt"},
|
||||
{templateName : "B2B_Followup", templateID : "iimtt_b2b_followup_", verticals : "iimtt"},
|
||||
{templateName : "B2C Introduction New", templateID : "iimtt_b2c_introduction_new", verticals : "iimtt"},
|
||||
{templateName : "B2C Followup", templateID : "iimtt_b2c_followup_", verticals : "iimtt"}
|
||||
];
|
||||
let bipWhatsAppData = [
|
||||
{templateName : "Introduction",templateID : "crm_bip__introduction_",verticals : "bip"},
|
||||
{templateName : "School visit invitation", templateID : "crm_bip_school_visit_invitation_", verticals : "bip"}
|
||||
];
|
||||
|
||||
let atheneumData = [
|
||||
{templateName: "Welcome mail", templateID: "125", verticals: "atheneum"},
|
||||
{templateName: "Introduction mail", templateID: "126", verticals: "atheneum"},
|
||||
{templateName: "DNP", templateID: "127", verticals: "atheneum"},
|
||||
{templateName: "MTT", templateID: "128", verticals: "atheneum"},
|
||||
{templateName: "SEN", templateID: "140", verticals: "atheneum"},
|
||||
{templateName: "PPTTC", templateID: "129", verticals: "atheneum"},
|
||||
{templateName: "NTT", templateID: "142", verticals: "atheneum"},
|
||||
{templateName: "CDA", templateID: "130", verticals: "atheneum"},
|
||||
{templateName: "TEFL", templateID: "131", verticals: "atheneum"},
|
||||
{templateName: "TESOL LEVEL 7", templateID: "132", verticals: "atheneum"},
|
||||
{templateName: "TESOL", templateID: "134", verticals: "atheneum"},
|
||||
{templateName: "ECCE", templateID: "135", verticals: "atheneum"},
|
||||
{templateName: "Education administration & management", templateID: "136", verticals: "atheneum"},
|
||||
{templateName: "10% OFF", templateID: "137", verticals: "atheneum"},
|
||||
{templateName: "15% OFF", templateID: "138", verticals: "atheneum"}
|
||||
];
|
||||
let teenybeansData = [
|
||||
{templateName: "Introduction- Teeny Beans", templateID: "108", verticals: "teenybeans"},
|
||||
{templateName: "DNP", templateID: "", verticals: "teenybeans"},
|
||||
{templateName: "UNO", templateID: "109", verticals: "teenybeans"},
|
||||
{templateName: "PRIMERO", templateID: "110", verticals: "teenybeans"},
|
||||
{templateName: "ILC", templateID: "112", verticals: "teenybeans"},
|
||||
{templateName: "Complete Package", templateID: "113", verticals: "teenybeans"},
|
||||
{templateName: "Bespoke- Marketing solution", templateID: "116", verticals: "teenybeans"},
|
||||
{templateName: "Bespoke- Academic solution", templateID: "114", verticals: "teenybeans"}
|
||||
];
|
||||
let iimttData = [
|
||||
{templateName: "B2B- Introduction", templateID: "117", verticals: "iimtt"},
|
||||
{templateName: "B2B- Followup", templateID: "118", verticals: "iimtt"},
|
||||
{templateName: "B2C- Introduction", templateID: "119", verticals: "iimtt"},
|
||||
{templateName: "B2C-Followup", templateID: "120", verticals: "iimtt"},
|
||||
];
|
||||
let bipData = [
|
||||
{templateName: "Introduction", templateID: "121", verticals: "bip"},
|
||||
{templateName: "School visit invitation", templateID: "122", verticals: "bip"}
|
||||
];
|
||||
let buzzappData = [
|
||||
{templateName: "Introduction", templateID: "123", verticals: "buzzapp"},
|
||||
{templateName: "Follow up", templateID: "124", verticals: "buzzapp"}
|
||||
];
|
||||
|
||||
let templateWhatsappList = document.getElementById('templateWhatsappList');
|
||||
templateWhatsappList.innerHTML = ''; // Clear the previous list items
|
||||
|
||||
let templateList = document.getElementById('templateList');
|
||||
templateList.innerHTML = ''; // Clear the previous list items
|
||||
|
||||
let selectedData;
|
||||
let whatsAppSelectdeData;
|
||||
if (bvValue === 'atheneum') {
|
||||
selectedData = atheneumData;
|
||||
whatsAppSelectdeData = atheneumWhatsAppData;
|
||||
} else if (bvValue === 'teenybeans') {
|
||||
selectedData = teenybeansData;
|
||||
whatsAppSelectdeData = teenybeansWhatsAppData;
|
||||
} else if(bvValue === 'iimtt') {
|
||||
selectedData = iimttData;
|
||||
whatsAppSelectdeData = iimttWhatsAppData;
|
||||
} else if(bvValue === 'buzzapp') {
|
||||
selectedData = buzzappData;
|
||||
whatsAppSelectdeData = buzzappWhatsAppData;
|
||||
} else if(bvValue === 'bip') {
|
||||
selectedData = bipData;
|
||||
whatsAppSelectdeData = bipWhatsAppData;
|
||||
} else {
|
||||
selectedData = []; // No data for other selections, you can add more datasets as needed
|
||||
whatsAppSelectdeData = []; // 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 = `?id=<?php echo $getLeadID ?>&send-email-id=${data.templateID}`;
|
||||
templateList.appendChild(anchorLink);
|
||||
});
|
||||
whatsAppSelectdeData.forEach(data => {
|
||||
const anchorLink = document.createElement('a');
|
||||
anchorLink.text = data.templateName;
|
||||
anchorLink.href = `?id=<?php echo $getLeadID ?>&send-whatsapp-id=${data.templateID}`;
|
||||
templateWhatsappList.appendChild(anchorLink);
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const copyButtons = document.querySelectorAll('.copy-btn');
|
||||
|
||||
copyButtons.forEach(button => {
|
||||
button.addEventListener('click', event => {
|
||||
event.preventDefault();
|
||||
const inputId = button.getAttribute('data-input-id');
|
||||
const inputElement = document.getElementById(inputId);
|
||||
if (inputElement && inputElement.value) {
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(inputElement.value)
|
||||
.then(() => {
|
||||
button.classList.add('copied');
|
||||
setTimeout(() => {
|
||||
button.classList.remove('copied');
|
||||
inputElement.blur(); // Remove focus from input element
|
||||
}, 1000);
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('Unable to copy using clipboard API:', err);
|
||||
});
|
||||
} else {
|
||||
// Fallback method for older browsers
|
||||
inputElement.select();
|
||||
inputElement.setSelectionRange(0, inputElement.value.length); // For mobile devices
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
button.classList.add('copied');
|
||||
setTimeout(() => {
|
||||
button.classList.remove('copied');
|
||||
inputElement.blur(); // Remove focus from input element
|
||||
}, 1000);
|
||||
} catch (err) {
|
||||
console.error('Fallback: Unable to copy', err);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
// function fetchCountries() {
|
||||
// fetch('https://api.siliconpin.com/v3/list/country/')
|
||||
// .then(res => res.json())
|
||||
@@ -616,6 +943,41 @@ copyButtons.forEach(button => {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// function senWhatsapp() {
|
||||
// fetch('https://api.interakt.ai/v1/public/message/', {
|
||||
// method: 'POST',
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/json',
|
||||
// 'Authorization': 'Basic {{OTgyajd4bHFUSXItSW9PN1BTdzhOenNDaS0ya0NQeXByRE0tMnRyQ3FrUTo=}}'
|
||||
// },
|
||||
// body: JSON.stringify({
|
||||
// "countryCode": "+91",
|
||||
// "phoneNumber": "8343820536",
|
||||
// "callbackData": "some text here",
|
||||
// "type": "Template",
|
||||
// "template": {
|
||||
// "name": "boost_conversion",
|
||||
// "languageCode": "en",
|
||||
// "headerValues": [
|
||||
// "header_variable_value"
|
||||
// ],
|
||||
// "bodyValues": [
|
||||
// "body_variable_value_1"
|
||||
// ]
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// .then(response => response.json())
|
||||
// .then(data => {
|
||||
// console.log('Success:', data);
|
||||
// })
|
||||
// .catch((error) => {
|
||||
// console.error('Error:', error);
|
||||
// });
|
||||
// }
|
||||
|
||||
// fetchCountries();
|
||||
let nameID = document.getElementById('name');
|
||||
let addressID = document.getElementById('address');
|
||||
@@ -693,6 +1055,27 @@ copyButtons.forEach(button => {
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
#name::selection {
|
||||
background-color: transparent;
|
||||
}
|
||||
#name:focus, #email:focus, #phone:focus {
|
||||
/* outline: none; */
|
||||
}
|
||||
.flex-container-x2y {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 600px) {
|
||||
.flex-container-x2y {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 601px) {
|
||||
.flex-container-x2y {
|
||||
flex-direction: row;
|
||||
}
|
||||
}
|
||||
.add-appt-modal, .add-appt-edit-modal{
|
||||
background-color: #F8F8F8;
|
||||
display: none;
|
||||
@@ -737,7 +1120,7 @@ copyButtons.forEach(button => {
|
||||
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;
|
||||
|
||||
34
.hta_slug/followup.php
Normal file
34
.hta_slug/followup.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
require_once('.hta_config/crm_config.php');
|
||||
require_once('.htac_header.php');
|
||||
require_once('.htac_nav.php');
|
||||
?>
|
||||
<div class="flex flex-row place-content-between py-2" style="border-bottom: 2px solid #A0A2AB; border-style: dashed;">
|
||||
<p class="text-[25px] font-bold">Followup</p>
|
||||
</div>
|
||||
<?php
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$stmt = $conn->prepare("SELECT date, user, id, name FROM cleads WHERE date IS NOT NULL AND date >= CURRENT_DATE AND user = :user");
|
||||
$stmt->bindParam(':user', $_SESSION['email']);
|
||||
$stmt->execute();
|
||||
$users_rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$row_count = count($users_rows);
|
||||
if($row_count > 0){
|
||||
foreach($users_rows as $users_data){
|
||||
?>
|
||||
<div class="flex flex-col space-y-2 gap-2 mb-2 ">
|
||||
<a href="<?php echo '/edit-lead/?id='.$users_data['id']?>" class="flex flex-col w-full p-2 rounded-md shadow" style="border: 3px solid #F5F4FFE8;">
|
||||
<p>🕑 New Followup for <?php echo $users_data['name']; ?></p>
|
||||
<p><?php echo $users_data['date']; ?></p>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
// echo '<p>'.$users_data['id'] . $users_data['user'] . $users_data['date'].'<br> </p>';
|
||||
|
||||
}
|
||||
} else{
|
||||
echo '<p>No Followup Found</p>';
|
||||
}
|
||||
?>
|
||||
@@ -101,9 +101,10 @@
|
||||
$state = $_POST['state'];
|
||||
$city = $_POST['city'];
|
||||
$address = $_POST['address'];
|
||||
$business_type = $_POST['business_type'];
|
||||
$status = 'New';
|
||||
try {
|
||||
$stmt = $conn->prepare("INSERT INTO cleads (name, email, phone, formname, note, origin, status, gender, profession, country, state, city, address ) VALUES (:name, :email, :phone, :formname, :note, :origin, :status, :gender, :profession, :country, :state, :city, :address)");
|
||||
$stmt = $conn->prepare("INSERT INTO cleads (name, email, phone, formname, note, origin, status, gender, profession, country, state, city, address, business_type ) VALUES (:name, :email, :phone, :formname, :note, :origin, :status, :gender, :profession, :country, :state, :city, :address, :business_type)");
|
||||
$stmt->bindParam(':name', $name);
|
||||
$stmt->bindParam(':email', $email);
|
||||
$stmt->bindParam(':phone', $phone);
|
||||
@@ -117,6 +118,7 @@
|
||||
$stmt->bindParam(':state', $state);
|
||||
$stmt->bindParam(':city', $city);
|
||||
$stmt->bindParam(':address', $address);
|
||||
$stmt->bindParam(':business_type', $business_type);
|
||||
$stmt->execute();
|
||||
echo "Record added successfully";
|
||||
} catch(PDOException $e) {
|
||||
@@ -141,59 +143,65 @@
|
||||
}
|
||||
}
|
||||
?>
|
||||
<p class="text-[28px] font-bold p-4">Lead Management</p>
|
||||
<div id="page-body" class="flex flex-row place-content-between px-4">
|
||||
<dialog>
|
||||
<button style="float: right; color: #FF0000; font-size: 25px; padding: 6px;">✘</button>
|
||||
<div class="flex flex-row">
|
||||
<div class="flex flex-col p-6 space-y-4">
|
||||
<a href="/leads?start_date=<?php echo $today_date ?>&end_date=<?php echo $next_day ?>">Today</a>
|
||||
<a href="/leads?start_date=<?php echo $yesterday ?>&end_date=<?php echo $today_date ?>">Yesterday</a>
|
||||
<a href="/leads?start_date=<?php echo $this_week ?>&end_date=<?php echo $today_date ?>">This Week</a>
|
||||
<a href="/leads?start_date=<?php echo $firstDayOfCurrentMonth ?>&end_date=<?php echo $today_date ?>">This Month</a>
|
||||
<a href="/leads?start_date=<?php echo $prev_month_date ?>&end_date=<?php echo $today_date ?>">Last Month</a>
|
||||
<a href="/leads?start_date=<?php echo $firstDateOfYear ?>&end_date=<?php echo $today_date ?>">This Year</a>
|
||||
<a href="/leads?start_date=<?php echo $firstDateOfPreviousYear ?>&end_date=<?php echo $today_date ?>">Last Year</a>
|
||||
<a href="/leads">All Time</a>
|
||||
<!-- <p class="text-[28px] font-bold p-4">Lead Management</p> -->
|
||||
|
||||
<dialog id="d" class="rounded-lg">
|
||||
<form class="text-2xl text-[#464E5F] border-[3px] m-2 border-[#464E5F] duration-700 rounded-full px-2 float-right" method="dialog" class=""><button class="">✘</button></form>
|
||||
<div class="flex flex-row ">
|
||||
<div class="flex flex-col p-4 space-y-4 border-r-[1px] border-[#464E5F]">
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $today_date ?>&end_date=<?php echo $next_day ?>">Today</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $yesterday ?>&end_date=<?php echo $today_date ?>">Yesterday</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $this_week ?>&end_date=<?php echo $today_date ?>">This Week</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $firstDayOfCurrentMonth ?>&end_date=<?php echo $today_date ?>">This Month</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $prev_month_date ?>&end_date=<?php echo $today_date ?>">Last Month</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $firstDateOfYear ?>&end_date=<?php echo $today_date ?>">This Year</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $firstDateOfPreviousYear ?>&end_date=<?php echo $today_date ?>">Last Year</a>
|
||||
<a class="whitespace-nowrap" href="/leads">All Time</a>
|
||||
</div>
|
||||
<form method="GET" class="p-6 flex flex-col pb-10">
|
||||
<p>Choose Date for filter</p>
|
||||
<p class="font-bold">Choose Date for filter</p>
|
||||
<input type="hidden" name="bv" value="<?php echo isset($_GET['bv']) ? htmlspecialchars($_GET['bv']) : ''; ?>">
|
||||
<div class="flex flex-row rounded-xl py-10">
|
||||
<div class="flex flex-row place-items-center">
|
||||
<label for="start_date">From Date</label>
|
||||
<input type="date" name="start_date" id="start_date" />
|
||||
</div> |
|
||||
<div class="flex flex-row place-items-center">
|
||||
<label for="end_date">To Date</label>
|
||||
<input type="date" name="end_date" id="end_date" />
|
||||
<div class="flex flex-row place-items-center border-2 border-[#464E5F] rounded-md">
|
||||
<label class="whitespace-nowrap" for="start_date">From Date</label>
|
||||
<input class="focus:outline-none" type="date" name="start_date" id="start_date" />
|
||||
</div> |
|
||||
<div class="flex flex-row place-items-center border-2 border-[#464E5F] rounded-md">
|
||||
<label class="whitespace-nowrap" for="end_date">To Date</label>
|
||||
<input class="focus:outline-none" type="date" name="end_date" id="end_date" />
|
||||
</div>
|
||||
</div>
|
||||
<button class="rounded-lg p-1 text-[#fff]" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); text-align: center;" type="submit"><p class="text-center p-1.5">Search</p></button>
|
||||
</form>
|
||||
</div>
|
||||
</dialog>
|
||||
<button class="rounded-lg p-2 h-fit bg-[#fff] text-[#464E5F] shadow-lg" style="">Select Date</button>
|
||||
<div class="flex flex-row">
|
||||
<form method="GET" action="" class="bg-[#fff] flex flex-row place-items-center">
|
||||
<input class="p-2.5 rounded-l-lg focus:outline-none w-[320px]" type="text" name="search" placeholder="Name, lead ID, Mobile, Email..." style="border: 2px solid #8E8E8E;">
|
||||
<button class="rounded-r-lg text-[#fff] p-1.5" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%);" type="submit"><i class="fa fa-search"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
<!-- <button class="" style="">Select Date</button> -->
|
||||
<div id="" class="flex flex-row place-content-between w-full py-4 gap-x-2">
|
||||
<button onclick="d.showModal()" class="rounded-lg pl-2 h-fit bg-[#fff] text-[#464E5F] shadow-lg flex flex-row justify-center place-items-center">Select Date<span class="fa fa-calendar-o -ml-[17px] pt-1.5"></span></button>
|
||||
<button onclick="downloadCSV(data, filename)" class="text-[#fff] rounded-lg h-fit inline-flex justify-center place-items-center p-2" style="background: linear-gradient(90deg, rgba(70, 68, 142, 0.91) 0%, rgba(120, 117, 244, 0.91) 100%);">Download csv</button>
|
||||
<div class="flex flex-row">
|
||||
<form method="GET" class="bg-[#fff] flex flex-row place-items-center">
|
||||
<!-- Existing search parameters -->
|
||||
<input type="hidden" name="bv" value="<?php echo isset($_GET['bv']) ? htmlspecialchars($_GET['bv']) : ''; ?>">
|
||||
|
||||
<input class="p-2.5 rounded-l-lg focus:outline-none w-[170px] md:w-[320px]" type="text" name="search" placeholder="Name, lead ID, Mobile, Email, Status..." style="border: 2px solid #8E8E8E;">
|
||||
<button class="rounded-r-lg text-[#fff] p-1.5" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%);" type="submit"><i class="fa fa-search"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
if(isset($_SESSION['user_type']) && $_SESSION['user_type'] == 'admin'){
|
||||
echo '<p onclick="deleteCofermation();" class="rounded-lg h-fit py-2 px-6 text-[#fff] text-center" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); cursor: pointer;">Delete</p>';
|
||||
}
|
||||
?>
|
||||
<button onclick="toggleDisplay();" class="rounded-lg p-2 h-fit text-[#fff]" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); text-align: center;">Add Leads</button>
|
||||
</div>
|
||||
|
||||
<form method="post">
|
||||
<table class="bg-[#fff] text-[#3F4254] rounded-lg font-bold" style="width: 100%;" >
|
||||
<thead>
|
||||
<button onclick="toggleDisplay();" class="rounded-lg px-2 h-fit text-[#fff] flex flex-row justify-center place-items-center" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); text-align: center;"><span style="font-size: 30px; font-weight: bold">+</span><span>Add Leads</span></button>
|
||||
</div>
|
||||
<form method="post" class="table-container">
|
||||
<table class="bg-[#fff] text-[#3F4254] rounded-lg font-bold min-w-full leading-normal" style="" >
|
||||
<thead class="fixed-header">
|
||||
<tr>
|
||||
<?php
|
||||
if(isset($_SESSION['user_type']) && $_SESSION['user_type'] == 'admin')
|
||||
echo ' <th class="text-center border-b-2 p-3">
|
||||
echo ' <th class=" border-b-2 p-3">
|
||||
<div class="delete-confirm" id="delete-button" style="display: none;">
|
||||
<p>Are you sure you want to delete this lead?</p>
|
||||
<div class="flex flex-row space-x-4">
|
||||
@@ -203,13 +211,15 @@
|
||||
</div>
|
||||
</th>';
|
||||
?>
|
||||
<th class="text-center border-b-2 p-3">Quick Action</th>
|
||||
<th class="text-center border-b-2 p-3">Name</th>
|
||||
<th class="text-center border-b-2 p-3">ID</th>
|
||||
<th class="text-center border-b-2 p-3">Status Update</th>
|
||||
<!-- <th class="text-center border-b-2 p-3">Contact Detail</th> -->
|
||||
<th class="text-center border-b-2 p-3">Form Name</th>
|
||||
<th class="text-center border-b-2 p-3">Date</th>
|
||||
<th class="border-b-2 p-3 text-left">Date</th>
|
||||
<th class="border-b-2 p-3 text-left">Name</th>
|
||||
<th class="border-b-2 p-3 text-left">Phone</th>
|
||||
<th class="border-b-2 p-3 text-left">Country / State</th>
|
||||
<th class="border-b-2 p-3 text-left">ID</th>
|
||||
<th class="border-b-2 p-3 text-left">Status</th>
|
||||
<th class="border-b-2 p-3 text-left">Form Name</th>
|
||||
<th class="border-b-2 p-3">Assigned to</th>
|
||||
<th class="border-b-2 p-3">Lead Quality</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody >
|
||||
@@ -218,11 +228,15 @@
|
||||
try {
|
||||
$searchTerm =isset($_GET['search']) ? $_GET['search'] : "%";
|
||||
$businessVertical =isset($_GET['bv']) ? $_GET['bv'] : "%";
|
||||
$dateForFilter = date('Y-m-d');
|
||||
|
||||
// Add one day to the current date
|
||||
$new_date = date('Y-m-d', strtotime($dateForFilter . ' +1 day'));
|
||||
// echo $businessVertical;
|
||||
$start_date = isset($_GET['start_date']) ? $_GET['start_date'] : '2014-05-05';
|
||||
$end_date = isset($_GET['end_date']) ? $_GET['end_date'] : date('Y-m-d');
|
||||
$end_date = isset($_GET['end_date']) ? $_GET['end_date'] : $new_date;
|
||||
$start_time = microtime(true);
|
||||
$resultsPerPage = 100;
|
||||
$resultsPerPage = 200;
|
||||
$page =isset($_GET['page']) ? $_GET['page'] : 1;
|
||||
$offset = ($page - 1) * $resultsPerPage ;
|
||||
$accessArray = explode(",", $_SESSION['access']);
|
||||
@@ -232,7 +246,7 @@
|
||||
//first query to get the total number for pagination
|
||||
$sql= "SELECT COUNT(*) FROM cleads WHERE business_type LIKE :businessVertical AND (name LIKE :searchTerm OR phone LIKE :searchTerm OR id LIKE :searchTerm OR email LIKE :searchTerm ) AND time BETWEEN :start_date AND :end_date ";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bindValue(':businessVertical', $businessVertical);
|
||||
$stmt->bindValue(':businessVertical', "%".$businessVertical."%");
|
||||
$stmt->bindValue(':searchTerm', "%".$searchTerm."%");
|
||||
$stmt->bindValue(':start_date', $start_date);
|
||||
$stmt->bindValue(':end_date', $end_date);
|
||||
@@ -241,10 +255,10 @@
|
||||
|
||||
// second & final query to get the page_view data
|
||||
|
||||
$sql = "SELECT * FROM cleads WHERE business_type LIKE :businessVertical AND (name LIKE :searchTerm OR phone LIKE :searchTerm OR id LIKE :searchTerm OR email LIKE :searchTerm ) AND time BETWEEN :start_date AND :end_date ORDER BY id DESC LIMIT :limit OFFSET :offset";
|
||||
$sql = "SELECT * FROM cleads WHERE business_type LIKE :businessVertical AND (name LIKE :searchTerm OR phone LIKE :searchTerm OR id LIKE :searchTerm OR email LIKE :searchTerm OR status LIKE :searchTerm ) AND time BETWEEN :start_date AND :end_date ORDER BY id DESC LIMIT :limit OFFSET :offset";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bindValue(':businessVertical', $businessVertical, PDO::PARAM_STR );
|
||||
$stmt->bindValue(':searchTerm', "%$searchTerm%"); // PDO::PARAM_STR is the default data type binding so is not needed
|
||||
$stmt->bindValue(':businessVertical', "%".$businessVertical."%");
|
||||
$stmt->bindValue(':searchTerm', "%$searchTerm%");
|
||||
$stmt->bindValue(':start_date', $start_date);
|
||||
$stmt->bindValue(':end_date', $end_date);
|
||||
$stmt->bindValue(':limit', $resultsPerPage, PDO::PARAM_INT);
|
||||
@@ -253,90 +267,55 @@
|
||||
$leads = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$totalResults = count($leads);
|
||||
$totalPages = ceil($totalRows / $resultsPerPage);
|
||||
if($resultsPerPage <= $totalRows) echo "<p class='px-4'>".$resultsPerPage." Out of ".$totalRows." Leads </p>";
|
||||
else echo "<p class='px-4'>".$totalRows." Leads </p>";
|
||||
|
||||
$end_time = microtime(true);
|
||||
$execution_time = ($end_time - $start_time);
|
||||
$executionTime = substr($execution_time, 0, 6);
|
||||
// if($resultsPerPage <= $totalRows) echo "<p class='px-4'>".$resultsPerPage." Out of ".$totalRows." Leads in ".$executionTime." Seconds</p>";
|
||||
// else echo "<p class='px-4'>".$totalRows." Leads </p>";
|
||||
// Status Conditional Color
|
||||
foreach($leads as $lead){
|
||||
$only_date =isset($lead['time']) ? substr($lead['time'], 0, 10): 'Not Available';
|
||||
$lead_id = $lead['id'];
|
||||
if($lead['status'] == 'New'){$conditional_background_color = 'background-color: #FFD9D9; border: 2px solid #FB5555; border-radius: 20px; text-align: center; color: #FB5555;';}
|
||||
elseif($lead['status'] == 'Contacted'){$conditional_background_color = 'background-color: #D4FFFF; border: 2px solid #2C9C9C; border-radius: 20px; text-align: center; color: #2C9C9C;';}
|
||||
elseif($lead['status'] == 'Disqualified'){$conditional_background_color = 'background-color: #CECECE; border: 2px solid #3F4254; border-radius: 20px; text-align: center; color: #3F4254;';}
|
||||
elseif($lead['status'] == 'Converted'){$conditional_background_color = 'background-color: #D4FDE7; border: 2px solid #40916C; border-radius: 20px; text-align: center; color: #40916C;';}
|
||||
elseif($lead['status'] == 'Warm'){$conditional_background_color = 'background-color: #FFD9D9; border: 2px solid #FB5555; border-radius: 20px; text-align: center; color: #FB5555;';}
|
||||
|
||||
$leadCountry = strlen($lead['country']) > 0 ? $lead['country'] . ($lead['state'] > 0 ? '/' : ' ') : ' ';
|
||||
|
||||
if($lead['status'] == 'New'){$conditional_background_color = 'background-color: #D4FFFF; border: 1px solid #2C9C9C; border-radius: 5px; color: #2C9C9C; border-radius: 20px; text-align: center;';}
|
||||
elseif($lead['status'] == 'Contacted'){$conditional_background_color = 'background-color: #D0E9FF; border: 1px solid #1A91FF; border-radius: 5px; color: #1A91FF; border-radius: 20px; text-align: center;';}
|
||||
elseif($lead['status'] == 'Disqualified'){$conditional_background_color = 'background-color: #CECECE; border: 1px solid #3F4254; border-radius: 5px; color: #3F4254; border-radius: 20px; text-align: center;';}
|
||||
elseif($lead['status'] == 'Converted'){$conditional_background_color = 'background-color: #D4FDE7; border: 1px solid #40916C; border-radius: 5px; color: #40916C; border-radius: 20px; text-align: center;';}
|
||||
elseif($lead['status'] == 'Warm'){$conditional_background_color = 'background-color: #FFD9D9; border: 1px solid #FB5555; border-radius: 5px; color: #FB5555; border-radius: 20px; text-align: center;';}
|
||||
elseif($lead['status'] == 'Inactive'){$conditional_background_color = 'background-color: #FFD9D9; border: 1px solid #FB5555; border-radius: 5px; color: #FB5555; border-radius: 20px; text-align: center;';}
|
||||
// if status = warm then select
|
||||
// if($row['status'] == 'Warm'){$conditional_status = '<div class="flex flex-row"><p>'.$row['status'].'</p><select class="focus: outline-none " style="'.$conditional_background_color.' border: none;"><option>Option 1</option><option>Option 2</option></select></div>';}elseif($row['status'] != 'Warm'){$conditional_status = $row['status'];}
|
||||
?>
|
||||
<tr>
|
||||
<td class="border-y-2 p-2">
|
||||
<div class="flex flex-row justify-center place-items-center">
|
||||
<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="#">UNO</a>
|
||||
<a href="#">Primero</a>
|
||||
<div class="xzmdropdown-item">
|
||||
<a href="#">ILC</a>
|
||||
<a href="#">Complete package</a>
|
||||
<a href="#" class="bespoke-trigger">Bespoke</a>
|
||||
<div class="xzmdropdown-submenu">
|
||||
<a href="#">Academic</a>
|
||||
<a href="#">Buzzapp</a>
|
||||
<a href="#">Design Solution</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="xzmdropdown-wrapper">
|
||||
<button class="xzmdropdown-btn"><i class="fab fa-whatsapp" style="font-size: 20px"></i></button>
|
||||
<div class="xzmdropdown-content">
|
||||
<a href="#">UNO</a>
|
||||
<a href="#">Primero</a>
|
||||
<div class="xzmdropdown-item">
|
||||
<a href="#">ILC</a>
|
||||
<a href="#">Complete package</a>
|
||||
<a href="#" class="bespoke-trigger">Bespoke</a>
|
||||
<div class="xzmdropdown-submenu">
|
||||
<a href="#">Academic</a>
|
||||
<a href="#">Buzzapp</a>
|
||||
<a href="#">Design Solution</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php if(isset($_SESSION['user_type']) && $_SESSION['user_type'] == 'admin'){?>
|
||||
<td class="border-y-2 p-2">
|
||||
<input type="checkbox" name="selected_records[]" value="<?php echo $lead['id']; ?>" id="<?php echo $lead['id']; ?>" />
|
||||
</td>
|
||||
<?php }?>
|
||||
<td class="border-y-2 p-2"><label for="<?php echo $lead['id']; ?>"><?php echo $lead['name'] ?></label></td>
|
||||
<td class="border-y-2 p-2 text-blue-500 hover:text-blue-700 hover:underline"><a href="/edit-lead/?id=<?php echo $lead['id'] ?>"><?php echo $lead['id'] ?></a></td>
|
||||
<td class="border-y-2 p-2"><div style="<?php echo $conditional_background_color; ?> font-weight: bold;"><?php echo $lead['status'];?></div></td>
|
||||
<td class="whitespace-nowrap border-y-2 p-2"><?php echo $only_date; ?></td>
|
||||
<td class="whitespace-nowrap border-y-2 p-2"><label for="<?php echo $lead['id']; ?>"><?php echo $lead['name'] ?></label></td>
|
||||
<td class="whitespace-nowrap border-y-2 p-2"><?php echo $lead['phone']; ?></td>
|
||||
<td class="whitespace-nowrap border-y-2 p-2"><?php echo $leadCountry.$lead['state']; ?></td>
|
||||
<td class="whitespace-nowrap border-y-2 p-2 text-blue-500 hover:text-blue-700 hover:underline"><a href="/edit-lead/?id=<?php echo $lead['id'] ?>"><?php echo $lead['id'] ?></a></td>
|
||||
<td class="whitespace-nowrap border-y-2 p-2"><div style="<?php echo $conditional_background_color; ?> font-weight: bold;"><?php echo $lead['status'];?></div></td>
|
||||
<!-- <td class="border-y-2 p-2">
|
||||
<p><i class="fa fa-envelope"> <?php // echo $lead['email'] ?></i></p>
|
||||
<p><i class="fa fa-phone"> <?php // echo $lead['phone'] ?></i></p>
|
||||
</td> -->
|
||||
<td class="border-y-2 p-2"><?php echo $lead['formname'] ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $only_date; ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $lead['user'] ?></td>
|
||||
<td class="border-y-2 p-2 text-center"><?php echo $lead['lead_quality'] ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
|
||||
$end_time = microtime(true);
|
||||
|
||||
// Calculate execution time
|
||||
$execution_time = ($end_time - $start_time);
|
||||
|
||||
// Output execution time
|
||||
echo "Page executed in: " . $execution_time . " seconds";
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -344,15 +323,15 @@
|
||||
<!-- Pagination Links -->
|
||||
|
||||
<?php
|
||||
|
||||
$getParams = $_GET; unset($getParams['page']); $getParams['page'] = $page-1; $backPage= http_build_query($getParams); unset($getParams['page']);
|
||||
$getParams['page'] = $page+1; $nextkPage= http_build_query($getParams);
|
||||
|
||||
// echo $totalPages;
|
||||
echo'<div class="flex flex-row justify-end">
|
||||
echo'<div class="flex flex-row justify-between">
|
||||
<div class="flex flex-row justify-end">
|
||||
<button class="px-4 py-2 text-[#443780] border border-[#443780] rounded-l-lg" > '; if($page>1) echo '<a href="?',$backPage,'"><','</a>'; echo ' </button>
|
||||
<button class="px-4 py-2 text-white border-y border-[#443780]" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%);"> '.$page.' </button>
|
||||
<button class="px-4 py-2 text-[#443780] border border-[#443780] rounded-r-lg" > '; if($page<$totalPages) echo '<a href="?',$nextkPage,'">>','</a>'; echo ' </button>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
?>
|
||||
@@ -415,7 +394,7 @@ echo'<div class="flex flex-row justify-end">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2">
|
||||
<div class="flex flex-col mr-4">
|
||||
<label for="origin">Origin:</label>
|
||||
<select class="" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" type="text" name="origin" id="origin" >
|
||||
<select class="" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" name="origin" id="origin" >
|
||||
<option value="Facebook Ads">Facebook Ads</option>
|
||||
<option value="Google Ads">Google Ads</option>
|
||||
<option value="Linkedin Ads">Linkedin Ads</option>
|
||||
@@ -429,6 +408,34 @@ echo'<div class="flex flex-row justify-end">
|
||||
<option value="Others">Others</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex flex-col mr-4">
|
||||
<label for="business_type">Verticals:</label>
|
||||
<select id="business_type" name="business_type" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px; width: 100%;">
|
||||
<option value="0">-Select-</option>
|
||||
<?php
|
||||
try {
|
||||
// Database connection
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
// Prepare and execute query
|
||||
$stmt = $conn->prepare("SELECT * FROM business_verticals");
|
||||
$stmt->execute();
|
||||
$businessRows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
// Assuming this array contains the selected business verticals
|
||||
$selectedBusinessVerticals = [$businessVerticals['bv']];
|
||||
|
||||
// Loop through the business verticals
|
||||
foreach($businessRows as $businessVerticals) {
|
||||
echo '<option value="'.$businessVerticals['bv'].'">'.$businessVerticals['bv'].'</option>';
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col mr-4">
|
||||
<label for="note">Note:</label>
|
||||
@@ -439,6 +446,33 @@ echo'<div class="flex flex-row justify-end">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
$leadsWithComments = [];
|
||||
|
||||
foreach ($leads as $singleLead) {
|
||||
try {
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$stmt = $conn->prepare("SELECT * FROM comments WHERE leadid = :leadid ORDER BY created_at DESC");
|
||||
$stmt->bindParam(':leadid', $singleLead['id']);
|
||||
$stmt->execute();
|
||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$comments = [];
|
||||
foreach ($rows as $row) {
|
||||
$comments[] = $row['comments'];
|
||||
}
|
||||
$singleLead['comments'] = $comments;
|
||||
|
||||
$leadsWithComments[] = $singleLead;
|
||||
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
}
|
||||
|
||||
// Now $leadsWithComments contains all leads with their respective comments
|
||||
|
||||
?>
|
||||
<script>
|
||||
// Function to fetch countries and populate the country dropdown
|
||||
function fetchCountries() {
|
||||
@@ -459,17 +493,17 @@ echo'<div class="flex flex-row justify-end">
|
||||
function fetchStates() {
|
||||
const selectedCountry = document.getElementById('country').value;
|
||||
fetch(`https://api.siliconpin.com/v3/list/country/state/?country=${selectedCountry}`)
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
const stateDropdown = document.getElementById('state');
|
||||
stateDropdown.innerHTML = '<option value="">Select State</option>';
|
||||
data.forEach(state => {
|
||||
const option = document.createElement('option');
|
||||
option.value = state.iso2;
|
||||
option.text = state.name;
|
||||
stateDropdown.appendChild(option);
|
||||
});
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
const stateDropdown = document.getElementById('state');
|
||||
stateDropdown.innerHTML = '<option value="">Select State</option>';
|
||||
data.forEach(state => {
|
||||
const option = document.createElement('option');
|
||||
option.value = state.iso2;
|
||||
option.text = state.name;
|
||||
stateDropdown.appendChild(option);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Function to fetch cities based on selected country and state and populate the city dropdown
|
||||
@@ -489,23 +523,8 @@ echo'<div class="flex flex-row justify-end">
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Fetch countries on page load
|
||||
fetchCountries();
|
||||
|
||||
const dialog = document.querySelector("dialog");
|
||||
const showButton = document.querySelector("dialog + button");
|
||||
const closeButton = document.querySelector("dialog button");
|
||||
|
||||
// "Show the dialog" button opens the dialog modally
|
||||
showButton.addEventListener("click", () => {
|
||||
dialog.showModal();
|
||||
});
|
||||
|
||||
// "Close" button closes the dialog
|
||||
closeButton.addEventListener("click", () => {
|
||||
dialog.close();
|
||||
});
|
||||
|
||||
function toggleDisplay() {
|
||||
var element = document.getElementById('add-lead-form');
|
||||
@@ -538,9 +557,79 @@ echo'<div class="flex flex-row justify-end">
|
||||
}
|
||||
}
|
||||
}
|
||||
const data = <?php echo json_encode($leadsWithComments); ?>;
|
||||
const filename = `leads_data.csv`;
|
||||
|
||||
function downloadCSV(data, filename) {
|
||||
const csv = convertToCSV(data);
|
||||
const blob = new Blob([csv], { type: 'text/csv' });
|
||||
const link = document.createElement('a');
|
||||
link.href = URL.createObjectURL(blob);
|
||||
link.download = filename;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
|
||||
function convertToCSV(data) {
|
||||
const csvRows = [];
|
||||
const headers = Object.keys(data[0]);
|
||||
csvRows.push(headers.join(','));
|
||||
data.forEach(row => {
|
||||
const values = headers.map(header => {
|
||||
const escaped = ('' + row[header]).replace(/"/g, '\\"');
|
||||
return `"${escaped}"`;
|
||||
});
|
||||
csvRows.push(values.join(','));
|
||||
});
|
||||
|
||||
return csvRows.join('\n');
|
||||
|
||||
// downloadCSV(data, filename);
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
position: relative;
|
||||
height: 100vh;
|
||||
overflow-y: scroll;
|
||||
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
||||
scrollbar-width: none; /* Firefox */
|
||||
}
|
||||
|
||||
.table-container::-webkit-scrollbar {
|
||||
display: none; /* Safari and Chrome */
|
||||
}
|
||||
|
||||
/* Fixed header */
|
||||
.fixed-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background-color: white; /* Change this to match your table header background color */
|
||||
z-index: 996; /* Ensure it stays above table content */
|
||||
}
|
||||
|
||||
/* Ensure the fixed header matches the table headers */
|
||||
.fixed-header th {
|
||||
background-color: inherit; /* Maintain background color */
|
||||
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.4); /* Optional: Add a shadow for better visibility */
|
||||
}
|
||||
|
||||
/* Optional: Style table for better visibility */
|
||||
.table-container table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
|
||||
.add-lead-form {
|
||||
background-color: #F8F8F8;
|
||||
display: none;
|
||||
|
||||
606
.hta_slug/leads_all.php
Normal file
606
.hta_slug/leads_all.php
Normal file
@@ -0,0 +1,606 @@
|
||||
<style>
|
||||
.xzmdropdown-wrapper {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
font-size: 15px;
|
||||
|
||||
}
|
||||
|
||||
.xzmdropdown-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #EAEAEA;
|
||||
min-width: 120px;
|
||||
width: 160px;
|
||||
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
|
||||
z-index: 1;
|
||||
border: 1px solid #939393;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.xzmdropdown-content a {
|
||||
color: black;
|
||||
padding: 8px 8px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.xzmdropdown-content a:hover {
|
||||
background-color: #B2B0FF;
|
||||
}
|
||||
|
||||
.xzmdropdown-wrapper:hover .xzmdropdown-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.xzmdropdown-item {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.xzmdropdown-submenu {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 100%;
|
||||
display: none;
|
||||
background-color: #EAEAEA;
|
||||
margin-top: 65px;
|
||||
min-width: 120px;
|
||||
width: 150px;
|
||||
border: 1px solid #939393;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.xzmdropdown-submenu:hover {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.bespoke-trigger:hover + .xzmdropdown-submenu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.xzmdropdown-submenu a {
|
||||
padding: 8px 8px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.xzmdropdown-submenu a:hover {
|
||||
background-color: #c0c0c0;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
require_once('.hta_config/crm_config.php');
|
||||
require_once('.htac_header.php');
|
||||
require_once('.htac_nav.php');
|
||||
// deleteCofermation()
|
||||
$today_date = date("Y-m-d");
|
||||
$next_day = date("Y-m-d", strtotime("+1 day"));
|
||||
$yesterday = date("Y-m-d", strtotime("-1 day"));
|
||||
$this_week = date("Y-m-d", strtotime("-7 day"));
|
||||
$prev_month_date = date("Y-m-d", strtotime("first day of previous month", strtotime($today_date)));
|
||||
$firstDayOfCurrentMonth = date("Y-m-01");
|
||||
$firstDayOfLastMonth = date("Y-m-01", strtotime("first day of last month"));
|
||||
$firstDateOfYear = date("Y") . '-01-01';
|
||||
$previousYear = date("Y") - 1;
|
||||
$firstDateOfPreviousYear = $previousYear . '-01-01';
|
||||
try {
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch(PDOException $e) {
|
||||
echo "Connection failed: " . $e->getMessage();
|
||||
}
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['new_lead']) && isset($_POST['name']) && isset($_POST['phone']) ) {
|
||||
$name = $_POST['name'];
|
||||
$email = $_POST['email'];
|
||||
$phone = $_POST['phone'];
|
||||
$formname = 'crm-portal';
|
||||
$note = $_POST['note'];
|
||||
$origin = $_POST['origin'];
|
||||
$gender = $_POST['gender'];
|
||||
$profession = $_POST['profession'];
|
||||
$country = $_POST['country'];
|
||||
$state = $_POST['state'];
|
||||
$city = $_POST['city'];
|
||||
$address = $_POST['address'];
|
||||
$status = 'New';
|
||||
try {
|
||||
$stmt = $conn->prepare("INSERT INTO cleads (name, email, phone, formname, note, origin, status, gender, profession, country, state, city, address ) VALUES (:name, :email, :phone, :formname, :note, :origin, :status, :gender, :profession, :country, :state, :city, :address)");
|
||||
$stmt->bindParam(':name', $name);
|
||||
$stmt->bindParam(':email', $email);
|
||||
$stmt->bindParam(':phone', $phone);
|
||||
$stmt->bindParam(':formname', $formname);
|
||||
$stmt->bindParam(':note', $note);
|
||||
$stmt->bindParam(':origin', $origin);
|
||||
$stmt->bindParam(':status', $status);
|
||||
$stmt->bindParam(':gender', $gender);
|
||||
$stmt->bindParam(':profession', $profession);
|
||||
$stmt->bindParam(':country', $country);
|
||||
$stmt->bindParam(':state', $state);
|
||||
$stmt->bindParam(':city', $city);
|
||||
$stmt->bindParam(':address', $address);
|
||||
$stmt->execute();
|
||||
echo "Record added successfully";
|
||||
} catch(PDOException $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if(isset($_POST['delete_records']) && isset($_SESSION['user_type']) && $_SESSION['user_type'] == 'admin') {
|
||||
if(isset($_POST['selected_records']) && !empty($_POST['selected_records'])) {
|
||||
$selectedIds = $_POST['selected_records'];
|
||||
try {
|
||||
$delete_placeholders = rtrim(str_repeat('?,', count($selectedIds)), ',');
|
||||
$stmt = $conn->prepare("DELETE FROM cleads WHERE id IN ($delete_placeholders)");
|
||||
foreach($selectedIds as $key => $id) {
|
||||
$stmt->bindValue($key + 1, $id, PDO::PARAM_INT);
|
||||
}
|
||||
$stmt->execute();
|
||||
} catch(PDOException $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!-- <p class="text-[28px] font-bold p-4">Lead Management</p> -->
|
||||
|
||||
<dialog id="d" class="rounded-lg">
|
||||
<form class="text-2xl text-[#464E5F] border-[3px] m-2 border-[#464E5F] duration-700 rounded-full px-2 float-right" method="dialog" class=""><button class="">✘</button></form>
|
||||
<div class="flex flex-row ">
|
||||
<div class="flex flex-col p-4 space-y-4 border-r-[1px] border-[#464E5F]">
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $today_date ?>&end_date=<?php echo $next_day ?>">Today</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $yesterday ?>&end_date=<?php echo $today_date ?>">Yesterday</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $this_week ?>&end_date=<?php echo $today_date ?>">This Week</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $firstDayOfCurrentMonth ?>&end_date=<?php echo $today_date ?>">This Month</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $prev_month_date ?>&end_date=<?php echo $today_date ?>">Last Month</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $firstDateOfYear ?>&end_date=<?php echo $today_date ?>">This Year</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $firstDateOfPreviousYear ?>&end_date=<?php echo $today_date ?>">Last Year</a>
|
||||
<a class="whitespace-nowrap" href="/leads">All Time</a>
|
||||
</div>
|
||||
<form method="GET" class="p-6 flex flex-col pb-10">
|
||||
<p class="font-bold">Choose Date for filter</p>
|
||||
<div class="flex flex-row rounded-xl py-10">
|
||||
<div class="flex flex-row place-items-center border-2 border-[#464E5F] rounded-md">
|
||||
<label class="whitespace-nowrap" for="start_date">From Date</label>
|
||||
<input class="focus:outline-none" type="date" name="start_date" id="start_date" />
|
||||
</div> |
|
||||
<div class="flex flex-row place-items-center border-2 border-[#464E5F] rounded-md">
|
||||
<label class="whitespace-nowrap" for="end_date">To Date</label>
|
||||
<input class="focus:outline-none" type="date" name="end_date" id="end_date" />
|
||||
</div>
|
||||
</div>
|
||||
<button class="rounded-lg p-1 text-[#fff]" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); text-align: center;" type="submit"><p class="text-center p-1.5">Search</p></button>
|
||||
</form>
|
||||
</div>
|
||||
</dialog>
|
||||
<!-- <button class="" style="">Select Date</button> -->
|
||||
<div id="" class="flex flex-row place-content-between w-full py-4 gap-x-2">
|
||||
<button onclick="d.showModal()" class="rounded-lg pl-2 h-fit bg-[#fff] text-[#464E5F] shadow-lg flex flex-row justify-center place-items-center">Select Date<span class="fa fa-calendar-o -ml-[17px] pt-1.5"></span></button>
|
||||
<button onclick="downloadCSV(data, filename)" class="text-[#fff] rounded-lg h-fit inline-flex justify-center place-items-center p-2" style="background: linear-gradient(90deg, rgba(70, 68, 142, 0.91) 0%, rgba(120, 117, 244, 0.91) 100%);">Download csv</button>
|
||||
<div class="flex flex-row">
|
||||
<form method="GET" action="" class="bg-[#fff] flex flex-row place-items-center">
|
||||
<input class="p-2.5 rounded-l-lg focus:outline-none w-[170px] md:w-[320px]" type="text" name="search" placeholder="Name, lead ID, Mobile, Email..." style="border: 2px solid #8E8E8E;">
|
||||
<button class="rounded-r-lg text-[#fff] p-1.5" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%);" type="submit"><i class="fa fa-search"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
if(isset($_SESSION['user_type']) && $_SESSION['user_type'] == 'admin'){
|
||||
echo '<p onclick="deleteCofermation();" class="rounded-lg h-fit py-2 px-6 text-[#fff] text-center" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); cursor: pointer;">Delete</p>';
|
||||
}
|
||||
?>
|
||||
<button onclick="toggleDisplay();" class="rounded-lg px-2 h-fit text-[#fff] flex flex-row justify-center place-items-center" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); text-align: center;"><span style="font-size: 30px; font-weight: bold">+</span><span>Add Leads</span></button>
|
||||
</div>
|
||||
|
||||
<form method="post" class="table-container">
|
||||
<table class="bg-[#fff] text-[#3F4254] rounded-lg font-bold min-w-full leading-normal" style="" >
|
||||
<thead class="fixed-header">
|
||||
<tr>
|
||||
<?php
|
||||
if(isset($_SESSION['user_type']) && $_SESSION['user_type'] == 'admin')
|
||||
echo ' <th class=" border-b-2 p-3">
|
||||
<div class="delete-confirm" id="delete-button" style="display: none;">
|
||||
<p>Are you sure you want to delete this lead?</p>
|
||||
<div class="flex flex-row space-x-4">
|
||||
<p onclick="deleteCofermation();" class="rounded-lg p-2 text-[#443780] mr-4" style="border: 2px solid #443780; cursor: pointer;">No</p>
|
||||
<button class="rounded-lg p-3 text-[#fff]" type="submit" name="delete_records" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%);">Yes</button>
|
||||
</div>
|
||||
</div>
|
||||
</th>';
|
||||
?>
|
||||
<th class="border-b-2 p-3 text-left">Date</th>
|
||||
<th class="border-b-2 p-3 text-left">Name</th>
|
||||
<th class="border-b-2 p-3 text-left">Country / State</th>
|
||||
<th class="border-b-2 p-3 text-left">ID</th>
|
||||
<th class="border-b-2 p-3 text-left">Status</th>
|
||||
<th class="border-b-2 p-3 text-left">Form Name</th>
|
||||
<th class="border-b-2 p-3">Assigned to</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody >
|
||||
<?php
|
||||
//?bv=teenybeans&start_date=2024-05-04&end_date=2024-05-18
|
||||
try {
|
||||
$searchTerm =isset($_GET['search']) ? $_GET['search'] : "%";
|
||||
$businessVertical =isset($_GET['bv']) ? $_GET['bv'] : "%";
|
||||
$dateForFilter = date('Y-m-d');
|
||||
|
||||
// Add one day to the current date
|
||||
$new_date = date('Y-m-d', strtotime($dateForFilter . ' +1 day'));
|
||||
// echo $businessVertical;
|
||||
$start_date = isset($_GET['start_date']) ? $_GET['start_date'] : '2014-05-05';
|
||||
$end_date = isset($_GET['end_date']) ? $_GET['end_date'] : $new_date;
|
||||
$start_time = microtime(true);
|
||||
$resultsPerPage = 200;
|
||||
$page =isset($_GET['page']) ? $_GET['page'] : 1;
|
||||
$offset = ($page - 1) * $resultsPerPage ;
|
||||
$accessArray = explode(",", $_SESSION['access']);
|
||||
$placeholders = rtrim(str_repeat('?,', count($accessArray)), ','); // Creating placeholders like ?,?,?,?
|
||||
$placeholderString = implode(',', array_fill(0, count($accessArray), '?'));
|
||||
|
||||
//first query to get the total number for pagination
|
||||
|
||||
// WHERE (name LIKE :searchTerm OR phone LIKE :searchTerm OR id LIKE :searchTerm OR email LIKE :searchTerm ) AND time BETWEEN :start_date AND :end_date
|
||||
$sql= "SELECT COUNT(*) FROM cleads ";
|
||||
$stmt = $conn->prepare($sql);
|
||||
// $stmt->bindValue(':businessVertical', "%".$businessVertical."%");
|
||||
// $stmt->bindValue(':searchTerm', "%".$searchTerm."%");
|
||||
// $stmt->bindValue(':start_date', $start_date);
|
||||
// $stmt->bindValue(':end_date', $end_date);
|
||||
$stmt->execute();
|
||||
$totalRows = $stmt->fetchColumn();
|
||||
|
||||
// second & final query to get the page_view data
|
||||
|
||||
$sql = "SELECT * FROM cleads WHERE (name LIKE :searchTerm OR phone LIKE :searchTerm OR id LIKE :searchTerm OR email LIKE :searchTerm ) AND time BETWEEN :start_date AND :end_date ORDER BY id DESC LIMIT :limit OFFSET :offset";
|
||||
$stmt = $conn->prepare($sql);
|
||||
// $stmt->bindValue(':businessVertical', $businessVertical, PDO::PARAM_STR );
|
||||
$stmt->bindValue(':searchTerm', "%$searchTerm%"); // PDO::PARAM_STR is the default data type binding so is not needed
|
||||
$stmt->bindValue(':start_date', $start_date);
|
||||
$stmt->bindValue(':end_date', $end_date);
|
||||
$stmt->bindValue(':limit', $resultsPerPage, PDO::PARAM_INT);
|
||||
$stmt->bindValue(':offset', $offset, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
$leads = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$totalResults = count($leads);
|
||||
$totalPages = ceil($totalRows / $resultsPerPage);
|
||||
|
||||
$end_time = microtime(true);
|
||||
$execution_time = ($end_time - $start_time);
|
||||
$executionTime = substr($execution_time, 0, 6);
|
||||
// if($resultsPerPage <= $totalRows) echo "<p class='px-4'>".$resultsPerPage." Out of ".$totalRows." Leads in ".$executionTime." Seconds</p>";
|
||||
// else echo "<p class='px-4'>".$totalRows." Leads </p>";
|
||||
// Status Conditional Color
|
||||
foreach($leads as $lead){
|
||||
$only_date =isset($lead['time']) ? substr($lead['time'], 0, 10): 'Not Available';
|
||||
$leadCountry = strlen($lead['country']) > 0 ? $lead['country'] . ($lead['state'] > 0 ? '/' : ' ') : ' ';
|
||||
|
||||
$lead_id = $lead['id'];
|
||||
if($lead['status'] == 'New'){$conditional_background_color = 'background-color: #D4FFFF; border: 1px solid #2C9C9C; border-radius: 5px; color: #2C9C9C; border-radius: 20px; text-align: center;';}
|
||||
elseif($lead['status'] == 'Contacted'){$conditional_background_color = 'background-color: #D0E9FF; border: 1px solid #1A91FF; border-radius: 5px; color: #1A91FF; border-radius: 20px; text-align: center;';}
|
||||
elseif($lead['status'] == 'Disqualified'){$conditional_background_color = 'background-color: #CECECE; border: 1px solid #3F4254; border-radius: 5px; color: #3F4254; border-radius: 20px; text-align: center;';}
|
||||
elseif($lead['status'] == 'Converted'){$conditional_background_color = 'background-color: #D4FDE7; border: 1px solid #40916C; border-radius: 5px; color: #40916C; border-radius: 20px; text-align: center;';}
|
||||
elseif($lead['status'] == 'Warm'){$conditional_background_color = 'background-color: #FFD9D9; border: 1px solid #FB5555; border-radius: 5px; color: #FB5555; border-radius: 20px; text-align: center;';}
|
||||
elseif($lead['status'] == 'Inactive'){$conditional_background_color = 'background-color: #FFD9D9; border: 1px solid #FB5555; border-radius: 5px; color: #FB5555; border-radius: 20px; text-align: center;';}
|
||||
// if status = warm then select
|
||||
// if($row['status'] == 'Warm'){$conditional_status = '<div class="flex flex-row"><p>'.$row['status'].'</p><select class="focus: outline-none " style="'.$conditional_background_color.' border: none;"><option>Option 1</option><option>Option 2</option></select></div>';}elseif($row['status'] != 'Warm'){$conditional_status = $row['status'];}
|
||||
?>
|
||||
<tr>
|
||||
<?php if(isset($_SESSION['user_type']) && $_SESSION['user_type'] == 'admin'){?>
|
||||
<td class="border-y-2 p-2">
|
||||
<input type="checkbox" name="selected_records[]" value="<?php echo $lead['id']; ?>" id="<?php echo $lead['id']; ?>" />
|
||||
</td>
|
||||
<?php }?>
|
||||
<td class="whitespace-nowrap border-y-2 p-2"><?php echo $only_date; ?></td>
|
||||
<td class="whitespace-nowrap border-y-2 p-2"><label for="<?php echo $lead['id']; ?>"><?php echo $lead['name'] ?></label></td>
|
||||
<td class="whitespace-nowrap border-y-2 p-2"><?php echo $leadCountry.$lead['state']; ?></td>
|
||||
<td class="whitespace-nowrap border-y-2 p-2 text-blue-500 hover:text-blue-700 hover:underline"><a href="/edit-lead/?id=<?php echo $lead['id'] ?>"><?php echo $lead['id'] ?></a></td>
|
||||
<td class="whitespace-nowrap border-y-2 p-2"><div style="<?php echo $conditional_background_color; ?> font-weight: bold;"><?php echo $lead['status'];?></div></td>
|
||||
<!-- <td class="border-y-2 p-2">
|
||||
<p><i class="fa fa-envelope"> <?php // echo $lead['email'] ?></i></p>
|
||||
<p><i class="fa fa-phone"> <?php // echo $lead['phone'] ?></i></p>
|
||||
</td> -->
|
||||
<td class="border-y-2 p-2"><?php echo $lead['formname'] ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $lead['user'] ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
|
||||
// Output execution time
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<!-- Pagination Links -->
|
||||
|
||||
<?php
|
||||
$getParams = $_GET; unset($getParams['page']); $getParams['page'] = $page-1; $backPage= http_build_query($getParams); unset($getParams['page']);
|
||||
$getParams['page'] = $page+1; $nextkPage= http_build_query($getParams);
|
||||
// echo $totalPages;
|
||||
echo'<div class="flex flex-row justify-end">
|
||||
<div class="flex flex-row justify-end">
|
||||
<button class="px-4 py-2 text-[#443780] border border-[#443780] rounded-l-lg" > '; if($page>1) echo '<a href="?',$backPage,'"><','</a>'; echo ' </button>
|
||||
<button class="px-4 py-2 text-white border-y border-[#443780]" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%);"> '.$page.' </button>
|
||||
<button class="px-4 py-2 text-[#443780] border border-[#443780] rounded-r-lg" > '; if($page<$totalPages) echo '<a href="?',$nextkPage,'">>','</a>'; echo ' </button>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
?>
|
||||
<!-- New Lead Form Section -->
|
||||
<div id="add-lead-form" class="add-lead-form">
|
||||
<div class="flex flex-row place-content-between p-2" style="border-bottom: 2px solid #464E5F; border-style: dashed;">
|
||||
<p class="text-[25px] font-bold">Add Lead</p>
|
||||
<p onclick="toggleDisplay();" class="rounded-lg px-1.5 text-[#464E5F] text-[25px] cursor-pointer" style="border: 2px solid #464E5F; border-radius: 50%;">✘</p>
|
||||
</div>
|
||||
<form action="" method="post" class="p-4">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2">
|
||||
<div class="flex flex-col mr-4">
|
||||
<label for="country"> Country:</label>
|
||||
<select name="country" id="country" onchange="fetchStates()" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;">
|
||||
<option value="">Select Country</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex flex-col mr-4">
|
||||
<label for="state"> State:</label>
|
||||
<select name="state" id="state" onchange="fetchCities()" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;">
|
||||
<option value="">Select State</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex flex-col mr-4">
|
||||
<label for="city"> City:</label>
|
||||
<select name="city" id="city" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;">
|
||||
<option value="">Select City</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex flex-col mr-4">
|
||||
<label for="address">Address:</label>
|
||||
<input class="" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" type="text" name="address" id="address" />
|
||||
</div>
|
||||
<div class="flex flex-col mr-4">
|
||||
<label for="name">Name:</label>
|
||||
<input class="" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" type="text" name="name" id="name" />
|
||||
</div>
|
||||
<div class="flex flex-col mr-4">
|
||||
<label for="gender">Gender:</label>
|
||||
<select class="" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" type="text" name="gender" id="gender" >
|
||||
<option value="Male">Male</option>
|
||||
<option value="Female">Female</option>
|
||||
<option value="Others">Others</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex flex-col mr-4">
|
||||
<label for="profession">Profession:</label>
|
||||
<input class="" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" type="text" name="profession" id="profession" />
|
||||
</div>
|
||||
<div class="flex flex-col mr-4">
|
||||
<label for="email">E-mail:</label>
|
||||
<input class="" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" type="text" name="email" id="email" />
|
||||
</div>
|
||||
<div class="flex flex-col mr-4">
|
||||
<label for="phone">Phone:</label>
|
||||
<input class="" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" type="text" name="phone" id="phone" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-row place-content-between p-2 text-[25px] font-bold" style="border-bottom: 2px solid #464E5F; border-style: dashed;">Lead Information</div>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2">
|
||||
<div class="flex flex-col mr-4">
|
||||
<label for="origin">Origin:</label>
|
||||
<select class="" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" type="text" name="origin" id="origin" >
|
||||
<option value="Facebook Ads">Facebook Ads</option>
|
||||
<option value="Google Ads">Google Ads</option>
|
||||
<option value="Linkedin Ads">Linkedin Ads</option>
|
||||
<option value="Instagram">Instagram</option>
|
||||
<option value="Messenger">Messenger</option>
|
||||
<option value="Whatsapp">Whatsapp</option>
|
||||
<option value="GMB">GMB</option>
|
||||
<option value="Linkedin">Linkedin</option>
|
||||
<option value="Inbound Call">Inbound Call</option>
|
||||
<option value="Outbound Call">Outbound Call</option>
|
||||
<option value="Others">Others</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col mr-4">
|
||||
<label for="note">Note:</label>
|
||||
<textarea type="text" name="note" id="note" rows="6" cols="10" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;"></textarea>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<input class="p-2" type="submit" name="new_lead" id="new_lead" value="Submit" style="color:#fff; border-radius: 6px; background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); text-align: center; margin-top: 10px;"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
// Function to fetch countries and populate the country dropdown
|
||||
function fetchCountries() {
|
||||
fetch('https://api.siliconpin.com/v3/list/country/')
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
const countryDropdown = document.getElementById('country');
|
||||
countryDropdown.innerHTML = '<option value="">Select Country</option>';
|
||||
data.forEach(country => {
|
||||
const option = document.createElement('option');
|
||||
option.value = country.iso2;
|
||||
option.text = country.name;
|
||||
countryDropdown.appendChild(option);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function fetchStates() {
|
||||
const selectedCountry = document.getElementById('country').value;
|
||||
fetch(`https://api.siliconpin.com/v3/list/country/state/?country=${selectedCountry}`)
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
const stateDropdown = document.getElementById('state');
|
||||
stateDropdown.innerHTML = '<option value="">Select State</option>';
|
||||
data.forEach(state => {
|
||||
const option = document.createElement('option');
|
||||
option.value = state.iso2;
|
||||
option.text = state.name;
|
||||
stateDropdown.appendChild(option);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Function to fetch cities based on selected country and state and populate the city dropdown
|
||||
function fetchCities() {
|
||||
const selectedCountry = document.getElementById('country').value;
|
||||
const selectedState = document.getElementById('state').value;
|
||||
fetch(`https://api.siliconpin.com/v3/list/country/city/?country=${selectedCountry}&state=${selectedState}`)
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
const cityDropdown = document.getElementById('city');
|
||||
cityDropdown.innerHTML = '<option value="">Select City</option>';
|
||||
data.forEach(city => {
|
||||
const option = document.createElement('option');
|
||||
option.value = city.name;
|
||||
option.text = city.name;
|
||||
cityDropdown.appendChild(option);
|
||||
});
|
||||
});
|
||||
}
|
||||
// Fetch countries on page load
|
||||
fetchCountries();
|
||||
|
||||
function toggleDisplay() {
|
||||
var element = document.getElementById('add-lead-form');
|
||||
console.log(element);
|
||||
if (element.style.display === 'block') {
|
||||
element.style.display = 'none';
|
||||
} else {
|
||||
element.style.display = 'block';
|
||||
element.classList.add('slide-in-animation'); // Add class to trigger animation
|
||||
}
|
||||
}
|
||||
|
||||
// Event listener for the Esc key
|
||||
document.addEventListener('keydown', function(event) {
|
||||
if (event.keyCode === 27) {
|
||||
var modal = document.getElementById('add-lead-form');
|
||||
if (modal.style.display === 'block') {
|
||||
modal.style.display = 'none';
|
||||
}
|
||||
}
|
||||
});
|
||||
function deleteCofermation(){
|
||||
let deleteButton = document.getElementById('delete-button');
|
||||
let leadID = document.getElementById('<?php if(isset($lead['id'])) echo $lead['id']; ?>').value; //getting Err: here
|
||||
if(leadID != null){
|
||||
if(deleteButton.style.display === 'flex'){
|
||||
deleteButton.style.display = 'none';
|
||||
}else{
|
||||
deleteButton.style.display = 'flex'
|
||||
}
|
||||
}
|
||||
}
|
||||
const data = <?php echo json_encode($leads); ?>;
|
||||
const filename = `leads_data.csv`;
|
||||
|
||||
function downloadCSV(data, filename) {
|
||||
const csv = convertToCSV(data);
|
||||
const blob = new Blob([csv], { type: 'text/csv' });
|
||||
const link = document.createElement('a');
|
||||
link.href = URL.createObjectURL(blob);
|
||||
link.download = filename;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
|
||||
function convertToCSV(data) {
|
||||
const csvRows = [];
|
||||
const headers = Object.keys(data[0]);
|
||||
csvRows.push(headers.join(','));
|
||||
data.forEach(row => {
|
||||
const values = headers.map(header => {
|
||||
const escaped = ('' + row[header]).replace(/"/g, '\\"');
|
||||
return `"${escaped}"`;
|
||||
});
|
||||
csvRows.push(values.join(','));
|
||||
});
|
||||
|
||||
return csvRows.join('\n');
|
||||
|
||||
// downloadCSV(data, filename);
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
position: relative;
|
||||
height: 100vh;
|
||||
overflow-y: scroll;
|
||||
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
||||
scrollbar-width: none; /* Firefox */
|
||||
}
|
||||
|
||||
.table-container::-webkit-scrollbar {
|
||||
display: none; /* Safari and Chrome */
|
||||
}
|
||||
|
||||
/* Fixed header */
|
||||
.fixed-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background-color: white; /* Change this to match your table header background color */
|
||||
z-index: 996; /* Ensure it stays above table content */
|
||||
}
|
||||
|
||||
/* Ensure the fixed header matches the table headers */
|
||||
.fixed-header th {
|
||||
background-color: inherit; /* Maintain background color */
|
||||
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.4); /* Optional: Add a shadow for better visibility */
|
||||
}
|
||||
|
||||
/* Optional: Style table for better visibility */
|
||||
.table-container table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.add-lead-form {
|
||||
background-color: #F8F8F8;
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0%;
|
||||
right: 0%;
|
||||
transform: translateX(100%);
|
||||
/* transform: translate(-0%, -50%); */
|
||||
width: 100%;
|
||||
max-width: 500px;
|
||||
box-shadow: 0px 0px 20px 0px #443780;
|
||||
border-radius: 2px;
|
||||
z-index: 999;
|
||||
height: 100%;
|
||||
animation: slideInRight 0.5s forwards; /* Animation to slide in */
|
||||
/* overflow-x: auto; */
|
||||
}
|
||||
|
||||
@keyframes slideInRight {
|
||||
from {
|
||||
transform: translateX(100%);
|
||||
}
|
||||
to {
|
||||
transform: translateX(0%);
|
||||
}
|
||||
}
|
||||
|
||||
.delete-confirm{
|
||||
position: fixed;
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
background-color: #E6E5F4;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
padding: 40px 50px 40px 50px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
</style>
|
||||
@@ -31,7 +31,7 @@
|
||||
// echo $_SESSION["loggedin"].$_SESSION["log_status"].$_SESSION["access"].$_SESSION["name"].$_SESSION["email"];
|
||||
}
|
||||
} else{
|
||||
echo "<p class='text-danger'>Credentials did not match</p>";
|
||||
$loginErrorMessage = "Credentials did not match";
|
||||
}
|
||||
|
||||
// else echo "credentials did not match";+
|
||||
@@ -40,7 +40,6 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="container-fluid" style="background-image: url('/assets/login-back1.jpg'); background-position: center; background-size: cover; background-repeat: no-repeat; height: 100vh; width: 100%;">
|
||||
<div class="login-section-center flex flex-col">
|
||||
@@ -50,6 +49,7 @@
|
||||
<h2 class="">Enter your email and password to access your account</h2>
|
||||
</div>
|
||||
<form action="" method="post" class="space-y-4 rounded-md">
|
||||
<?php if(isset($loginErrorMessage)) echo "<p class='text-red-500 font-bold shake'>$loginErrorMessage</p>"; ?>
|
||||
<div class="">
|
||||
<label for="email">Email:</label>
|
||||
<input type="text" class="p-2 bg-transparent text-[#fff] border-[2px] border-[#fff] rounded-lg focus:outline-none w-full" name="email" placeholder="Email ID">
|
||||
@@ -90,4 +90,19 @@
|
||||
border-radius: 20px;
|
||||
padding: 20px;
|
||||
}
|
||||
@keyframes shake {
|
||||
0% { transform: translateX(0); }
|
||||
25% { transform: translateX(-5px); }
|
||||
50% { transform: translateX(5px); }
|
||||
75% { transform: translateX(-5px); }
|
||||
100% { transform: translateX(0); }
|
||||
}
|
||||
|
||||
.shake {
|
||||
background: #ffffff70;
|
||||
display: inline-block;
|
||||
animation: shake 0.2s;
|
||||
border-radius: 6px;
|
||||
padding: 5px 10px 5px 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,4 @@
|
||||
<style>
|
||||
/* Quick action Sub menu */
|
||||
.xzmdropdown-wrapper {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
@@ -29,7 +28,7 @@
|
||||
|
||||
.xzmdropdown-wrapper:hover .xzmdropdown-content {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.xzmdropdown-submenu {
|
||||
position: absolute;
|
||||
@@ -130,41 +129,52 @@
|
||||
}
|
||||
}
|
||||
?>
|
||||
<p class="text-[28px] font-bold p-4">Lead Management</p>
|
||||
<div class="flex flex-row gap-2 justify-content-between place-items-center">
|
||||
<p class="text-[28px] font-bold p-4">Lead Management</p>
|
||||
<a href="/followup" class="inline-flex h-fit px-3 py-2 rounded-lg" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%);">
|
||||
<svg width="30px" height="30px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M7 14C7 13.4477 7.44772 13 8 13C8.55229 13 9 13.4477 9 14C9 14.5523 8.55229 15 8 15C7.44772 15 7 14.5523 7 14Z" fill="#ffffff"></path> <path d="M8 17C7.44772 17 7 17.4477 7 18C7 18.5523 7.44772 19 8 19C8.55229 19 9 18.5523 9 18C9 17.4477 8.55229 17 8 17Z" fill="#ffffff"></path> <path d="M11 14C11 13.4477 11.4477 13 12 13C12.5523 13 13 13.4477 13 14C13 14.5523 12.5523 15 12 15C11.4477 15 11 14.5523 11 14Z" fill="#ffffff"></path> <path d="M12 17C11.4477 17 11 17.4477 11 18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18C13 17.4477 12.5523 17 12 17Z" fill="#ffffff"></path> <path d="M15 14C15 13.4477 15.4477 13 16 13C16.5523 13 17 13.4477 17 14C17 14.5523 16.5523 15 16 15C15.4477 15 15 14.5523 15 14Z" fill="#ffffff"></path> <path d="M16 17C15.4477 17 15 17.4477 15 18C15 18.5523 15.4477 19 16 19C16.5523 19 17 18.5523 17 18C17 17.4477 16.5523 17 16 17Z" fill="#ffffff"></path> <path fill-rule="evenodd" clip-rule="evenodd" d="M6 2C6 1.44772 6.44772 1 7 1C7.55228 1 8 1.44772 8 2V3H16V2C16 1.44772 16.4477 1 17 1C17.5523 1 18 1.44772 18 2V3H19C20.6569 3 22 4.34315 22 6V20C22 21.6569 20.6569 23 19 23H5C3.34315 23 2 21.6569 2 20V6C2 4.34315 3.34315 3 5 3H6V2ZM16 5V6C16 6.55228 16.4477 7 17 7C17.5523 7 18 6.55228 18 6V5H19C19.5523 5 20 5.44772 20 6V9H4V6C4 5.44772 4.44772 5 5 5H6V6C6 6.55228 6.44772 7 7 7C7.55228 7 8 6.55228 8 6V5H16ZM4 11V20C4 20.5523 4.44772 21 5 21H19C19.5523 21 20 20.5523 20 20V11H4Z" fill="#ffffff"></path> </g></svg>
|
||||
<?php if($follow_date_count > 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 text-[#FFF]"><?php echo $follow_date_count; ?></p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</a>
|
||||
</div>
|
||||
<div id="page-body" class="flex flex-row place-content-between px-4">
|
||||
<dialog>
|
||||
<button style="float: right; color: #FF0000; font-size: 25px; padding: 6px;">✘</button>
|
||||
<div class="flex flex-row">
|
||||
<div class="flex flex-col p-6 space-y-4">
|
||||
<a href="/leads?start_date=<?php echo $today_date ?>&end_date=<?php echo $next_day ?>">Today</a>
|
||||
<a href="/leads?start_date=<?php echo $yesterday ?>&end_date=<?php echo $today_date ?>">Yesterday</a>
|
||||
<a href="/leads?start_date=<?php echo $this_week ?>&end_date=<?php echo $today_date ?>">This Week</a>
|
||||
<a href="/leads?start_date=<?php echo $firstDayOfCurrentMonth ?>&end_date=<?php echo $today_date ?>">This Month</a>
|
||||
<a href="/leads?start_date=<?php echo $prev_month_date ?>&end_date=<?php echo $today_date ?>">Last Month</a>
|
||||
<a href="/leads?start_date=<?php echo $firstDateOfYear ?>&end_date=<?php echo $today_date ?>">This Year</a>
|
||||
<a href="/leads?start_date=<?php echo $firstDateOfPreviousYear ?>&end_date=<?php echo $today_date ?>">Last Year</a>
|
||||
<a href="/leads">All Time</a>
|
||||
<dialog id="d" class="rounded-lg">
|
||||
<form class="text-2xl text-[#464E5F] border-[3px] m-2 border-[#464E5F] duration-700 rounded-full px-2 float-right" method="dialog" class=""><button class="">✘</button></form>
|
||||
<div class="flex flex-row ">
|
||||
<div class="flex flex-col p-4 space-y-4 border-r-[1px] border-[#464E5F]">
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $today_date ?>&end_date=<?php echo $next_day ?>">Today</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $yesterday ?>&end_date=<?php echo $today_date ?>">Yesterday</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $this_week ?>&end_date=<?php echo $today_date ?>">This Week</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $firstDayOfCurrentMonth ?>&end_date=<?php echo $today_date ?>">This Month</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $prev_month_date ?>&end_date=<?php echo $today_date ?>">Last Month</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $firstDateOfYear ?>&end_date=<?php echo $today_date ?>">This Year</a>
|
||||
<a class="whitespace-nowrap" href="/leads?start_date=<?php echo $firstDateOfPreviousYear ?>&end_date=<?php echo $today_date ?>">Last Year</a>
|
||||
<a class="whitespace-nowrap" href="/leads">All Time</a>
|
||||
</div>
|
||||
<form method="GET" class="p-6 flex flex-col pb-10">
|
||||
<p>Choose Date for filter</p>
|
||||
<p class="font-bold">Choose Date for filter</p>
|
||||
<div class="flex flex-row rounded-xl py-10">
|
||||
<div class="flex flex-row place-items-center">
|
||||
<label for="start_date">From Date</label>
|
||||
<input type="date" name="start_date" id="start_date" />
|
||||
</div> |
|
||||
<div class="flex flex-row place-items-center">
|
||||
<label for="end_date">To Date</label>
|
||||
<input type="date" name="end_date" id="end_date" />
|
||||
<div class="flex flex-row place-items-center border-2 border-[#464E5F] rounded-md">
|
||||
<label class="whitespace-nowrap" for="start_date">From Date</label>
|
||||
<input class="focus:outline-none" type="date" name="start_date" id="start_date" />
|
||||
</div> |
|
||||
<div class="flex flex-row place-items-center border-2 border-[#464E5F] rounded-md">
|
||||
<label class="whitespace-nowrap" for="end_date">To Date</label>
|
||||
<input class="focus:outline-none" type="date" name="end_date" id="end_date" />
|
||||
</div>
|
||||
</div>
|
||||
<button class="rounded-lg p-1 text-[#fff]" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); text-align: center;" type="submit"><p class="text-center p-1.5">Search</p></button>
|
||||
</form>
|
||||
</div>
|
||||
</dialog>
|
||||
<button class="rounded-lg p-2 h-fit bg-[#fff] text-[#464E5F] shadow-lg" style="">Select Date</button>
|
||||
<button onclick="d.showModal()" class="rounded-lg pl-2 h-fit bg-[#fff] text-[#464E5F] shadow-lg flex flex-row justify-center place-items-center">Select Date<span class="fa fa-calendar-o -ml-[17px] pt-1.5"></span></button>
|
||||
<button onclick="downloadCSV(data, filename)" class="text-[#fff] rounded-lg h-fit inline-flex justify-center place-items-center p-2" style="background: linear-gradient(90deg, rgba(70, 68, 142, 0.91) 0%, rgba(120, 117, 244, 0.91) 100%);">Download csv</button>
|
||||
<div class="flex flex-row">
|
||||
<form method="GET" action="" class="bg-[#fff] flex flex-row place-items-center">
|
||||
<input class="p-2.5 rounded-l-lg focus:outline-none w-[320px]" type="text" name="search" placeholder="Name, lead ID, Mobile, Email..." style="border: 2px solid #8E8E8E;">
|
||||
<input class="p-2.5 rounded-l-lg focus:outline-none w-[320px]" type="text" name="search" placeholder="Name, lead ID, Mobile, Email, Status..." style="border: 2px solid #8E8E8E;">
|
||||
<button class="rounded-r-lg text-[#fff] p-1.5" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%);" type="submit"><i class="fa fa-search"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
@@ -173,16 +183,16 @@
|
||||
echo '<p onclick="deleteCofermation();" class="rounded-lg h-fit py-2 px-6 text-[#fff] text-center" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); cursor: pointer;">Delete</p>';
|
||||
}
|
||||
?>
|
||||
<button onclick="toggleDisplay();" class="rounded-lg p-2 h-fit text-[#fff]" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); text-align: center;">Add Leads</button>
|
||||
<button onclick="toggleDisplay();" class="rounded-lg px-2 h-fit text-[#fff] flex flex-row justify-center place-items-center" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); text-align: center;"><span style="font-size: 30px; font-weight: bold">+</span><span>Add Leads</span></button>
|
||||
</div>
|
||||
|
||||
<form method="post">
|
||||
<table class="bg-[#fff] text-[#3F4254] rounded-lg font-bold" style="width: 100%;" >
|
||||
<thead>
|
||||
<form method="post" class="table-container">
|
||||
<table class="bg-[#fff] text-[#3F4254] rounded-lg font-bold min-w-full leading-normal" style="" >
|
||||
<thead class="fixed-header">
|
||||
<tr>
|
||||
<?php
|
||||
if(isset($_SESSION['user_type']) && $_SESSION['user_type'] == 'admin')
|
||||
echo ' <th class="text-center border-b-2 p-3">
|
||||
echo ' <th class=" border-b-2 p-3">
|
||||
<div class="delete-confirm" id="delete-button" style="display: none;">
|
||||
<p>Are you sure you want to delete this lead?</p>
|
||||
<div class="flex flex-row space-x-4">
|
||||
@@ -192,13 +202,14 @@
|
||||
</div>
|
||||
</th>';
|
||||
?>
|
||||
<th class="text-center border-b-2 p-3">Quick Action</th>
|
||||
<th class="text-center border-b-2 p-3">Name</th>
|
||||
<th class="text-center border-b-2 p-3">ID</th>
|
||||
<th class="text-center border-b-2 p-3">Status Update</th>
|
||||
<!-- <th class="text-center border-b-2 p-3">Contact Detail</th> -->
|
||||
<th class="text-center border-b-2 p-3">Form Name</th>
|
||||
<th class="text-center border-b-2 p-3">Date</th>
|
||||
<th class="border-b-2 p-3 text-left">Date</th>
|
||||
<th class="border-b-2 p-3 text-left">Name</th>
|
||||
<th class="border-b-2 p-3 text-left">Country / State</th>
|
||||
<th class="border-b-2 p-3 text-left">ID</th>
|
||||
<th class="border-b-2 p-3 text-left">Status</th>
|
||||
<th class="border-b-2 p-3 text-left">Form Name</th>
|
||||
<th class="border-b-2 p-3">Assigned to</th>
|
||||
<th class="border-b-2 p-3">Followup Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody >
|
||||
@@ -225,7 +236,7 @@
|
||||
$quotedParts = array_map(function($item) { return "'" . $item . "'";}, $parts);
|
||||
$stateAcc = implode(',', $quotedParts);
|
||||
|
||||
$sql= "SELECT COUNT(*) FROM cleads WHERE state IN ($stateAcc) OR user LIKE :user AND business_type LIKE :businessVertical AND (name LIKE :searchTerm OR phone LIKE :searchTerm OR id LIKE :searchTerm OR email LIKE :searchTerm ) AND time BETWEEN :start_date AND :end_date ";
|
||||
$sql= "SELECT COUNT(*) FROM cleads WHERE state IN ($stateAcc) OR user LIKE :user AND business_type LIKE :businessVertical AND (name LIKE :searchTerm OR phone LIKE :searchTerm OR id LIKE :searchTerm OR email LIKE :searchTerm OR status LIKE :searchTerm ) AND time BETWEEN :start_date AND :end_date ";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bindValue(':businessVertical', $businessVertical);
|
||||
$stmt->bindValue(':searchTerm', "%".$searchTerm."%");
|
||||
@@ -237,7 +248,7 @@
|
||||
|
||||
// second & final query to get the page_view data
|
||||
|
||||
$sql = "SELECT * FROM cleads WHERE state IN ($stateAcc) OR user LIKE :user AND business_type LIKE :businessVertical AND (name LIKE :searchTerm OR phone LIKE :searchTerm OR id LIKE :searchTerm OR email LIKE :searchTerm ) AND time BETWEEN :start_date AND :end_date ORDER BY id DESC LIMIT :limit OFFSET :offset";
|
||||
$sql = "SELECT * FROM cleads WHERE state IN ($stateAcc) OR user LIKE :user AND business_type LIKE :businessVertical AND (name LIKE :searchTerm OR phone LIKE :searchTerm OR id LIKE :searchTerm OR email LIKE :searchTerm OR status LIKE :searchTerm ) AND time BETWEEN :start_date AND :end_date ORDER BY id DESC LIMIT :limit OFFSET :offset";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bindValue(':businessVertical', $businessVertical, PDO::PARAM_STR );
|
||||
$stmt->bindValue(':searchTerm', "%$searchTerm%"); // PDO::PARAM_STR is the default data type binding so is not needed
|
||||
@@ -251,9 +262,11 @@
|
||||
$totalResults = count($leads);
|
||||
$totalPages = ceil($totalRows / $resultsPerPage);
|
||||
if($resultsPerPage <= $totalRows) echo "<p class='px-4'>".$resultsPerPage." Out of ".$totalRows." Leads </p>";
|
||||
else echo "<p class='px-4'>".$totalRows." Leads </p>";
|
||||
|
||||
// else echo "<p class='px-4'>".$totalRows." Leads </p>";
|
||||
// Status Conditional Color
|
||||
foreach($leads as $lead){
|
||||
$leadCountry = strlen($lead['country']) > 0 ? $lead['country'] . ($lead['state'] > 0 ? '/' : ' ') : ' ';
|
||||
$only_date =isset($lead['time']) ? substr($lead['time'], 0, 10): 'Not Available';
|
||||
$lead_id = $lead['id'];
|
||||
if($lead['status'] == 'New'){$conditional_background_color = 'background-color: #FFD9D9; border: 2px solid #FB5555; border-radius: 20px; text-align: center; color: #FB5555;';}
|
||||
@@ -265,44 +278,23 @@
|
||||
// if($row['status'] == 'Warm'){$conditional_status = '<div class="flex flex-row"><p>'.$row['status'].'</p><select class="focus: outline-none " style="'.$conditional_background_color.' border: none;"><option>Option 1</option><option>Option 2</option></select></div>';}elseif($row['status'] != 'Warm'){$conditional_status = $row['status'];}
|
||||
?>
|
||||
<tr>
|
||||
<td class="border-y-2 p-2">
|
||||
<div class="flex flex-row justify-center place-items-center">
|
||||
<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="#">UNO</a>
|
||||
<a href="#">Primero</a>
|
||||
<div class="xzmdropdown-item">
|
||||
<a href="#">ILC</a>
|
||||
<a href="#">Complete package</a>
|
||||
<a href="#">Bespoke</a>
|
||||
<div class="xzmdropdown-submenu">
|
||||
<a href="#">Academic</a>
|
||||
<a href="#">Buzzapp</a>
|
||||
<a href="#">Design Solution</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://wa.me/<?php echo $lead['phone'] ?>?text=Hello%2C%20how%20are%20you%3F"><i class="fab fa-whatsapp" style="font-size: 20px"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php if(isset($_SESSION['user_type']) && $_SESSION['user_type'] == 'admin'){?>
|
||||
<td class="border-y-2 p-2">
|
||||
<input type="checkbox" name="selected_records[]" value="<?php echo $lead['id']; ?>" id="<?php echo $lead['id']; ?>" />
|
||||
</td>
|
||||
<?php }?>
|
||||
<td class="border-y-2 p-2"><label for="<?php echo $lead['id']; ?>"><?php echo $lead['name'] ?></label></td>
|
||||
<td class="border-y-2 p-2 text-blue-500 hover:text-blue-700 hover:underline"><a href="/edit-lead/?id=<?php echo $lead['id'] ?>"><?php echo $lead['id'] ?></a></td>
|
||||
<td class="border-y-2 p-2"><div style="<?php echo $conditional_background_color; ?> font-weight: bold;"><?php echo $lead['status'];?></div></td>
|
||||
<td class="whitespace-nowrap border-y-2 p-2"><?php echo $only_date; ?></td>
|
||||
<td class="whitespace-nowrap border-y-2 p-2"><label for="<?php echo $lead['id']; ?>"><?php echo $lead['name'] ?></label></td>
|
||||
<td class="whitespace-nowrap border-y-2 p-2"><?php echo $leadCountry.$lead['state']; ?></td>
|
||||
<td class="whitespace-nowrap border-y-2 p-2 text-blue-500 hover:text-blue-700 hover:underline"><a href="/edit-lead/?id=<?php echo $lead['id'] ?>"><?php echo $lead['id'] ?></a></td>
|
||||
<td class="whitespace-nowrap border-y-2 p-2"><div style="<?php echo $conditional_background_color; ?> font-weight: bold;"><?php echo $lead['status'];?></div></td>
|
||||
<!-- <td class="border-y-2 p-2">
|
||||
<p><i class="fa fa-envelope"> <?php // echo $lead['email'] ?></i></p>
|
||||
<p><i class="fa fa-phone"> <?php // echo $lead['phone'] ?></i></p>
|
||||
</td> -->
|
||||
<td class="border-y-2 p-2"><?php echo $lead['formname'] ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $only_date; ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $lead['user'] ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $lead['date'] ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
@@ -317,7 +309,7 @@
|
||||
$execution_time = ($end_time - $start_time);
|
||||
|
||||
// Output execution time
|
||||
echo "Page executed in: " . $execution_time . " seconds";
|
||||
// echo "Page executed in: " . $execution_time . " seconds";
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -522,6 +514,43 @@ echo'<div class="flex flex-row justify-end">
|
||||
</script>
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
position: relative;
|
||||
height: 100vh;
|
||||
overflow-y: scroll;
|
||||
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
||||
scrollbar-width: none; /* Firefox */
|
||||
}
|
||||
|
||||
.table-container::-webkit-scrollbar {
|
||||
display: none; /* Safari and Chrome */
|
||||
}
|
||||
|
||||
/* Fixed header */
|
||||
.fixed-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background-color: white;
|
||||
z-index: 996;
|
||||
}
|
||||
|
||||
/* Ensure the fixed header matches the table headers */
|
||||
.fixed-header th {
|
||||
background-color: inherit; /* Maintain background color */
|
||||
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.4); /* Optional: Add a shadow for better visibility */
|
||||
}
|
||||
|
||||
/* Optional: Style table for better visibility */
|
||||
.table-container table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.add-lead-form {
|
||||
background-color: #F8F8F8;
|
||||
display: none;
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
echo "Error: " . $e->getMessage();
|
||||
}
|
||||
};
|
||||
|
||||
?>
|
||||
<form method="post">
|
||||
<div>
|
||||
@@ -23,9 +22,10 @@
|
||||
<p class="text-[25px] font-bold">Notifications</p>
|
||||
<div>
|
||||
<a href="/notifications?tab=past" class="text-[#6F6BFF]">Past Notifications</a> |
|
||||
<input name="mark_all_read" type="submit" value="Mark all as read" class="text-[#6F6BFF] pr-6 cursor-pointer " />
|
||||
<input name="mark_all_read" type="submit" value="Mark all as read" class="text-[#6F6BFF] pr-6 cursor-pointer" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
try {
|
||||
@@ -42,18 +42,18 @@
|
||||
if($appt['view_status'] == 0){
|
||||
$notification_bg = 'background: #F5F4FFE8;';
|
||||
$notification_batch = '<div style="width: 8px; height: 8px; background-color: red; border-radius: 50%;"></div>';
|
||||
$clickButton = '';
|
||||
// $clickButton = '';
|
||||
}elseif($appt['view_status'] == 1){
|
||||
$notification_bg = 'background: #fff;';
|
||||
$notification_batch = '<div style="width: 8px; height: 8px; background-color: #fff; border-radius: 50%;"></div>';
|
||||
$clickButton = 'disabled';
|
||||
// $clickButton = 'disabled';
|
||||
}
|
||||
?> <div class="p-2">
|
||||
<form method="post">
|
||||
<button type="submit" class="w-full text-left" <?php echo $clickButton; ?>>
|
||||
<button type="submit" class="w-full text-left" >
|
||||
<div class="flex flex-col w-full p-2 rounded-md shadow" style="border: 3px solid #F5F4FFE8; <?php echo $notification_bg; ?>">
|
||||
<div class="flex flex-row place-items-center justify-between">
|
||||
<div class="flex flex-row place-items-center">🕑 Reminders for <?php echo $appt['name'].' '. $notification_batch; ?></div>
|
||||
<div class="flex flex-row place-items-center">🕑 Reminders for <?php echo $appt['lead_name'].' '. $notification_batch; ?></div>
|
||||
|
||||
<div><?php echo $appt['appt_date']; ?></div>
|
||||
</div>
|
||||
@@ -69,8 +69,6 @@
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
};
|
||||
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST['status_id']) && $_POST['status_id']){
|
||||
try {
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
$nameLetter = $firstInitial.$lastInitial;
|
||||
?>
|
||||
<div class="flex justify-center text-[60px] font-bold" >
|
||||
<p class="mb-20" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); color: #fff; border-radius: 6px; padding: 15px 20px 15px 20px; border-radius: 50%;"><?php echo $nameLetter; ?></p>
|
||||
<p class="mb-20 uppercase" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); color: #fff; border-radius: 6px; padding: 15px 20px 15px 20px; border-radius: 50%;"><?php echo $nameLetter; ?></p>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-6">
|
||||
<div class="flex flex-col">
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
<?php
|
||||
require_once('.hta_config/crm_config.php');
|
||||
require_once('.htac_header.php');
|
||||
require_once('.htac_nav.php');
|
||||
// echo $_SESSION['access'];
|
||||
?>
|
||||
<div>
|
||||
<table style="overflow-x: auto;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">Name</th>
|
||||
<th style="text-align: center;">ID</th>
|
||||
<th style="text-align: center;">Status</th>
|
||||
<th style="text-align: center;">Email</th>
|
||||
<th style="text-align: center;">Phone</th>
|
||||
<th style="text-align: center;">business_type</th>
|
||||
<th style="text-align: center;">Time</th>
|
||||
<th style="text-align: center;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
try {
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$accessArray = explode(",", $_SESSION['access']);
|
||||
$placeholders = rtrim(str_repeat('?,', count($accessArray)), ','); // Creating placeholders like ?,?,?,?
|
||||
|
||||
$stmt = $conn->prepare("SELECT COUNT(*) as total FROM cleads WHERE business_type IN ($placeholders)");
|
||||
foreach ($accessArray as $key => $value) {
|
||||
$stmt->bindValue($key + 1, $value);
|
||||
}
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$totalRecords = $result['total'];
|
||||
|
||||
$recordsPerPage = 100; // Number of records per page
|
||||
$totalPages = ceil($totalRecords / $recordsPerPage);
|
||||
$page = isset($_GET['page']) ? $_GET['page'] : 1; // Current page number
|
||||
$offset = ($page - 1) * $recordsPerPage;
|
||||
$stmt = $conn->prepare("SELECT * FROM cleads WHERE business_type IN ($placeholders) LIMIT $recordsPerPage OFFSET $offset");
|
||||
foreach ($accessArray as $key => $value) {
|
||||
$stmt->bindValue($key + 1, $value);
|
||||
}
|
||||
$stmt->execute();
|
||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$num_rows = $stmt->rowCount();
|
||||
if ($num_rows >= 1) {
|
||||
foreach($rows as $row){
|
||||
echo ' <tr>
|
||||
<td style="text-align: center;">'.$row['name'].'</td>
|
||||
<td style="text-align: center;"><a href="/edit-lead/?id='.$row['id'].'">'.$row['id'].'</a></td>
|
||||
<td style="text-align: center;">'.$row['status'].'</td>
|
||||
<td style="text-align: center;">'.$row['email'].'</td>
|
||||
<td style="text-align: center;">'.$row['phone'].'</td>
|
||||
<td style="text-align: center;">'.$row['business_type'].'</td>
|
||||
<td style="text-align: center;">'.$row['time'].'</td>
|
||||
<td style="text-align: center;">Delete</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
// Pagination links
|
||||
// echo '<tr><td colspan="8" style="text-align: center;">';
|
||||
// for ($i = 1; $i <= $totalPages; $i++) {
|
||||
// echo '<a href="?page='.$i.'">'.$i.'</a> ';
|
||||
// }
|
||||
// echo '</td></tr>';
|
||||
} else{
|
||||
echo "<tr><td colspan='8' class='text-danger'>Not Found any Data</td></tr>";
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo "<tr><td colspan='8' class='text-danger'>Error: " . $e->getMessage() . "</td></tr>";
|
||||
};
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -1,25 +0,0 @@
|
||||
<div id="example-table"></div>
|
||||
|
||||
<link href="https://unpkg.com/tabulator-tables@6.2.0/dist/css/tabulator.min.css" rel="stylesheet">
|
||||
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@6.2.0/dist/js/tabulator.min.js"></script>
|
||||
<script>
|
||||
//define data
|
||||
var tabledata = [
|
||||
{id:1, name:"Oli Bob", location:"United Kingdom", gender:"male", rating:1, col:"red", dob:"14/04/1984"},
|
||||
{id:2, name:"Mary May", location:"Germany", gender:"female", rating:2, col:"blue", dob:"14/05/1982"},
|
||||
{id:3, name:"Christine Lobowski", location:"France", gender:"female", rating:0, col:"green", dob:"22/05/1982"},
|
||||
{id:4, name:"Brendon Philips", location:"USA", gender:"male", rating:1, col:"orange", dob:"01/08/1980"},
|
||||
{id:5, name:"Margret Marmajuke", location:"Canada", gender:"female", rating:5, col:"yellow", dob:"31/01/1999"},
|
||||
{id:6, name:"Frank Harbours", location:"Russia", gender:"male", rating:4, col:"red", dob:"12/05/1966"},
|
||||
{id:7, name:"Jamie Newhart", location:"India", gender:"male", rating:3, col:"green", dob:"14/05/1985"},
|
||||
{id:8, name:"Gemma Jane", location:"China", gender:"female", rating:0, col:"red", dob:"22/05/1982"},
|
||||
{id:9, name:"Emily Sykes", location:"South Korea", gender:"female", rating:1, col:"maroon", dob:"11/11/1970"},
|
||||
{id:10, name:"James Newman", location:"Japan", gender:"male", rating:5, col:"red", dob:"22/03/1998"},
|
||||
];
|
||||
|
||||
//define table
|
||||
var table = new Tabulator("#example-table", {
|
||||
data:tabledata,
|
||||
autoColumns:true,
|
||||
});
|
||||
</script>
|
||||
@@ -1,3 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Get Select Option Text</title></head><body><select id="mySelect"><option value="1">Option 1</option><option value="2">Option 2</option><option value="3">Option 3</option></select>
|
||||
<button onclick="!function(){var e=document.getElementById('mySelect'),t=e.options[e.selectedIndex].textContent;alert('Selected Option Text: '+t)}()">Get Selected Option Text</button>
|
||||
</body></html>
|
||||
@@ -1,51 +0,0 @@
|
||||
<?php
|
||||
require_once('.hta_config/crm_config.php');
|
||||
require_once('.htac_header.php');
|
||||
require_once('.htac_nav.php');
|
||||
?>
|
||||
|
||||
<div>
|
||||
<table style="overflow-x: auto;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">Name</th>
|
||||
<th style="text-align: center;">Email</th>
|
||||
<th style="text-align: center;">Phone</th>
|
||||
<th style="text-align: center;">Access</th>
|
||||
<th style="text-align: center;">Time</th>
|
||||
<th style="text-align: center;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?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");
|
||||
$stmt->execute();
|
||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$num_rows = $stmt->rowCount();
|
||||
if ($num_rows >= 1) {
|
||||
foreach($rows as $row){
|
||||
echo ' <tr>
|
||||
<td style="text-align: center;">'.$row['name'].'</td>
|
||||
<td style="text-align: center;">'.$row['email'].'</td>
|
||||
<td style="text-align: center;">'.$row['mobile'].'</td>
|
||||
<td style="text-align: center;">'.$row['access'].'</td>
|
||||
<td style="text-align: center;">'.$row['time'].'</td>
|
||||
<td style="text-align: center;"><a href="/users/edit-user/?id='.$row['id'].'">Edit</a> | <a href="/users/delete-user/?id='.$row['id'].'">Delete</a> </td>
|
||||
</tr>';
|
||||
}
|
||||
} else{
|
||||
echo "<p class='text-danger'>Not Found any Data</p>";
|
||||
}
|
||||
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -12,7 +12,6 @@
|
||||
<th class="text-center border-b-2 p-3">Name</th>
|
||||
<th class="text-center border-b-2 p-3">Email</th>
|
||||
<th class="text-center border-b-2 p-3">Mobile</th>
|
||||
<th class="text-center border-b-2 p-3">Time</th>
|
||||
<th class="text-center border-b-2 p-3">Access</th>
|
||||
<th class="text-center border-b-2 p-3">Access by State</th>
|
||||
<th class="text-center border-b-2 p-3">Action</th>
|
||||
@@ -32,7 +31,6 @@
|
||||
<td class="border-y-2 p-2"><?php echo $row['name']; ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $row['email']; ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $row['mobile']; ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $row['time']; ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $row['access']; ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $row['access']; ?></td>
|
||||
<td class="border-y-2 p-2">
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
<?php
|
||||
require_once('.hta_config/crm_config.php');
|
||||
require_once('.htac_header.php');
|
||||
require_once('.htac_nav.php');
|
||||
try {
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch(PDOException $e) {
|
||||
echo "Connection failed: " . $e->getMessage();
|
||||
}
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$select_access = ['beanstalk', 'inhouse', 'teenybeans', 'iimtt', 'buzzapp', 'atheneum', 'teenybeans_curriculum'];
|
||||
$access_values_array = [];
|
||||
|
||||
foreach ($select_access as $access) {
|
||||
if (isset($_POST[$access])) {
|
||||
$access_values_array[] = $_POST[$access];
|
||||
}
|
||||
}
|
||||
$access_value = implode(',', $access_values_array);
|
||||
$name = $_POST['name'];
|
||||
$email = $_POST['email'];
|
||||
$phone = $_POST['phone'];
|
||||
$password = md5($_POST['pass']);
|
||||
try {
|
||||
$stmt = $conn->prepare("INSERT INTO users (name, email, mobile, access, pass) VALUES (:name, :email, :mobile, :access, :pass)");
|
||||
$stmt->bindParam(':name', $name);
|
||||
$stmt->bindParam(':email', $email);
|
||||
$stmt->bindParam(':mobile', $phone);
|
||||
$stmt->bindParam(':access', $access_value);
|
||||
$stmt->bindParam(':pass', $password);
|
||||
$stmt->execute();
|
||||
|
||||
echo "Record added successfully";
|
||||
} catch(PDOException $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div style="display: flex; flex-direction: column; justify-content: center; align-items: center; margin-top: 30px; margin-bottom: 30px;">
|
||||
<form action="" method="post" style="width: 600px; max-width: 600px; border: 1px solid #36365050; padding: 20px; border-radius: 20px; box-shadow: 0px 0px 10px 0px #363650;">
|
||||
<p style="font-size: 25px; font-weight: bold; margin-top: 10px; margin-bottom: 10px;">Add new user</p>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<label for="name">Name:</label>
|
||||
<input type="text" name="name" id="name" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" />
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<label for="email">E-mail:</label>
|
||||
<input type="text" name="email" id="email" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" />
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<label for="phone">Phone:</label>
|
||||
<input type="text" name="phone" id="phone" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" />
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<p>Access:</p>
|
||||
<?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 business_verticals");
|
||||
$stmt->execute();
|
||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$num_rows = $stmt->rowCount();
|
||||
if ($num_rows >= 1) {
|
||||
foreach($rows as $row){ ?>
|
||||
<div>
|
||||
<input type="checkbox" name="<?php echo $row['bv']; ?>" id="<?php echo $row['bv']; ?>" value="<?php echo $row['bv']; ?>" />
|
||||
<label for="<?php echo $row['bv']; ?>" style="text-transform: uppercase;"><?php echo $row['bv']; ?></label>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
} else{
|
||||
echo "<p class='text-danger'>Not Found any Data</p>";
|
||||
}
|
||||
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<p style="font-size: 16px; font-weight: bold; margin-top: 10px;">Access by state:</p>
|
||||
<div id="stateCheckboxes"></div>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<label for="pass">Password:</label>
|
||||
<input type="text" name="pass" id="pass" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" />
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<input type="submit" name="submit" id="submit" value="Submit" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); text-align: center; padding: 10px 20px 10px 20px; color: #fff; border-radius: 6px; float: right; margin-top: 30px;" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function fetchStates() {
|
||||
fetch(`https://api.siliconpin.com/v3/list/country/state/?country=IN`)
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
const stateCheckboxes = document.getElementById('stateCheckboxes');
|
||||
stateCheckboxes.innerHTML = ''; // Clear previous checkboxes
|
||||
|
||||
data.forEach(state => {
|
||||
const checkboxDiv = document.createElement('div');
|
||||
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.name = 'states[]'; // You might want to use an array here if submitting form
|
||||
checkbox.value = state.iso2;
|
||||
|
||||
const label = document.createElement('label');
|
||||
label.textContent = ' ' + state.name;
|
||||
label.style = 'text-transform: uppercase'
|
||||
|
||||
checkboxDiv.appendChild(checkbox);
|
||||
checkboxDiv.appendChild(label);
|
||||
|
||||
stateCheckboxes.appendChild(checkboxDiv);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
fetchStates();
|
||||
|
||||
</script>
|
||||
<style>
|
||||
/* For small screens */
|
||||
@media screen and (max-width: 767px) {
|
||||
#stateCheckboxes {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr); /* 2 columns */
|
||||
gap: 10px; /* Adjust the gap as needed */
|
||||
}
|
||||
}
|
||||
|
||||
/* For large screens */
|
||||
@media screen and (min-width: 768px) {
|
||||
#stateCheckboxes {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr); /* 3 columns */
|
||||
gap: 10px; /* Adjust the gap as needed */
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,122 +0,0 @@
|
||||
<?php
|
||||
require_once('.hta_config/crm_config.php');
|
||||
require_once('.htac_header.php');
|
||||
require_once('.htac_nav.php');
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
try {
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
$select_access = ['beanstalk', 'inhouse', 'teenybeans', 'iimtt', 'buzzapp', 'atheneum', 'teenybeans_curriculum'];
|
||||
$access_values_array = [];
|
||||
|
||||
foreach ($select_access as $access) {
|
||||
if (isset($_POST[$access])) {
|
||||
$access_values_array[] = $_POST[$access];
|
||||
}
|
||||
}
|
||||
$access_value = implode(',', $access_values_array);
|
||||
$name = $_POST['name'];
|
||||
$email = $_POST['email'];
|
||||
$phone = $_POST['phone'];
|
||||
$password = md5($_POST['pass']);
|
||||
$user_id = $_GET['id'];
|
||||
|
||||
$stmt = $conn->prepare("UPDATE users SET name = :name, email = :email, mobile = :mobile, access = :access, pass = :pass WHERE id = :id");
|
||||
$stmt->bindParam(':name', $name);
|
||||
$stmt->bindParam(':email', $email);
|
||||
$stmt->bindParam(':mobile', $phone);
|
||||
$stmt->bindParam(':access', $access_value);
|
||||
$stmt->bindParam(':pass', $password);
|
||||
$stmt->bindParam(':id', $user_id);
|
||||
$stmt->execute();
|
||||
|
||||
echo "Record updated successfully";
|
||||
} catch(PDOException $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?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 id = :id");
|
||||
$stmt->bindParam(':id', $_GET['id']);
|
||||
$stmt->execute();
|
||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$num_rows = $stmt->rowCount();
|
||||
if ($num_rows >= 1) {
|
||||
foreach($rows as $row){?>
|
||||
<div style="max-width: 600px;">
|
||||
<form action="" method="post">
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<label for="name">Name:</label>
|
||||
<input type="text" name="name" id="name" value="<?php echo $row['name'] ?>" />
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<label for="email">E-mail:</label>
|
||||
<input type="text" name="email" id="email" value="<?php echo $row['email'] ?>" />
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<label for="phone">Phone:</label>
|
||||
<input type="text" name="phone" id="phone" value="<?php echo $row['mobile'] ?>" />
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<p>Access:</p>
|
||||
<?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 business_verticals");
|
||||
$stmt->execute();
|
||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$num_rows = $stmt->rowCount();
|
||||
if ($num_rows >= 1) {
|
||||
$user_stmt = $conn->prepare("SELECT `access` FROM `users` WHERE `id` = '".$_GET["id"]."'");
|
||||
$user_stmt->execute();
|
||||
$user_bvs = $user_stmt->fetchAll(PDO::FETCH_COLUMN);
|
||||
$user_bvs=explode(",", $user_bvs[0]); // you need to make the CSV to array.
|
||||
foreach($rows as $row) {
|
||||
$isChecked = in_array($row['bv'], $user_bvs);
|
||||
?>
|
||||
<div>
|
||||
<input type="checkbox" name="bvs[]" id="<?php echo $row['bv']; ?>" value="<?php echo $row['bv']; ?>" <?php if($isChecked) echo "checked"; ?> />
|
||||
<label for="<?php echo $row['bv']; ?>" style="text-transform: uppercase;"><?php echo $row['bv']; ?></label>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
echo "<p class='text-danger'>Not Found any Data</p>";
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<label for="pass">Password:</label>
|
||||
<input type="text" name="pass" id="pass" />
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<input type="submit" name="submit" id="submit" value="Submit"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
}
|
||||
} else{
|
||||
echo "<p class='text-danger'>Not Found any Data</p>";
|
||||
}
|
||||
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
|
||||
?>
|
||||
File diff suppressed because one or more lines are too long
@@ -7,7 +7,7 @@
|
||||
<link rel="stylesheet" href="https://unpkg.com/gridjs/dist/theme/mermaid.min.css" />
|
||||
<script src="https://unpkg.com/gridjs/dist/gridjs.production.min.js"></script>
|
||||
<script src="https://unpkg.com/gridjs/plugins/selection/dist/selection.umd.js"></script>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script src="/assets/cdn.tailwindcss.com"></script>
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" />
|
||||
|
||||
<!-- <link rel="stylesheet" type="text/css" href="/assets/main.css" /> -->
|
||||
|
||||
@@ -1,157 +0,0 @@
|
||||
<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()">☰</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>
|
||||
@@ -1,203 +0,0 @@
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<nav class="navbar">
|
||||
<div class="navbar-container container">
|
||||
<input type="checkbox" name="" id="">
|
||||
<div class="hamburger-lines">
|
||||
<span class="line line1"></span>
|
||||
<span class="line line2"></span>
|
||||
<span class="line line3"></span>
|
||||
</div>
|
||||
<ul class="menu-items">
|
||||
<li><a href="/">Home</a></li>
|
||||
<?php if($_SESSION['user_type'] == "admin"){echo '<li><a href="/users">Users</a></li>';} ?>
|
||||
<li><a href="/cleads">Leads</a></li>
|
||||
<li><a href="#">Product</a></li>
|
||||
<li><a href="#">Testimonial</a></li>
|
||||
</ul>
|
||||
|
||||
<h1 class="logo">Logo
|
||||
<!-- <img style="height: 50px;" src="/assets/mgm_logo.jpg" alt="" /> -->
|
||||
</h1>
|
||||
</div>
|
||||
</nav>
|
||||
<div style="padding-bottom: 64px;"></div>
|
||||
<style>
|
||||
*,
|
||||
*::after,
|
||||
*::before{
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.navbar input[type="checkbox"],
|
||||
.navbar .hamburger-lines{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.container{
|
||||
max-width: 1200px;
|
||||
width: 90%;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.navbar{
|
||||
box-shadow: 0px 5px 10px 0px #aaa;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
opacity: 0.85;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.navbar-container{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 64px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.menu-items{
|
||||
order: 2;
|
||||
display: flex;
|
||||
}
|
||||
.logo{
|
||||
order: 1;
|
||||
font-size: 2.3rem;
|
||||
}
|
||||
|
||||
.menu-items li{
|
||||
list-style: none;
|
||||
margin-left: 1.5rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.navbar a{
|
||||
color: #444;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
transition: color 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.navbar a:hover{
|
||||
color: #117964;
|
||||
}
|
||||
|
||||
@media (max-width: 768px){
|
||||
.navbar{
|
||||
opacity: 0.95;
|
||||
}
|
||||
|
||||
.navbar-container input[type="checkbox"],
|
||||
.navbar-container .hamburger-lines{
|
||||
display: block;
|
||||
}
|
||||
|
||||
.navbar-container{
|
||||
display: block;
|
||||
position: relative;
|
||||
height: 64px;
|
||||
}
|
||||
|
||||
.navbar-container input[type="checkbox"]{
|
||||
position: absolute;
|
||||
display: block;
|
||||
height: 32px;
|
||||
width: 30px;
|
||||
top: 20px;
|
||||
left: 20px;
|
||||
z-index: 5;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.navbar-container .hamburger-lines{
|
||||
display: block;
|
||||
height: 28px;
|
||||
width: 35px;
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
left: 20px;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.navbar-container .hamburger-lines .line{
|
||||
display: block;
|
||||
height: 4px;
|
||||
width: 100%;
|
||||
border-radius: 10px;
|
||||
background: #333;
|
||||
}
|
||||
|
||||
.navbar-container .hamburger-lines .line1{
|
||||
transform-origin: 0% 0%;
|
||||
transition: transform 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.navbar-container .hamburger-lines .line2{
|
||||
transition: transform 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.navbar-container .hamburger-lines .line3{
|
||||
transform-origin: 0% 100%;
|
||||
transition: transform 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.navbar .menu-items{
|
||||
padding-top: 100px;
|
||||
background: #fff;
|
||||
height: 100vh;
|
||||
max-width: 300px;
|
||||
transform: translate(-150%);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-left: -40px;
|
||||
padding-left: 40px;
|
||||
transition: transform 0.5s ease-in-out;
|
||||
box-shadow: 5px 0px 10px 0px #aaa;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
.navbar .menu-items li{
|
||||
margin-bottom: 1.8rem;
|
||||
font-size: 1.1rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.logo{
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 15px;
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
|
||||
.navbar-container input[type="checkbox"]:checked ~ .menu-items{
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
.navbar-container input[type="checkbox"]:checked ~ .hamburger-lines .line1{
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.navbar-container input[type="checkbox"]:checked ~ .hamburger-lines .line2{
|
||||
transform: scaleY(0);
|
||||
}
|
||||
|
||||
.navbar-container input[type="checkbox"]:checked ~ .hamburger-lines .line3{
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media (max-width: 500px){
|
||||
.navbar-container input[type="checkbox"]:checked ~ .logo{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +1,6 @@
|
||||
<?php
|
||||
require_once('.hta_config/crm_config.php');
|
||||
if($_SESSION['user_type']=='admin'){
|
||||
$all_leads_url = '/leads';
|
||||
} else
|
||||
$all_leads_url = '/leads';
|
||||
|
||||
|
||||
|
||||
try {
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
@@ -17,23 +13,45 @@
|
||||
} 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>
|
||||
<p>CRM</p>
|
||||
<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">
|
||||
<div class="flex flex-row space-x-4">
|
||||
<a href="/notifications" class="flex flex-row"><i class="fa fa-bell">
|
||||
<?php
|
||||
if($total_notice > 0){
|
||||
echo '<span class="bg-[#FF0000] rounded-full px-1" style="margin-top: -10px;">'.$total_notice.'</span>';
|
||||
}
|
||||
?>
|
||||
<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>
|
||||
|
||||
|
||||
<!-- <span class="" style="background-color: #FF0000; padding-left: 4px; padding-right: 4px; border-radius: 50%; ">1</span> -->
|
||||
</i></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
|
||||
@@ -50,7 +68,7 @@
|
||||
$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>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>';
|
||||
}
|
||||
@@ -66,7 +84,7 @@
|
||||
<nav class="main-menu">
|
||||
<ul style="padding-top: 100px;">
|
||||
<li>
|
||||
<a href="<?php echo $all_leads_url; ?>">
|
||||
<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>
|
||||
@@ -200,7 +218,7 @@
|
||||
</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://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;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
name,email,phone,subject,message,details,origin,verticals,business_type,note,user,coupon_code,coupon
|
||||
Sample Name,sample@email.com,0,Sample Subject,Sample Message,Sample Details,Sample Origin ,Sample verticals,Sample business_type,Sample Note,user@siliconpin.com,Sample coupon_code,Sample coupon
|
||||
name,email,phone,subject,message,details,origin,verticals,business_type,note,user,coupon_code,coupon,country,state,lead_quality
|
||||
Sample Name,sample@email.com,0,Sample Subject,Sample Message,Sample Details,Sample Origin ,Sample verticals,Sample business_type,Sample Note,user@siliconpin.com,Sample coupon_code,Sample coupon ,IN,WB
|
||||
|
||||
|
BIN
assets/beanstalk-white-logo.webp
Normal file
BIN
assets/beanstalk-white-logo.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
62
assets/cdn.tailwindcss.com
Normal file
62
assets/cdn.tailwindcss.com
Normal file
File diff suppressed because one or more lines are too long
251
assets/countries.csv
Normal file
251
assets/countries.csv
Normal file
@@ -0,0 +1,251 @@
|
||||
"name";"iso2"
|
||||
"Afghanistan";"AF"
|
||||
"Aland Islands";"AX"
|
||||
"Albania";"AL"
|
||||
"Algeria";"DZ"
|
||||
"American Samoa";"AS"
|
||||
"Andorra";"AD"
|
||||
"Angola";"AO"
|
||||
"Anguilla";"AI"
|
||||
"Antarctica";"AQ"
|
||||
"Antigua And Barbuda";"AG"
|
||||
"Argentina";"AR"
|
||||
"Armenia";"AM"
|
||||
"Aruba";"AW"
|
||||
"Australia";"AU"
|
||||
"Austria";"AT"
|
||||
"Azerbaijan";"AZ"
|
||||
"The Bahamas";"BS"
|
||||
"Bahrain";"BH"
|
||||
"Bangladesh";"BD"
|
||||
"Barbados";"BB"
|
||||
"Belarus";"BY"
|
||||
"Belgium";"BE"
|
||||
"Belize";"BZ"
|
||||
"Benin";"BJ"
|
||||
"Bermuda";"BM"
|
||||
"Bhutan";"BT"
|
||||
"Bolivia";"BO"
|
||||
"Bosnia and Herzegovina";"BA"
|
||||
"Botswana";"BW"
|
||||
"Bouvet Island";"BV"
|
||||
"Brazil";"BR"
|
||||
"British Indian Ocean Territory";"IO"
|
||||
"Brunei";"BN"
|
||||
"Bulgaria";"BG"
|
||||
"Burkina Faso";"BF"
|
||||
"Burundi";"BI"
|
||||
"Cambodia";"KH"
|
||||
"Cameroon";"CM"
|
||||
"Canada";"CA"
|
||||
"Cape Verde";"CV"
|
||||
"Cayman Islands";"KY"
|
||||
"Central African Republic";"CF"
|
||||
"Chad";"TD"
|
||||
"Chile";"CL"
|
||||
"China";"CN"
|
||||
"Christmas Island";"CX"
|
||||
"Cocos (Keeling) Islands";"CC"
|
||||
"Colombia";"CO"
|
||||
"Comoros";"KM"
|
||||
"Congo";"CG"
|
||||
"Democratic Republic of the Congo";"CD"
|
||||
"Cook Islands";"CK"
|
||||
"Costa Rica";"CR"
|
||||
"Cote D'Ivoire (Ivory Coast)";"CI"
|
||||
"Croatia";"HR"
|
||||
"Cuba";"CU"
|
||||
"Cyprus";"CY"
|
||||
"Czech Republic";"CZ"
|
||||
"Denmark";"DK"
|
||||
"Djibouti";"DJ"
|
||||
"Dominica";"DM"
|
||||
"Dominican Republic";"DO"
|
||||
"East Timor";"TL"
|
||||
"Ecuador";"EC"
|
||||
"Egypt";"EG"
|
||||
"El Salvador";"SV"
|
||||
"Equatorial Guinea";"GQ"
|
||||
"Eritrea";"ER"
|
||||
"Estonia";"EE"
|
||||
"Ethiopia";"ET"
|
||||
"Falkland Islands";"FK"
|
||||
"Faroe Islands";"FO"
|
||||
"Fiji Islands";"FJ"
|
||||
"Finland";"FI"
|
||||
"France";"FR"
|
||||
"French Guiana";"GF"
|
||||
"French Polynesia";"PF"
|
||||
"French Southern Territories";"TF"
|
||||
"Gabon";"GA"
|
||||
"Gambia The";"GM"
|
||||
"Georgia";"GE"
|
||||
"Germany";"DE"
|
||||
"Ghana";"GH"
|
||||
"Gibraltar";"GI"
|
||||
"Greece";"GR"
|
||||
"Greenland";"GL"
|
||||
"Grenada";"GD"
|
||||
"Guadeloupe";"GP"
|
||||
"Guam";"GU"
|
||||
"Guatemala";"GT"
|
||||
"Guernsey and Alderney";"GG"
|
||||
"Guinea";"GN"
|
||||
"Guinea-Bissau";"GW"
|
||||
"Guyana";"GY"
|
||||
"Haiti";"HT"
|
||||
"Heard Island and McDonald Islands";"HM"
|
||||
"Honduras";"HN"
|
||||
"Hong Kong S.A.R.";"HK"
|
||||
"Hungary";"HU"
|
||||
"Iceland";"IS"
|
||||
"India";"IN"
|
||||
"Indonesia";"ID"
|
||||
"Iran";"IR"
|
||||
"Iraq";"IQ"
|
||||
"Ireland";"IE"
|
||||
"Israel";"IL"
|
||||
"Italy";"IT"
|
||||
"Jamaica";"JM"
|
||||
"Japan";"JP"
|
||||
"Jersey";"JE"
|
||||
"Jordan";"JO"
|
||||
"Kazakhstan";"KZ"
|
||||
"Kenya";"KE"
|
||||
"Kiribati";"KI"
|
||||
"North Korea";"KP"
|
||||
"South Korea";"KR"
|
||||
"Kuwait";"KW"
|
||||
"Kyrgyzstan";"KG"
|
||||
"Laos";"LA"
|
||||
"Latvia";"LV"
|
||||
"Lebanon";"LB"
|
||||
"Lesotho";"LS"
|
||||
"Liberia";"LR"
|
||||
"Libya";"LY"
|
||||
"Liechtenstein";"LI"
|
||||
"Lithuania";"LT"
|
||||
"Luxembourg";"LU"
|
||||
"Macau S.A.R.";"MO"
|
||||
"North Macedonia";"MK"
|
||||
"Madagascar";"MG"
|
||||
"Malawi";"MW"
|
||||
"Malaysia";"MY"
|
||||
"Maldives";"MV"
|
||||
"Mali";"ML"
|
||||
"Malta";"MT"
|
||||
"Man (Isle of)";"IM"
|
||||
"Marshall Islands";"MH"
|
||||
"Martinique";"MQ"
|
||||
"Mauritania";"MR"
|
||||
"Mauritius";"MU"
|
||||
"Mayotte";"YT"
|
||||
"Mexico";"MX"
|
||||
"Micronesia";"FM"
|
||||
"Moldova";"MD"
|
||||
"Monaco";"MC"
|
||||
"Mongolia";"MN"
|
||||
"Montenegro";"ME"
|
||||
"Montserrat";"MS"
|
||||
"Morocco";"MA"
|
||||
"Mozambique";"MZ"
|
||||
"Myanmar";"MM"
|
||||
"Namibia";"NA"
|
||||
"Nauru";"NR"
|
||||
"Nepal";"NP"
|
||||
"Bonaire, Sint Eustatius and Saba";"BQ"
|
||||
"Netherlands";"NL"
|
||||
"New Caledonia";"NC"
|
||||
"New Zealand";"NZ"
|
||||
"Nicaragua";"NI"
|
||||
"Niger";"NE"
|
||||
"Nigeria";"NG"
|
||||
"Niue";"NU"
|
||||
"Norfolk Island";"NF"
|
||||
"Northern Mariana Islands";"MP"
|
||||
"Norway";"NO"
|
||||
"Oman";"OM"
|
||||
"Pakistan";"PK"
|
||||
"Palau";"PW"
|
||||
"Palestinian Territory Occupied";"PS"
|
||||
"Panama";"PA"
|
||||
"Papua new Guinea";"PG"
|
||||
"Paraguay";"PY"
|
||||
"Peru";"PE"
|
||||
"Philippines";"PH"
|
||||
"Pitcairn Island";"PN"
|
||||
"Poland";"PL"
|
||||
"Portugal";"PT"
|
||||
"Puerto Rico";"PR"
|
||||
"Qatar";"QA"
|
||||
"Reunion";"RE"
|
||||
"Romania";"RO"
|
||||
"Russia";"RU"
|
||||
"Rwanda";"RW"
|
||||
"Saint Helena";"SH"
|
||||
"Saint Kitts And Nevis";"KN"
|
||||
"Saint Lucia";"LC"
|
||||
"Saint Pierre and Miquelon";"PM"
|
||||
"Saint Vincent And The Grenadines";"VC"
|
||||
"Saint-Barthelemy";"BL"
|
||||
"Saint-Martin (French part)";"MF"
|
||||
"Samoa";"WS"
|
||||
"San Marino";"SM"
|
||||
"Sao Tome and Principe";"ST"
|
||||
"Saudi Arabia";"SA"
|
||||
"Senegal";"SN"
|
||||
"Serbia";"RS"
|
||||
"Seychelles";"SC"
|
||||
"Sierra Leone";"SL"
|
||||
"Singapore";"SG"
|
||||
"Slovakia";"SK"
|
||||
"Slovenia";"SI"
|
||||
"Solomon Islands";"SB"
|
||||
"Somalia";"SO"
|
||||
"South Africa";"ZA"
|
||||
"South Georgia";"GS"
|
||||
"South Sudan";"SS"
|
||||
"Spain";"ES"
|
||||
"Sri Lanka";"LK"
|
||||
"Sudan";"SD"
|
||||
"Suriname";"SR"
|
||||
"Svalbard And Jan Mayen Islands";"SJ"
|
||||
"Swaziland";"SZ"
|
||||
"Sweden";"SE"
|
||||
"Switzerland";"CH"
|
||||
"Syria";"SY"
|
||||
"Taiwan";"TW"
|
||||
"Tajikistan";"TJ"
|
||||
"Tanzania";"TZ"
|
||||
"Thailand";"TH"
|
||||
"Togo";"TG"
|
||||
"Tokelau";"TK"
|
||||
"Tonga";"TO"
|
||||
"Trinidad And Tobago";"TT"
|
||||
"Tunisia";"TN"
|
||||
"Turkey";"TR"
|
||||
"Turkmenistan";"TM"
|
||||
"Turks And Caicos Islands";"TC"
|
||||
"Tuvalu";"TV"
|
||||
"Uganda";"UG"
|
||||
"Ukraine";"UA"
|
||||
"United Arab Emirates";"AE"
|
||||
"United Kingdom";"GB"
|
||||
"United States";"US"
|
||||
"United States Minor Outlying Islands";"UM"
|
||||
"Uruguay";"UY"
|
||||
"Uzbekistan";"UZ"
|
||||
"Vanuatu";"VU"
|
||||
"Vatican City State (Holy See)";"VA"
|
||||
"Venezuela";"VE"
|
||||
"Vietnam";"VN"
|
||||
"Virgin Islands (British)";"VG"
|
||||
"Virgin Islands (US)";"VI"
|
||||
"Wallis And Futuna Islands";"WF"
|
||||
"Western Sahara";"EH"
|
||||
"Yemen";"YE"
|
||||
"Zambia";"ZM"
|
||||
"Zimbabwe";"ZW"
|
||||
"Kosovo";"XK"
|
||||
"Cura<EFBFBD>ao";"CW"
|
||||
"Sint Maarten (Dutch part)";"SX"
|
||||
|
37
assets/states.csv
Normal file
37
assets/states.csv
Normal file
@@ -0,0 +1,37 @@
|
||||
"name";"iso2"
|
||||
"Meghalaya";"ML"
|
||||
"Haryana";"HR"
|
||||
"Maharashtra";"MH"
|
||||
"Goa";"GA"
|
||||
"Manipur";"MN"
|
||||
"Puducherry";"PY"
|
||||
"Telangana";"TG"
|
||||
"Odisha";"OR"
|
||||
"Rajasthan";"RJ"
|
||||
"Punjab";"PB"
|
||||
"Uttarakhand";"UT"
|
||||
"Andhra Pradesh";"AP"
|
||||
"Nagaland";"NL"
|
||||
"Lakshadweep";"LD"
|
||||
"Himachal Pradesh";"HP"
|
||||
"Delhi";"DL"
|
||||
"Uttar Pradesh";"UP"
|
||||
"Andaman and Nicobar Islands";"AN"
|
||||
"Arunachal Pradesh";"AR"
|
||||
"Jharkhand";"JH"
|
||||
"Karnataka";"KA"
|
||||
"Assam";"AS"
|
||||
"Kerala";"KL"
|
||||
"Jammu and Kashmir";"JK"
|
||||
"Gujarat";"GJ"
|
||||
"Chandigarh";"CH"
|
||||
"Dadra and Nagar Haveli and Daman and Diu";"DH"
|
||||
"Sikkim";"SK"
|
||||
"Tamil Nadu";"TN"
|
||||
"Mizoram";"MZ"
|
||||
"Bihar";"BR"
|
||||
"Tripura";"TR"
|
||||
"Madhya Pradesh";"MP"
|
||||
"Chhattisgarh";"CT"
|
||||
"Ladakh";"LA"
|
||||
"West Bengal";"WB"
|
||||
|
BIN
favicon.ico
Normal file
BIN
favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
3
robots.txt
Normal file
3
robots.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
# hestiacp autogenerated robots.txt
|
||||
User-agent: *
|
||||
Crawl-delay: 10
|
||||
Reference in New Issue
Block a user