init
This commit is contained in:
51
.hta_slug/users/_home copy.php
Normal file
51
.hta_slug/users/_home copy.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
require_once('/var/www/html/.hta_config/crm_config.php');
|
||||
require_once('/var/www/html/.htac_header.php');
|
||||
require_once('/var/www/html/.htac_nav.php');
|
||||
?>
|
||||
|
||||
<div>
|
||||
<table style="overflow-x: auto;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">Name</th>
|
||||
<th style="text-align: center;">Email</th>
|
||||
<th style="text-align: center;">Phone</th>
|
||||
<th style="text-align: center;">Access</th>
|
||||
<th style="text-align: center;">Time</th>
|
||||
<th style="text-align: center;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?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");
|
||||
$stmt->execute();
|
||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$num_rows = $stmt->rowCount();
|
||||
if ($num_rows >= 1) {
|
||||
foreach($rows as $row){
|
||||
echo ' <tr>
|
||||
<td style="text-align: center;">'.$row['name'].'</td>
|
||||
<td style="text-align: center;">'.$row['email'].'</td>
|
||||
<td style="text-align: center;">'.$row['mobile'].'</td>
|
||||
<td style="text-align: center;">'.$row['access'].'</td>
|
||||
<td style="text-align: center;">'.$row['time'].'</td>
|
||||
<td style="text-align: center;"><a href="/users/edit-user/?id='.$row['id'].'">Edit</a> | <a href="/users/delete-user/?id='.$row['id'].'">Delete</a> </td>
|
||||
</tr>';
|
||||
}
|
||||
} else{
|
||||
echo "<p class='text-danger'>Not Found any Data</p>";
|
||||
}
|
||||
|
||||
} catch (PDOException $e) {
|
||||
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
Reference in New Issue
Block a user