Compare commits

...

27 Commits
piotrb ... dev

Author SHA1 Message Date
james c2c4d68837 6 commit 2024-05-21 10:30:06 +02:00
james d87b07ad38 6 commit 2024-05-21 10:12:02 +02:00
james b89ee1e8b5 fifth commit 2024-05-21 10:05:17 +02:00
james a1fd1497a1 fourth commit 2024-05-21 09:54:31 +02:00
james 5f5c9affe6 Merge branch 'jakubk' into dev 2024-05-21 09:51:18 +02:00
u1 3cc3e92d8b clean code 2024-05-21 08:24:27 +01:00
u1 d7505f59d3 u 2024-05-21 07:57:17 +01:00
Twoje Imię Nazwisko edff1c9ebd merge fix 2024-05-20 14:02:52 +02:00
piotrb 65c5b61829 merge 2024-05-20 12:08:44 +02:00
piotrb bdda7e717f i 2024-05-20 11:38:56 +02:00
piotrb e527916149 dane przekazane do funkcji 2024-05-20 10:32:10 +02:00
james 3594287422 third commit 2024-05-20 10:25:16 +02:00
piotrb 24dc33d4cf Merge branch 'PiotrB' into dev 2024-05-20 10:09:18 +02:00
piotrb 2ac625d825 qstack + localhost 2024-05-20 10:04:52 +02:00
james c225a7d197 Merge branch 'jakubk' into dev 2024-05-20 07:50:30 +02:00
james e36e092d1d second commit 2024-05-20 07:49:37 +02:00
james d08593c413 Merge branch 'jakubk' into dev 2024-05-20 07:34:46 +02:00
pawel 817002a439 db update 2024-05-20 07:24:59 +02:00
pawel d8a7ad5383 fetch 2024-05-20 07:24:17 +02:00
james d2145779c4 test commit 2024-05-20 07:23:09 +02:00
pawel 0cf2d32d88 rob 2024-05-20 07:21:55 +02:00
piotrb 433fcc4754 init 2024-05-20 07:14:55 +02:00
pawel e2c94ceeb1 poprawione 2024-05-17 10:26:17 +02:00
pawel c9adecf9b0 splot js + db 2024-05-17 10:12:11 +02:00
pawel 364c6f3ca9 Merge branch 'pawelk' into dev 2024-05-17 10:07:06 +02:00
pawel 7e73a7cea6 css 2024-05-17 09:40:03 +02:00
pawel 2455fa869f dodanie plikow 2024-05-15 10:27:15 +02:00
4 changed files with 114 additions and 14 deletions

View File

@ -1,7 +1,22 @@
const url = "http://localhost/15.05/get.php"
const url = "http://localhost/dev/get.php"
// const url = "http://qstack.pl:8080/z1/get.php"
let lista
fetch( url + 'get.php')
fetch(url)
.then(response => response.json())
.then( data => {
console.log(data)
})
.then(data => {
wyswietlSufiksy(data)
});
function wyswietlSufiksy(data) {
data.forEach((element) => document.querySelector('#nieposortowane').innerHTML += `<li> ${JSON.stringify(element.osoby)} </li>`);
}
document.getElementById("nieposortowane").onmouseover = function() {mouseOver()};
document.getElementById("nieposortowane").onmouseout = function() {mouseOut()};
function mouseOver() {
document.getElementById("nieposortowane").style.color = "red";
}
function mouseOut() {
document.getElementById("nieposortowane").style.color = "black";
}

11
get.php
View File

@ -1,13 +1,14 @@
<?
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "";
$dbname = "osoby";
<?php
$dbhost = "qstack.pl";
$dbuser = "boost";
$dbpass = "pass";
$dbname = "db";
$conn = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);
$ans = mysqli_query($conn, "SELECT * FROM osoby");
$json = array();
while ($row = mysqli_fetch_assoc($ans)) {
$json[] = $row;
}

View File

@ -1,13 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<title>Sortowanie Sufiksów</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Sortowanie Sufiksów</h1>
<button onclick="wyswietlSufiksy()">Wyswietl Sufiksy</button>
<h2>Nieposortowane Sufiksy</h2>
<div class="pre" id="nieposortowane"></div>
<h2>Posortowane Sufiksy</h2>
<div class="pre" id="posortowane"></div>
<script src="fetch.js"></script>
<li id="lista">
<ol></ol>
</li>
</body>
</html>

69
styles.css Normal file
View File

@ -0,0 +1,69 @@
body {
font-family: Arial, sans-serif;
background-color: #f7f7f7f5;
color: #333;
margin: 0;
padding: 20px;
line-height: 1.6;
}
h1 {
text-align: center;
color: #0056b3;
margin-bottom: 20px;
}
input[type="text"] {
width: calc(100% - 22px);
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
button {
display: block;
width: 100%;
padding: 10px;
background-color: #0056b3;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
}
button:hover {
background-color: #004494;
}
h2 {
color: #0056b3;
border-bottom: 2px solid #0056b3;
padding-bottom: 5px;
margin-top: 20px;
}
#nieposortowane {
display: flex;
flex-direction: column;
}
/* li:hover {
color: red;
font-weight: bold;
}
#nieposortowane:hover {
background-color: white;
} */
/* .pre {
background-color: #fff;
border: 1px solid #ccc;
padding: 10px;
border-radius: 4px;
overflow-x: auto;
} */