users can now list their products

This commit is contained in:
Louis Vallat 2019-11-10 16:04:46 +01:00
parent a2dd6ddf83
commit fe1d13d28b

28
list-products.php Normal file
View File

@ -0,0 +1,28 @@
<?php
require_once("./assets/php/utils.php");
if (!is_connected()) {
header("location: login.php");
}
$product_list = "";
foreach (get_users_products_array() as $row) {
$product_list = $product_list . "<p>"
. htmlspecialchars($row["name"]) . "</p>\n";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>List products</title>
</head>
<body>
<?php echo $product_list; ?>
</body>
</html>