Compare commits

...

2 Commits

Author SHA1 Message Date
85efaca248 color: inherit 2023-12-08 01:17:20 +01:00
39c564fb89 $_SESSION["sudokuGridSolutions"] 2023-12-08 01:17:06 +01:00
2 changed files with 7 additions and 7 deletions

View File

@ -1,8 +1,8 @@
<?php
require("classes.php");
session_start();
if (!array_key_exists("nbSolutions", $_SESSION)) {
$_SESSION["nbSolutions"] = array();
if (!array_key_exists("sudokuGridSolutions", $_SESSION)) {
$_SESSION["sudokuGridSolutions"] = array();
}
$fullUrl = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"].$_SERVER["DOCUMENT_URI"];
@ -10,12 +10,12 @@
$currentGrid = strip_tags($_SERVER['QUERY_STRING']);
if (preg_match("/^[1-9.]{81}$/", $currentGrid)) {
if (!array_key_exists($currentGrid, $_SESSION["nbSolutions"])) {
if (!array_key_exists($currentGrid, $_SESSION["sudokuGridSolutions"])) {
$grid = new Grid();
$grid->import($currentGrid);
$_SESSION["nbSolutions"][$currentGrid] = $grid->containsDuplicates() ? -1 : $grid->countSolutions(2);
$_SESSION["sudokuGridSolutions"][$currentGrid] = $grid->containsDuplicates() ? -1 : $grid->countSolutions(2);
}
switch($_SESSION["nbSolutions"][$currentGrid]) {
switch($_SESSION["sudokuGridSolutions"][$currentGrid]) {
case -1:
$warning = "Cette grille contient des doublons.";
break;
@ -33,7 +33,7 @@
$grid->generate();
$gridAsString = $grid->toString();
$newGridUrl = "$dirUrl/?$gridAsString";
$_SESSION["nbSolutions"][$gridAsString] = 1;
$_SESSION["sudokuGridSolutions"][$gridAsString] = 1;
if ($currentGrid) {
require("400.php");
} else {

View File

@ -30,7 +30,7 @@ table.table-success input,
td.table-danger input:disabled,
table input:not([disabled]) {
background: transparent !important;
color: var(--bs-table-color-state,var(--bs-table-color-type,var(--bs-table-color)));
color: inherit !important;
}
table input:disabled {