From 72f4f36cb59351b7abb6debfe39ebc4a9c235642 Mon Sep 17 00:00:00 2001 From: Suvodip Date: Wed, 8 May 2024 17:58:56 +0530 Subject: [PATCH 1/3] upload state, country name --- .hta_slug/edit-lead.php | 59 ++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/.hta_slug/edit-lead.php b/.hta_slug/edit-lead.php index 87f4655..e33c227 100644 --- a/.hta_slug/edit-lead.php +++ b/.hta_slug/edit-lead.php @@ -93,15 +93,17 @@

Country

- +

State

- +

City

@@ -405,29 +407,19 @@
\ No newline at end of file diff --git a/.hta_slug/notifications/_home.php b/.hta_slug/notifications/_home.php index 9925fb8..d733a40 100644 --- a/.hta_slug/notifications/_home.php +++ b/.hta_slug/notifications/_home.php @@ -28,20 +28,6 @@
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - $stmt = $conn->prepare("UPDATE appointment SET view_status = 1 WHERE id = :status_id AND email = :email"); - $stmt->bindParam(':status_id', $_POST['status_id']); - $stmt->bindParam(':email', $_SESSION['email']); - $stmt->execute(); - $saved_message = "Appointment updated successfully"; - } 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); @@ -52,19 +38,26 @@ $stmt->execute(); $appt_data = $stmt->fetchAll(PDO::FETCH_ASSOC); foreach($appt_data as $appt){ + $leadID = json_decode($appt['leadid']); if($appt['view_status'] == 0){ $notification_bg = 'background: #F5F4FFE8;'; $notification_batch = '
'; + $clickButton = ''; }elseif($appt['view_status'] == 1){ $notification_bg = 'background: #fff;'; $notification_batch = '
'; + $clickButton = 'disabled'; } ?>
- @@ -77,5 +70,21 @@ echo "

Error: " . $e->getMessage() . "

"; }; + + if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST['status_id']) && $_POST['status_id']){ + try { + $conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass); + $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $stmt = $conn->prepare("UPDATE appointment SET view_status = 1 WHERE id = :status_id AND email = :email"); + $stmt->bindParam(':status_id', $_POST['status_id']); + $stmt->bindParam(':email', $_SESSION['email']); + $stmt->execute(); + // $saved_message = "Appointment upd ated successfully"; + echo ''; + } catch(PDOException $e) { + echo "Error: " . $e->getMessage(); + } + }; + ?>
\ No newline at end of file -- 2.49.1 From 7af59fdbdd4434d8368caaeac56e60cd9de77a22 Mon Sep 17 00:00:00 2001 From: Suvodip Date: Wed, 8 May 2024 23:29:29 +0530 Subject: [PATCH 3/3] c --- .hta_slug/edit-lead.php | 8 ++-- .hta_slug/my-leads.php | 10 +++-- .hta_slug/profile.php | 83 +++++++++++++++++++++++++++++++++++++++++ .htac_nav.php | 2 +- 4 files changed, 94 insertions(+), 9 deletions(-) create mode 100644 .hta_slug/profile.php diff --git a/.hta_slug/edit-lead.php b/.hta_slug/edit-lead.php index 454db12..83efff0 100644 --- a/.hta_slug/edit-lead.php +++ b/.hta_slug/edit-lead.php @@ -51,9 +51,9 @@ foreach($rows as $row){ $nameParts = explode(" ", $row['name']); $firstInitial = substr($nameParts[0], 0, 1); - $lastInitial = substr($nameParts[1], 0, 1); - // $lastInitial = substr($nameParts[count($nameParts) - 1], 0, 1); - $name_letter = $firstInitial.$lastInitial; + $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;';} elseif($row['status'] == 'Disqualified'){$conditional_background_color = 'background-color: #CECECE; border: 1px solid #3F4254; border-radius: 5px; color: #3F4254;';} @@ -413,7 +413,7 @@ - +
diff --git a/.hta_slug/my-leads.php b/.hta_slug/my-leads.php index 168feb0..6e18614 100644 --- a/.hta_slug/my-leads.php +++ b/.hta_slug/my-leads.php @@ -219,11 +219,13 @@ $placeholderString = implode(',', array_fill(0, count($accessArray), '?')); //first query to get the total number for pagination - $parts = explode(',', $_SESSION["states"]); + $states=$_SESSION["states"]; + if( strlen($_SESSION["states"]) <2 ) $states='no_states_access_selected'; + $parts = explode(',', $states); $quotedParts = array_map(function($item) { return "'" . $item . "'";}, $parts); - $newStr = implode(',', $quotedParts); + $stateAcc = implode(',', $quotedParts); - $sql= "SELECT COUNT(*) FROM cleads WHERE state IN ($newStr) 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 ) AND time BETWEEN :start_date AND :end_date "; $stmt = $conn->prepare($sql); $stmt->bindValue(':businessVertical', $businessVertical); $stmt->bindValue(':searchTerm', "%".$searchTerm."%"); @@ -235,7 +237,7 @@ // second & final query to get the page_view data - $sql = "SELECT * FROM cleads WHERE state IN ($newStr) 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 ) 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 diff --git a/.hta_slug/profile.php b/.hta_slug/profile.php new file mode 100644 index 0000000..6283acf --- /dev/null +++ b/.hta_slug/profile.php @@ -0,0 +1,83 @@ + +
+

Profile

+
+ + setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $stmt = $conn->prepare("UPDATE users SET name = :name, email = :email, pass = :pass WHERE email = :userID"); + $stmt->bindParam(':name', $_POST['name']); + $stmt->bindParam(':email', $_POST['email']); + $stmt->bindParam(':pass', $convertPass); + $stmt->bindParam(':userID', $_SESSION['email']); + $stmt->execute(); + + echo ''; + } 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 * FROM users WHERE email = :email"); + $stmt->bindParam(':email', $_SESSION['email']); + $stmt->execute(); + $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); + foreach($rows as $row){ + $nameParts = explode(" ", $row['name']); + $firstInitial = substr($nameParts[0], 0, 1); + $lastInitial = substr($nameParts[count($nameParts) - 1], 0, 1); + $nameLetter = $firstInitial.$lastInitial; + ?> +
+

+
+
+
+ + +
+
+ + +
+
+ + +
+
+ +

+
+
+ +

+
+
+ + +
+
+ Error: " . $e->getMessage() . "

"; + }; + ?> + + + + +

if change profile information then login again

+
\ No newline at end of file diff --git a/.htac_nav.php b/.htac_nav.php index a1d76d6..ace1603 100644 --- a/.htac_nav.php +++ b/.htac_nav.php @@ -51,7 +51,7 @@ $lastInitial = substr($nameParts[count($nameParts) - 1], 0, 1); echo '

Hi '.$nameParts[0].'

  -

'.$firstInitial.$lastInitial.'

+ '.$firstInitial.$lastInitial.'
'; } } catch (PDOException $e) { -- 2.49.1