b2 #1
@@ -51,9 +51,9 @@
|
|||||||
foreach($rows as $row){
|
foreach($rows as $row){
|
||||||
$nameParts = explode(" ", $row['name']);
|
$nameParts = explode(" ", $row['name']);
|
||||||
$firstInitial = substr($nameParts[0], 0, 1);
|
$firstInitial = substr($nameParts[0], 0, 1);
|
||||||
$lastInitial = substr($nameParts[1], 0, 1);
|
$lastInitial = isset($nameParts[1]) ? substr($nameParts[1], 0, 1) : '';
|
||||||
// $lastInitial = substr($nameParts[count($nameParts) - 1], 0, 1);
|
$name_letter = $firstInitial . $lastInitial;
|
||||||
$name_letter = $firstInitial.$lastInitial;
|
|
||||||
if($row['status'] == 'New'){$conditional_background_color = 'background-color: #FFD9D9; border: 1px solid #FB5555; border-radius: 5px; color: #FB5555;';}
|
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'] == '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;';}
|
elseif($row['status'] == 'Disqualified'){$conditional_background_color = 'background-color: #CECECE; border: 1px solid #3F4254; border-radius: 5px; color: #3F4254;';}
|
||||||
@@ -413,7 +413,7 @@
|
|||||||
<label for="appt_date">Appointment Date</label>
|
<label for="appt_date">Appointment Date</label>
|
||||||
<input type="datetime-local" name="appt_date" id="appt_date" value="<?php echo $appt['appt_date'] ?>" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;" />
|
<input type="datetime-local" name="appt_date" id="appt_date" value="<?php echo $appt['appt_date'] ?>" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;" />
|
||||||
</div>
|
</div>
|
||||||
<input type="text" name="appointment_id" id="appointment_id" value="<?php echo $appt['id']; ?>">
|
<input type="hidden" name="appointment_id" id="appointment_id" value="<?php echo $appt['id']; ?>">
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<label for="appt-comment">Description (if needed)</label>
|
<label for="appt-comment">Description (if needed)</label>
|
||||||
<input type="text" name="comment" id="appt-comment" value="<?php echo $appt['comment'] ?>" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;" />
|
<input type="text" name="comment" id="appt-comment" value="<?php echo $appt['comment'] ?>" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;" />
|
||||||
|
|||||||
@@ -219,11 +219,13 @@
|
|||||||
$placeholderString = implode(',', array_fill(0, count($accessArray), '?'));
|
$placeholderString = implode(',', array_fill(0, count($accessArray), '?'));
|
||||||
|
|
||||||
//first query to get the total number for pagination
|
//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);
|
$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 = $conn->prepare($sql);
|
||||||
$stmt->bindValue(':businessVertical', $businessVertical);
|
$stmt->bindValue(':businessVertical', $businessVertical);
|
||||||
$stmt->bindValue(':searchTerm', "%".$searchTerm."%");
|
$stmt->bindValue(':searchTerm', "%".$searchTerm."%");
|
||||||
@@ -235,7 +237,7 @@
|
|||||||
|
|
||||||
// second & final query to get the page_view data
|
// 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 = $conn->prepare($sql);
|
||||||
$stmt->bindValue(':businessVertical', $businessVertical, PDO::PARAM_STR );
|
$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(':searchTerm', "%$searchTerm%"); // PDO::PARAM_STR is the default data type binding so is not needed
|
||||||
|
|||||||
83
.hta_slug/profile.php
Normal file
83
.hta_slug/profile.php
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
require_once('.hta_config/crm_config.php');
|
||||||
|
require_once('.htac_header.php');
|
||||||
|
require_once('.htac_nav.php');
|
||||||
|
$nameLetter = "";
|
||||||
|
?>
|
||||||
|
<section class="container mx-auto px-4 max-w-2xl rounded-xl mt-10 py-20 shadow-xl">
|
||||||
|
<p class="text-[25px] font-bold">Profile</p>
|
||||||
|
<div><?php echo $nameLetter; ?></div>
|
||||||
|
<form method="post" >
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if($_SERVER['REQUEST_METHOD'] == "POST"){
|
||||||
|
$convertPass = md5($_POST['pass']);
|
||||||
|
try {
|
||||||
|
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||||
|
$conn->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 '<script>window.location.href="/logout"</script>';
|
||||||
|
} 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;
|
||||||
|
?>
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-2 gap-6">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<label for="name">Name:</label>
|
||||||
|
<input type="text" name="name" id="" value="<?php echo $row['name']; ?>" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;">
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<label for="name">Email:</label>
|
||||||
|
<input type="text" name="email" id="" value="<?php echo $row['email']; ?>" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;">
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<label for="name">Mobile:</label>
|
||||||
|
<input type="text" name="mobile" id="" value="<?php echo $row['mobile']; ?>" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;">
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<label for="name">Access State:</label>
|
||||||
|
<p style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;" ><?php echo $row['states']; ?></p>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<label for="name">Access Business Verticals:</label>
|
||||||
|
<p style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;" ><?php echo $row['access']; ?></p>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<label for="name">Password:</label>
|
||||||
|
<input type="password" name="pass" id="" style="border: 1px solid #D9D9D9; border-radius: 5px; padding: 6px;">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||||
|
};
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<input class="mt-10 float-right" type="submit" value="Update Profile" 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;">
|
||||||
|
</form>
|
||||||
|
<p class="text-center font-bold text-[#FB5555] mt-10">if change profile information then login again</p>
|
||||||
|
</section>
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
$lastInitial = substr($nameParts[count($nameParts) - 1], 0, 1);
|
$lastInitial = substr($nameParts[count($nameParts) - 1], 0, 1);
|
||||||
echo ' <div style="display: flex; flex-direction: row; place-items: center">
|
echo ' <div style="display: flex; flex-direction: row; place-items: center">
|
||||||
<p>Hi <span>'.$nameParts[0].'</span></p>
|
<p>Hi <span>'.$nameParts[0].'</span></p>
|
||||||
<p 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.'</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>';
|
</div>';
|
||||||
}
|
}
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user