-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start.cpp w tle, drobna zmiana w testbocie,
Naprawa rankingu, Dodanie nazwy zadania w wyświetlanych info, Zakomentowanie kolorów w modalu
- Loading branch information
Showing
5 changed files
with
77 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,66 @@ | ||
<?php | ||
if(!isset($AccessToContest)) //prawdopodobnie niezalogowany użytkownik | ||
{ | ||
header('Location: /'); | ||
exit(); | ||
} | ||
|
||
if(!$AccessToContest) //brak dostępu do zawodów | ||
{ | ||
$adres = 'Location: /'.$_GET['id']; | ||
header($adres); | ||
exit(); | ||
} | ||
|
||
$id_task = $_GET['task']; | ||
$zapytanie = $polaczenie->query("SELECT id_task FROM contest_list WHERE id_contest='$id_contest' AND id_task='$id_task'"); | ||
|
||
if(mysqli_num_rows($zapytanie)==0) //brak tego zadania w danych zawodach | ||
{ | ||
header('Location: /'); | ||
exit(); | ||
} | ||
|
||
$adres = $_SERVER['DOCUMENT_ROOT'].'/tasks/'.$_GET['task'].'/'.$_GET['task'].'.txt'; | ||
|
||
|
||
if(!file_exists($adres)) //czy istnieje plik | ||
{ | ||
echo "Błąd otwarcia treści zadania!"; | ||
}else | ||
{ | ||
|
||
echo ' | ||
<table style="width: 700px; border-bottom: 1px solid black; padding-bottom: 15px; margin-bottom: 15px;"> | ||
<tr> | ||
<td style="width: 30%; text-align: left;"> | ||
Identyfikator zadania: <b>'.$_GET['task'].'</b> | ||
</td> | ||
<td style="width: 40%; text-align: center;"> | ||
[ <a href="/'.$_GET['id'].'/'.$_GET['task'].'/submits">Zobacz wysłania</a> ] | ||
</td> | ||
<td style="width: 30%; text-align: right;"> | ||
[ <a href="/'.$_GET['id'].'/'.$_GET['task'].'/submit">Wyślij rozwiązanie</a> ] | ||
</td> | ||
</tr> | ||
</table> | ||
'; | ||
|
||
$plik = file($adres); | ||
$ile = count($plik); | ||
|
||
for($i=0;$i<$ile;$i++) | ||
{ | ||
//$plik[$i] = htmlentities($plik[$i], ENT_QUOTES, "UTF-8"); | ||
//$plik[$i] = utf8_encode($plik[$i]); | ||
$plik[$i] = preg_replace('#\r\n?#', "\n", $plik[$i]); | ||
$plik[$i] = str_replace(' ', ' ', $plik[$i]); | ||
echo $plik[$i]; | ||
echo '<br>'; | ||
} | ||
} | ||
|
||
<?php | ||
if(!isset($AccessToContest)) //prawdopodobnie niezalogowany użytkownik | ||
{ | ||
header('Location: /'); | ||
exit(); | ||
} | ||
|
||
if(!$AccessToContest) //brak dostępu do zawodów | ||
{ | ||
$adres = 'Location: /'.$_GET['id']; | ||
header($adres); | ||
exit(); | ||
} | ||
|
||
$id_task = $_GET['task']; | ||
$zapytanie = $polaczenie->query("SELECT id_task FROM contest_list WHERE id_contest='$id_contest' AND id_task='$id_task'"); | ||
|
||
if(mysqli_num_rows($zapytanie)==0) //brak tego zadania w danych zawodach | ||
{ | ||
header('Location: /'); | ||
exit(); | ||
} | ||
|
||
$adres = $_SERVER['DOCUMENT_ROOT'].'/tasks/'.$id_task.'/'.$id_task.'.txt'; | ||
|
||
if(!file_exists($adres)) //czy istnieje plik | ||
{ | ||
echo "Błąd otwarcia treści zadania!"; | ||
}else | ||
{ | ||
echo ' | ||
<table style="width: 700px; border-bottom: 1px solid black; padding-bottom: 15px; margin-bottom: 15px;"> | ||
<tr> | ||
<td style="width: 30%; text-align: left;"> | ||
Identyfikator zadania: <b>'.$id_task.'</b> | ||
</td> | ||
<td style="width: 40%; text-align: center;"> | ||
[ <a href="/'.$_GET['id'].'/'.$id_task.'/submits">Zobacz wysłania</a> ] | ||
</td> | ||
<td style="width: 30%; text-align: right;"> | ||
[ <a href="/'.$_GET['id'].'/'.$id_task.'/submit">Wyślij rozwiązanie</a> ] | ||
</td> | ||
</tr> | ||
</table>'; | ||
|
||
$zapytanie = $polaczenie->query("SELECT title_task FROM tasks WHERE id_task='$id_task'"); | ||
$rezultat = $zapytanie->fetch_assoc(); | ||
$title = $rezultat['title_task']; | ||
|
||
echo '<div style="font-weight: bold;">'.$title.'</div><br/> '; | ||
|
||
$plik = file($adres); | ||
$ile = count($plik); | ||
|
||
for($i=0;$i<$ile;$i++) | ||
{ | ||
//$plik[$i] = htmlentities($plik[$i], ENT_QUOTES, "UTF-8"); | ||
//$plik[$i] = utf8_encode($plik[$i]); | ||
$plik[$i] = preg_replace('#\r\n?#', "\n", $plik[$i]); | ||
$plik[$i] = str_replace(' ', ' ', $plik[$i]); | ||
echo $plik[$i]; | ||
echo '<br>'; | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters