This commit is contained in:
Suvodip
2024-08-31 18:49:18 +05:30
parent 2056e1e4af
commit 2eca9ab2c6
10 changed files with 390 additions and 33 deletions

View File

@@ -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="">&#10008</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