Init Commit

This commit is contained in:
ldy
2025-06-09 14:03:07 +08:00
parent 7d35000dd1
commit 2f40268f53
10 changed files with 451 additions and 0 deletions

28
fetch_block.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
include 'connectDB.php';
$cvId = $_GET['cvId'];
$tableName = $_GET['tableName'];
if ($tableName == 'profile'){
// visible: 0-private; 1-public; 2-authentication
$sql = "SELECT * FROM `profile` WHERE cid = $cvId AND (visible = 1 OR visible = 2)";
}
else{
$sql = "SELECT * FROM `$tableName` WHERE owner = $cvId and visible = 1 GROUP BY (sequence)";
}
$result = $conn->query($sql);
$tableData = [];
if ($result->num_rows > 0) {
// Loop through each row of the result set
while ($row = $result->fetch_assoc()) {
// Add each row to the $tableData array
$tableData[] = $row;
}
}
echo json_encode($tableData);
$conn->close();
?>