edit user
This commit is contained in:
59
.hta_slug/leads/by-business-verticals copy.php
Normal file
59
.hta_slug/leads/by-business-verticals copy.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
require_once('.hta_config/crm_config.php');
|
||||
require_once('.htac_header.php');
|
||||
require_once('.htac_nav.php');
|
||||
// echo $_SESSION['access'];
|
||||
?>
|
||||
<?php
|
||||
// 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);
|
||||
// $num_rows = $stmt->rowCount();
|
||||
// foreach($rows as $row){
|
||||
// $user_access_data = explode(",", $row['access']);
|
||||
// foreach($user_access_data as $access_data){
|
||||
// echo '<div style="display: flex; flex-direction: row;"><a href="/cleads/by-business-verticals/?bv='.$access_data.'" style="margin: 10px;">'.$access_data.'</a></div>';
|
||||
// }
|
||||
// }
|
||||
// } catch (PDOException $e) {
|
||||
// echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
// }
|
||||
?>
|
||||
|
||||
<?php
|
||||
try {
|
||||
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$stmt = $conn->prepare("SELECT * FROM cleads WHERE business_type = :business_type ORDER BY time DESC");
|
||||
$stmt->bindParam(':business_type', $_GET['bv']);
|
||||
$stmt->execute();
|
||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
?>
|
||||
<div id="grid"></div>
|
||||
<script>
|
||||
const grid = new gridjs.Grid({
|
||||
columns: ["Name", {name: "ID", formatter: (cell) => {return gridjs.html(`<a href="/cleads/edit-lead/?id=${cell}">${cell}</a>`);}},"Status", "Email", "Phone", "Time", {name: "ID", formatter: (cell) => {return gridjs.html(`<a href="/cleads/delete-lead/?id=${cell}">Delete</a>`);}}],
|
||||
pagination: {limit: 100},
|
||||
search: true,
|
||||
sort: true,
|
||||
resizable: true,
|
||||
data: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
resolve(<?php echo json_encode($rows); ?>);
|
||||
}, 1000);
|
||||
});
|
||||
},
|
||||
loading: true
|
||||
});
|
||||
grid.render(document.getElementById("grid"));
|
||||
</script>
|
||||
<?php
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user