testing list providers
This commit is contained in:
1 parent
5ec16d4cbc
commit
2efd469f1e
7 files changed
+38
-12
No files matched your search
File renamed without changes.
+33
-7
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
$config = require __DIR__ . '/../config.php';
|
$config = require __DIR__ . '/../config.php';
|
||||||
|
$debug_output = false;
|
||||||
if (!isset($_SESSION['authenticated'])) {
|
if (!isset($_SESSION['authenticated'])) {
|
||||||
// User not logged in – show a login button
|
// User not logged in – show a login button
|
||||||
// echo '<h1>Welcome to the demo</h1>';
|
// echo '<h1>Welcome to the demo</h1>';
|
||||||
@@ -15,10 +15,36 @@ $name = $_SESSION['name'] ?? 'unknown';
|
|||||||
$email = $_SESSION['email'] ?? 'unknown';
|
$email = $_SESSION['email'] ?? 'unknown';
|
||||||
$groups = $_SESSION['groups'] ?? [];
|
$groups = $_SESSION['groups'] ?? [];
|
||||||
|
|
||||||
echo '<h1>Logged in as ' . htmlspecialchars($name) . '</h1>';
|
|
||||||
echo '<ul>';
|
|
||||||
echo '<li><strong>Email:</strong> ' . htmlspecialchars($email) . '</li>';
|
|
||||||
echo '<li><strong>Groups:</strong> ' . htmlspecialchars(implode(', ', $groups)) . '</li>';
|
|
||||||
echo '</ul>';
|
|
||||||
|
|
||||||
// echo '<p><a href="logout.php">Logout</a></p>';
|
|
||||||
|
if ($debug_output) {
|
||||||
|
echo '<h1>Logged in as ' . htmlspecialchars($name) . '</h1>';
|
||||||
|
echo '<ul>';
|
||||||
|
echo '<li><strong>Email:</strong> ' . htmlspecialchars($email) . '</li>';
|
||||||
|
echo '<li><strong>Groups:</strong> ' . htmlspecialchars(implode(', ', $groups)) . '</li>';
|
||||||
|
echo '</ul>';
|
||||||
|
}
|
||||||
|
// echo '<p><a href="logout.php">Logout</a></p>';
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Fitness Tracker</title>
|
||||||
|
<link rel="stylesheet" href="https://cosmostat.matt-cloud.com/src/styles.css">
|
||||||
|
<style>
|
||||||
|
body { font-family: Arial, sans-serif; margin: 2rem; }
|
||||||
|
#search { margin-bottom: 1rem; padding: 0.5rem; width: 300px; }
|
||||||
|
table { width: 100%; border-collapse: collapse; }
|
||||||
|
img { max-width: 60px; height: auto; }
|
||||||
|
.header-container { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
include_once('/../scripts/list_providers.php');
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
// When the form is submitted, it POSTs JSON to /providers.
|
// When the form is submitted, it POSTs JSON to /providers.
|
||||||
|
|
||||||
// file settings
|
// file settings
|
||||||
require_once __DIR__ . '/config.php';
|
require_once __DIR__ . '/../fitness-config.php';
|
||||||
|
|
||||||
// Helper to call the API -------------------------------------------
|
// Helper to call the API -------------------------------------------
|
||||||
function callApi(string $method, string $path, $body = null)
|
function callApi(string $method, string $path, $body = null)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// Edit an existing fitness provider.
|
// Edit an existing fitness provider.
|
||||||
// Handles rate options similar to add_provider.php.
|
// Handles rate options similar to add_provider.php.
|
||||||
|
|
||||||
require_once __DIR__ . '/config.php';
|
require_once __DIR__ . '/../fitness-config.php';
|
||||||
|
|
||||||
$provider_id = (int)($_GET['id'] ?? 0);
|
$provider_id = (int)($_GET['id'] ?? 0);
|
||||||
if ($provider_id <= 0) {
|
if ($provider_id <= 0) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
// The API endpoint for providers is /providers.
|
// The API endpoint for providers is /providers.
|
||||||
|
|
||||||
// file settings
|
// file settings
|
||||||
require_once __DIR__ . '/config.php';
|
require_once __DIR__ . '/../fitness-config.php';
|
||||||
// --- Helper to call the API -------------------------------------------
|
// --- Helper to call the API -------------------------------------------
|
||||||
function callApi(string $method, string $path, $body = null)
|
function callApi(string $method, string $path, $body = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
// The design follows the pattern used in list_providers.php.
|
// The design follows the pattern used in list_providers.php.
|
||||||
|
|
||||||
// file settings
|
// file settings
|
||||||
require_once __DIR__ . '/config.php';
|
require_once __DIR__ . '/../fitness-config.php';
|
||||||
|
|
||||||
// --- Helper to call the Flask API -------------------------------------------
|
// --- Helper to call the Flask API -------------------------------------------
|
||||||
function callApi(string $method, string $path, $body = null)
|
function callApi(string $method, string $path, $body = null)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once __DIR__.'/config.php';
|
require_once __DIR__ . '/../fitness-config.php';
|
||||||
|
|
||||||
function uploadPhotos($provider_id, $files) {
|
function uploadPhotos($provider_id, $files) {
|
||||||
$url = BASE_API_URL . "/api/providers/$provider_id/photos";
|
$url = BASE_API_URL . "/api/providers/$provider_id/photos";
|
||||||
|
|||||||
Reference in new issue
Block a user