<?php include_once 'controller/ApiYandexController.php'; $start = new ApiYandexController(); $data = false; if (!empty($_POST) && !empty($_POST['iname']) && !empty($_POST['fname']) && !empty($_POST['login']) && !empty($_POST['password']) && !empty($_POST['domain'])) { $data = $start->addUser($_POST); header('Location:index.php'); } $domains = $start->actionAdd(); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <link href="css/main.css" type="text/css" rel="stylesheet"> </head> <body> <div class="body"> <div class="menu"> <a href="index.php">Назад</a> </div> <hr> <h3>Добавление нового пользователя</h3> <form action="add.php" method="post" autocomplete="off"> <input type="text" name="iname" placeholder="Имя" autocomplete="off"> <input type="text" name="fname" placeholder="Фамилия" autocomplete="off"> <select name="domain"> <?php foreach ($domains as $domain) { ?>
<?php include_once 'controller/ApiYandexController.php'; header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0'); $start = new ApiYandexController(); $data = $start->actionIndex(); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <link href="css/main.css" type="text/css" rel="stylesheet"> </head> <body> <div class="body"> <div class="menu"> <a href="add.php">Добавить</a> </div> <hr> <h3>Список пользователей</h3> <table class="table"> <th>Пользователь</th> <th>Почта</th> <th>Пароль</th> <th></th> <th></th> <?php foreach ($data as $value) { ?> <tr> <td><?php
<?php include_once 'controller/ApiYandexController.php'; if (!empty($_GET['login']) && !empty($_GET['domain'])) { $start = new ApiYandexController(); if ($start->deleteUser($_GET)) { header('Location:index.php'); } else { echo 'Error'; } } else { header('Location:index.php'); }
<?php include_once 'controller/ApiYandexController.php'; $start = new ApiYandexController(); $id = (int) $_GET['id']; $data = false; if ($_POST) { $data = $start->updateUser($_POST); header('Location:index.php'); } if ($id) { $user = $start->actionUpdate($id); $username = explode(' ', $user->username); } else { die; } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <link href="css/main.css" type="text/css" rel="stylesheet"> </head> <body> <div class="body"> <div class="menu"> <a href="index.php">Назад</a> </div> <hr> <h3>Редактирование пользователя: <b><?php echo $user->username ? $user->username : '';