83
<input type="text" class="form-control"
name="customername" id="customername" value="<?php echo $customername
?>">
</div>
<div class="form-group">
<label for="address">Адрес</label>
<input type="text" class="form-control"
name="address" id="address" value="<?php echo $address ?>">
</div>
<div class="form-group">
<label for="phone">Номер телефона</label>
<input type="text" class="form-control"
name="phone" id="phone" value="<?php echo $phone ?>">
</div>
<div class="form-group">
<label for="email">Электронная почта</label>
<input type="email" class="form-control"
name="email" id="email" value="<?php echo $email ?>">
</div>
<button type="submit" class="btn btn-
success">Сохранить</button>
<a href="customers.php" class="btn btn-
info">Назад</a>
</form>
</div>
</div>
</div>
<?php require_once("../footer.php") ?>
<?php
if ($_POST) {
$name = trim(htmlspecialchars($_POST['name']));
$phone = trim(htmlspecialchars($_POST['phone'])) ?: null;
$email = trim(htmlspecialchars($_POST['email'])) ?: null;
if (!empty($name)) {
require_once("../DB.php");
$customers = R::dispense('managers');
$customers->name = $name;
$customers->phone = $phone;
$customers->email = $email;
R::store($customers);
header('location: managers.php?msg=Запись успешно добавлена!');
}
}
?>
<?php $title = "Добавить менеджера"; ?>
<?php require_once("../header.php") ?>
<div class="container" style="margin-top:30px; margin-bottom:
30px;">
<div class="row">