12 lines
768 B
PHP
12 lines
768 B
PHP
<?php
|
|
require_once __DIR__ . '/_secrets.php';
|
|
header("Content-Type: application/json");
|
|
header("Access-Control-Allow-Origin: *");
|
|
$pg = pg_connect("host=127.0.0.1 dbname=adx_system user=admin password=" . weval_secret('WEVAL_PG_ADMIN_PASS') . "");
|
|
if (!$pg) { echo json_encode(["error"=>"DB"]); exit; }
|
|
$total = pg_fetch_result(pg_query($pg, "SELECT count(*) FROM ethica.medecins"), 0, 0);
|
|
$email = pg_fetch_result(pg_query($pg, "SELECT count(*) FROM ethica.medecins WHERE email IS NOT NULL AND email!=''"), 0, 0);
|
|
$tel = pg_fetch_result(pg_query($pg, "SELECT count(*) FROM ethica.medecins WHERE telephone IS NOT NULL AND telephone!=''"), 0, 0);
|
|
echo json_encode(["ok"=>true,"total"=>(int)$total,"with_email"=>(int)$email,"with_telephone"=>(int)$tel]);
|
|
pg_close($pg);
|