change some desgine
This commit is contained in:
@@ -175,6 +175,7 @@
|
||||
<!-- <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%);">Downloat 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;">
|
||||
@@ -188,10 +189,9 @@
|
||||
?>
|
||||
<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')
|
||||
@@ -205,12 +205,13 @@
|
||||
</div>
|
||||
</th>';
|
||||
?>
|
||||
<th class="border-b-2 p-3 text-left">Name</th>
|
||||
<th class="border-b-2 p-3 text-left">ID</th>
|
||||
<th class="border-b-2 p-3 text-left">Status Update</th>
|
||||
<!-- <th class=" border-b-2 p-3">Contact Detail</th> -->
|
||||
<th class="border-b-2 p-3 text-left">Form Name</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 >
|
||||
@@ -233,7 +234,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);
|
||||
@@ -264,11 +265,15 @@
|
||||
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'];}
|
||||
?>
|
||||
@@ -278,7 +283,9 @@
|
||||
<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">
|
||||
@@ -286,7 +293,7 @@
|
||||
<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="whitespace-nowrap border-y-2 p-2"><?php echo $only_date; ?></td>
|
||||
<td class="border-y-2 p-2"><?php echo $lead['user'] ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
@@ -306,7 +313,6 @@ $getParams = $_GET; unset($getParams['page']); $getParams['page'] = $page-1;
|
||||
$getParams['page'] = $page+1; $nextkPage= http_build_query($getParams);
|
||||
// echo $totalPages;
|
||||
echo'<div class="flex flex-row justify-between">
|
||||
<button onclick="downloadCSV(data, filename)" class="fa fa-download text-[#fff] rounded-lg py-2 " style="background: linear-gradient(90deg, rgba(70, 68, 142, 0.91) 0%, rgba(120, 117, 244, 0.91) 100%);"></button>
|
||||
<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>
|
||||
@@ -516,6 +522,45 @@ echo'<div class="flex flex-row justify-between">
|
||||
</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;
|
||||
|
||||
Reference in New Issue
Block a user