s1
This commit is contained in:
@@ -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) VALUES (:name, :email, :phone, 'crm-portal', :note, :details, :origin, '5', :business_type, 'New', :country, :state)");
|
||||
$stmt->bindParam(':name', $data[0]);
|
||||
$stmt->bindParam(':email', $data[1]);
|
||||
$stmt->bindParam(':phone', $data[2]);
|
||||
@@ -26,6 +26,8 @@ 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]);
|
||||
|
||||
// Execute the SQL statement
|
||||
$stmt->execute();
|
||||
@@ -46,6 +48,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 +87,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
|
||||
|
||||
@@ -366,7 +366,7 @@
|
||||
"callbackData" => "some text here",
|
||||
"type" => "Template",
|
||||
"template" => [
|
||||
"name" => "boost_conversion",
|
||||
"name" => $_GET['send-whatsapp-id'],
|
||||
"languageCode" => "en",
|
||||
"headerValues" => [
|
||||
"header_variable_value"
|
||||
@@ -391,12 +391,14 @@
|
||||
$context = stream_context_create($options);
|
||||
$fp = fopen($url, 'r', false, $context);
|
||||
if ($fp === FALSE) {
|
||||
echo 'Error occurred';
|
||||
// echo 'Error occurred';
|
||||
echo $fp;
|
||||
} else {
|
||||
$response = stream_get_contents($fp);
|
||||
|
||||
if ($response === FALSE) {
|
||||
echo 'Error reading response';
|
||||
// echo 'Error reading response';
|
||||
// echo $response;
|
||||
} else {
|
||||
if(isset($_GET['send-whatsapp-id'])){
|
||||
$templateName = $_GET['send-whatsapp-id'];
|
||||
@@ -632,7 +634,6 @@
|
||||
<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>
|
||||
<p><?php echo $saved_message; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
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>';
|
||||
}
|
||||
?>
|
||||
@@ -184,7 +184,7 @@
|
||||
<!-- 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..." style="border: 2px solid #8E8E8E;">
|
||||
<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>
|
||||
@@ -254,7 +254,7 @@
|
||||
|
||||
// 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."%");
|
||||
$stmt->bindValue(':searchTerm', "%$searchTerm%");
|
||||
@@ -445,7 +445,7 @@ echo'<div class="flex flex-row justify-between">
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
$leadsWithComments = []; // Initialize an array to hold leads with comments
|
||||
$leadsWithComments = [];
|
||||
|
||||
foreach ($leads as $singleLead) {
|
||||
try {
|
||||
|
||||
@@ -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,7 +129,17 @@
|
||||
}
|
||||
}
|
||||
?>
|
||||
<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 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>
|
||||
@@ -165,7 +174,7 @@
|
||||
<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>
|
||||
@@ -200,6 +209,7 @@
|
||||
<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 >
|
||||
@@ -226,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."%");
|
||||
@@ -238,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
|
||||
@@ -284,6 +294,7 @@
|
||||
</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>
|
||||
<td class="border-y-2 p-2"><?php echo $lead['date'] ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
|
||||
@@ -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,15 +42,15 @@
|
||||
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['lead_name'].' '. $notification_batch; ?></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);
|
||||
|
||||
Reference in New Issue
Block a user