document.querySelector('.login-form form').addEventListener('submit',function (el) {
el.preventDefault();
$.ajax({
type: "POST",
url: "./admin.php",
data: {
action: "administration",
login: document.querySelector('.login-form form #login').value,
pass: document.querySelector('.login-form form #pass').value,
},
success: function(data) { if (data == "OK") window.location = "admin.php";}
});
});
if ($_POST['action'] && $_POST['action'] === 'administration'){
if ($_POST['login'] === $login && $_POST['pass'] === $pass){
// тут нужно сделать всё, что нужно сделать
// .....
// а потом:
echo("OK"); exit();
}
}
echo "postgresql-10 hold" | sudo dpkg --set-selections
echo "postgresql-client-10 hold" | sudo dpkg --set-selections
echo "postgresql-client-common hold" | sudo dpkg --set-selections
echo "postgresql-common hold" | sudo dpkg --set-selections
echo "postgresql-doc-10 hold" | sudo dpkg --set-selections
echo "postgresql-server-dev-10 hold" | sudo dpkg --set-selections
sudo apt-mark hold postgresql-10
sudo apt-mark hold postgresql-client-10
sudo apt-mark hold postgresql-client-common
sudo apt-mark hold postgresql-common
sudo apt-mark hold postgresql-doc-10
sudo apt-mark hold postgresql-server-dev-10
$output = '';
foreach ($result as $row) { //здесь делаем двумерный массив
$found = false;
foreach ($result_days as $row_days) {
if ($row['date'] === $row_days['off_date'] && $row_days['off_id'] == 0) { //если выходной
$found = true;
// echo '<span>Выходной день</span><br>';
$sub_hours = (int)$row['sub_hours'];
$output = '
<tr>
<td>' . $row['name'] . '</td>
<td>' . ($sub_hours = $sub_hours - 0) . '</td>
<td>' . $row['date'] . '</td>
<td>Не рабочий день</td>
</tr>';
echo $output;
} else if ($row['date'] === $row_days['off_date'] && $row_days['off_id'] == 1) { //если сокращенка
$found = true;
$sub_hours = (int)$row['sub_hours'];
$sub_hours = $sub_hours - 7;
if ($sub_hours > 0) {
$output = '
<tr>
<td>' . $row['name'] . '</td>
<td>' . $sub_hours . '</td>
<td>' . $row['date'] . '</td>
<td>Сокращенный день</td>
</tr>';
echo $output;
}
}
}
if (!$found) { // рабочие дни
$sub_hours = (int)$row['sub_hours'];
$sub_hours = $sub_hours - 8;
if ($sub_hours > 0) {
$output = '
<tr>
<td>' . $row['name'] . '</td>
<td>' . $sub_hours . '</td>
<td>' . $row['date'] . '</td>
<td>Рабочий день</td>
</tr>';
echo $output;
}
}
}