35 lines
778 B
PHP
35 lines
778 B
PHP
<?php
|
|
require __DIR__ . '/../db.php';
|
|
|
|
|
|
if ($_POST) {
|
|
// === Dodajemy miejsce ===
|
|
$stmt = $pdo->prepare("
|
|
INSERT INTO salon_places (name, woj)
|
|
VALUES (?, ?)
|
|
");
|
|
$stmt->execute([
|
|
$_POST['name'],
|
|
$_POST['woj'] ?: null
|
|
]);
|
|
$placeId = $pdo->lastInsertId();
|
|
|
|
// === Dodajemy sklep (shop) ===
|
|
$stmt = $pdo->prepare("
|
|
INSERT INTO shops (place_id, address, open_hours, url_address, url_shop, lat, lng)
|
|
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
");
|
|
$stmt->execute([
|
|
$placeId,
|
|
$_POST['address'] ?: null,
|
|
$_POST['open_hours'] ?: null,
|
|
$_POST['url_address'],
|
|
$_POST['url_shop'],
|
|
$_POST['lat'],
|
|
$_POST['lng'],
|
|
]);
|
|
|
|
header('Location: ../');
|
|
exit;
|
|
}
|