Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions Classes/API.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

namespace Classes;

class API
{

private $config;
private $baseUrl = 'https://www.potterapi.com/v1/';

public function __construct()
{
$this->config = include 'config.php';
}

protected function makeRequest($method, array $params = [])
{
//methoda göre api url oluşturuyoruz
$apiUrl = $this->baseUrl.$method.'?key='.$this->config['api_key'];

//varsa ek parametreleri ekliyoruz özellikle karakterlerin evleri için
foreach ($params as $key => $value) {
$apiUrl .= '&'.$key.'='.$value;
}

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);


//hatalı parametreler için 409 dönüyor daha detaylı hata için aşağıda kontrol yapıldı
if ($statusCode !== 200 && $statusCode != 409) {
die('API bağlantısı çalışmıyor');
}
$array = json_decode($output, true);

if (isset($array['error'])) {
die('API parametreleri hatalı: '.$array['error']);
}

return $array;

}
}
41 changes: 41 additions & 0 deletions Classes/Character.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php


namespace Classes;


class Character extends API
{

private $validHouses = ['Gryffindor', 'Ravenclaw', 'Slytherin', 'Hufflepuff'];

public function getCharacters($house = null)
{

$params = [];

if ($house && !in_array($_GET['house'], $this->validHouses)) {
die('Böyle bir ev yok');
} elseif ($house) {
$params = ['house' => $house];
}


$characters = $this->makeRequest('characters', $params);

$list = [];

foreach ($characters as $character) {
$list[] = [
'name' => $character['name'],
'image' => 'assets/images/characters/'.$character['name'].'.jpg',
'house' => $character['house'] ?? '',
'role' => $character['role'] ?? '',
'bloodStatus' => $character['bloodStatus'],
'species' => $character['species']
];
}

return $list;
}
}
32 changes: 32 additions & 0 deletions Classes/House.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php


namespace Classes;


class House extends API
{


public function getHouses()
{

$houses = $this->makeRequest('houses');


$list = [];

foreach ($houses as $house) {
$list[] = [
'name' => $house['name'],
'founder' => $house['founder'] ?? 'Mevcut Değil',
'headOfHouse' => $house['headOfHouse'] ?? 'Mevcut Değil',
'mascot' => $house['mascot'] ?? 'Mevcut Değil',
'houseGhost' => $house['houseGhost'] ?? 'Mevcut Değil',
'school' => $house['school'] ?? 'Mevcut Değil'
];
}

return $list;
}
}
27 changes: 27 additions & 0 deletions Classes/Spell.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php


namespace Classes;


class Spell extends API
{


public function getSpells()
{
$spells = $this->makeRequest('spells');

$list = [];

foreach ($spells as $spell) {
$list[] = [
'spell' => $spell['spell'],
'type' => $spell['type'],
'effect' => $spell['effect'],
];
}

return $list;
}
}
Binary file added assets/images/characters/Aberforth Dumbledore.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Alastor Moody.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Albert Runcorn.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Albus Dumbledore.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Alecto Carrow.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Alice Longbottom.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Alicia Spinnet.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Amelia Bones.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Amos Diggory.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Amycus Carrow.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Andromeda Tonks.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Angelina Johnson.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Anthony Goldstein.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Antioch Peverell.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Antonin Dolohov.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Arabella Figg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Aragog.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Argus Filch.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Ariana Dumbledore.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Arthur Weasley.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Augusta Longbottom.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Augustus Rockwood.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Aurora Sinistra.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Bane.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Bartemius Crouch Jr..jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/characters/Bathilda Bagshot.jpg
Binary file added assets/images/characters/Bathsheda Babbling.jpg
Binary file added assets/images/characters/Beedle the Bard.jpg
Binary file added assets/images/characters/Bellatrix Lestrange.jpg
Binary file added assets/images/characters/Bertha Jorkins.jpg
Binary file added assets/images/characters/Blaise Zabini.jpg
Binary file added assets/images/characters/Bloody Baron.jpg
Binary file added assets/images/characters/Buckbeak.jpg
Binary file added assets/images/characters/Cadmus Peverell.jpg
Binary file added assets/images/characters/Cadogan.jpg
Binary file added assets/images/characters/Cedric Diggory.jpg
Binary file added assets/images/characters/Charity Burbage.jpg
Binary file added assets/images/characters/Charles Weasley.jpg
Binary file added assets/images/characters/Cho Chang.jpg
Binary file added assets/images/characters/Colin Creevey.jpg
Binary file added assets/images/characters/Corban Yaxley.jpg
Binary file added assets/images/characters/Cornelius Fudge.jpg
Binary file added assets/images/characters/Crabbe.jpg
Binary file added assets/images/characters/Crookshanks.jpg
Binary file added assets/images/characters/Cuthbert Binns.jpg
Binary file added assets/images/characters/Dean Thomas.jpg
Binary file added assets/images/characters/Dedalus Diggle.jpg
Binary file added assets/images/characters/Demelza Robins.jpg
Binary file added assets/images/characters/Dennis Creevey.jpg
Binary file added assets/images/characters/Dirk Cresswell.jpg
Binary file added assets/images/characters/Dobby.jpg
Binary file added assets/images/characters/Dolores Umbridge.jpg
Binary file added assets/images/characters/Draco Malfoy.jpg
Binary file added assets/images/characters/Dudley Dursley.jpg
Binary file added assets/images/characters/Edward Tonks.jpg
Binary file added assets/images/characters/Elphias Doge.jpg
Binary file added assets/images/characters/Emmeline Vance.jpg
Binary file added assets/images/characters/Ernest Macmillan.jpg
Binary file added assets/images/characters/Ernest Prang.jpg
Binary file added assets/images/characters/Errol.jpg
Binary file added assets/images/characters/Everard.jpg
Binary file added assets/images/characters/Fang.jpg
Binary file added assets/images/characters/Fat Friar.jpg
Binary file added assets/images/characters/Fat Lady.jpg
Binary file added assets/images/characters/Fawkes.jpg
Binary file added assets/images/characters/Fenrir Greyback.jpg
Binary file added assets/images/characters/Filius Flitwick.jpg
Binary file added assets/images/characters/Firenze.jpg
Binary file added assets/images/characters/Fleur Delacour.jpg
Binary file added assets/images/characters/Fluffy.jpg
Binary file added assets/images/characters/Frank Bryce.jpg
Binary file added assets/images/characters/Frank Longbottom.jpg
Binary file added assets/images/characters/Fred Weasley.jpg
Binary file added assets/images/characters/Fridfwulfa.jpg
Binary file added assets/images/characters/Gabrielle Delacour.jpg
Binary file added assets/images/characters/Garrick Ollivander.jpg
Binary file added assets/images/characters/Gellert Grindelwald.jpg
Binary file added assets/images/characters/George Weasley.jpg
Binary file added assets/images/characters/Gilderoy Lockhart.jpg
Binary file added assets/images/characters/Ginevra Weasley.jpg
Binary file added assets/images/characters/Godric Gryffindor.jpg
Binary file added assets/images/characters/Goyle Sr..jpg
Binary file added assets/images/characters/Grawp.jpg
Binary file added assets/images/characters/Great Aunt Muriel.jpg
Binary file added assets/images/characters/Gregory Goyle.jpg
Binary file added assets/images/characters/Griphook.jpg
Binary file added assets/images/characters/Hannah Abbott.jpg
Binary file added assets/images/characters/Harry Potter.jpg
Binary file added assets/images/characters/Hedwig.jpg
Binary file added assets/images/characters/Helena Ravenclaw.jpg
Binary file added assets/images/characters/Helga Hufflepuff.jpg
Binary file added assets/images/characters/Hepzibah Smith.jpg
Binary file added assets/images/characters/Hermione Granger.jpg
Binary file added assets/images/characters/Hokey.jpg
Binary file added assets/images/characters/Horace Slughorn.jpg
Binary file added assets/images/characters/Ignotus Peverell.jpg
Binary file added assets/images/characters/Igor Karkaroff.jpg
Binary file added assets/images/characters/Irma Pince.jpg
Binary file added assets/images/characters/James Potter I.jpg
Binary file added assets/images/characters/John Dawlish.jpg
Binary file added assets/images/characters/Katie Bell.jpg
Binary file added assets/images/characters/Kennilworthy Whisp.jpg
Binary file added assets/images/characters/Kingsley Shacklebolt.jpg
Binary file added assets/images/characters/Kreacher.jpg
Binary file added assets/images/characters/Lavender Brown.jpg
Binary file added assets/images/characters/Lee Jordan.jpg
Binary file added assets/images/characters/Lily J. Potter.jpg
Binary file added assets/images/characters/Lucius Malfoy.jpg
Binary file added assets/images/characters/Ludo Bagman.jpg
Binary file added assets/images/characters/Luna Lovegood.jpg
Binary file added assets/images/characters/Madam Malkin.jpg
Binary file added assets/images/characters/Madam Rosmerta.jpg
Binary file added assets/images/characters/Mafalda Hopkirk.jpg
Binary file added assets/images/characters/Magorian.jpg
Binary file added assets/images/characters/Marcus Flint.jpg
Binary file added assets/images/characters/Marjorie Dursley.jpg
Binary file added assets/images/characters/Marvolo Gaunt.jpg
Binary file added assets/images/characters/Mary Cattermole.jpg
Binary file added assets/images/characters/Mary Riddle.jpg
Binary file added assets/images/characters/Merope Gaunt.jpg
Binary file added assets/images/characters/Michael Corner.jpg
Binary file added assets/images/characters/Millicent Bulstrode.jpg
Binary file added assets/images/characters/Minerva McGonagall.jpg
Binary file added assets/images/characters/Molly Weasley.jpg
Binary file added assets/images/characters/Morfin Gaunt.jpg
Binary file added assets/images/characters/Mrs. Norris.jpg
Binary file added assets/images/characters/Mundungus Fletcher.jpg
Binary file added assets/images/characters/Mykew Gregorovitch.jpg
Binary file added assets/images/characters/Myrtle Warren.jpg
Binary file added assets/images/characters/Nagini.jpg
Binary file added assets/images/characters/Narcissa Malfoy.jpg
Binary file added assets/images/characters/Neville Longbottom.jpg
Binary file added assets/images/characters/Newton Scamander .jpg
Binary file added assets/images/characters/Nicolas Flamel.jpg
Binary file added assets/images/characters/Norbert.jpg
Binary file added assets/images/characters/Nymphadora Tonks.jpg
Binary file added assets/images/characters/Oliver Wood.jpg
Binary file added assets/images/characters/Olympe Maxime.jpg
Binary file added assets/images/characters/Padma Patil.jpg
Binary file added assets/images/characters/Pansy Parkinson.jpg
Binary file added assets/images/characters/Parvati Patil.jpg
Binary file added assets/images/characters/Peeves.jpg
Binary file added assets/images/characters/Penelope Clearwater.jpg
Binary file added assets/images/characters/Percy Weasley.jpg
Binary file added assets/images/characters/Peter Pettigrew.jpg
Binary file added assets/images/characters/Petunia Dursley.jpg
Binary file added assets/images/characters/Pigwidgeon.jpg
Binary file added assets/images/characters/Pius Thicknesse.jpg
Binary file added assets/images/characters/Pomona Sprout.jpg
Binary file added assets/images/characters/Poppy Pomfrey.jpg
Binary file added assets/images/characters/Quirinus Quirrell.jpg
Binary file added assets/images/characters/Rabastan Lestrange.jpg
Binary file added assets/images/characters/Reginald Cattermole.jpg
Binary file added assets/images/characters/Regulus Black.jpg
Binary file added assets/images/characters/Remus Lupin.jpg
Binary file added assets/images/characters/Rita Skeeter.jpg
Binary file added assets/images/characters/Rodolphus Lestrange.jpg
Binary file added assets/images/characters/Rolanda Hooch.jpg
Binary file added assets/images/characters/Romilda Vane.jpg
Binary file added assets/images/characters/Ronald Weasley.jpg
Binary file added assets/images/characters/Ronan.jpg
Binary file added assets/images/characters/Rowena Ravenclaw.jpg
Binary file added assets/images/characters/Rubeus Hagrid.jpg
Binary file added assets/images/characters/Rufus Scrimgeour.jpg
Binary file added assets/images/characters/Salazar Slytherin.jpg
Binary file added assets/images/characters/Scabior.jpg
Binary file added assets/images/characters/Seamus Finnigan.jpg
Binary file added assets/images/characters/Septima Vector.jpg
Binary file added assets/images/characters/Severus Snape.jpg
Binary file added assets/images/characters/Sirius Black.jpg
Binary file added assets/images/characters/Stanley Shunpike.jpg
Binary file added assets/images/characters/Sturgis Podmore.jpg
Binary file added assets/images/characters/Susan Bones.jpg
Binary file added assets/images/characters/Sybill Trelawney.jpg
Binary file added assets/images/characters/Terry Boot.jpg
Binary file added assets/images/characters/Theodore Nott.jpg
Binary file added assets/images/characters/Thomas Riddle.jpg
Binary file added assets/images/characters/Tom Riddle Sr.jpg
Binary file added assets/images/characters/Tom Riddle.jpg
Binary file added assets/images/characters/Travers.jpg
Binary file added assets/images/characters/Trevor.jpg
Binary file added assets/images/characters/Vernon Dursley.jpg
Binary file added assets/images/characters/Viktor Krum.jpg
Binary file added assets/images/characters/Vincent Crabbe.jpg
Binary file added assets/images/characters/Walden Macnair.jpg
Binary file added assets/images/characters/William Weasley.jpg
Binary file added assets/images/characters/Winky.jpg
Binary file added assets/images/characters/Xenophilius Lovegood.jpg
Binary file added assets/images/characters/Zacharias Smith.jpg
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added assets/images/spells/Accio_cup.gif
8 changes: 8 additions & 0 deletions base.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

$classPath = __DIR__.DIRECTORY_SEPARATOR.'Classes'.DIRECTORY_SEPARATOR;

include_once $classPath.'API.php';
include_once $classPath.'House.php';
include_once $classPath.'Spell.php';
include_once $classPath.'Character.php';
82 changes: 35 additions & 47 deletions characters.php
Original file line number Diff line number Diff line change
@@ -1,40 +1,15 @@
<?php

$config = include 'config.php';
include_once 'base.inc.php';

function getTitle()
{
return 'Karakterler';
}

$apiUrl = "https://www.potterapi.com/v1/characters?key={$config['api_key']}";

//hello
if (isset($_GET['house'])) {
$validHouses = ['gryffindor', 'ravenclaw', 'slytherin', 'hufflepuff'];

if (!in_array($_GET['house'], $validHouses)) {
exit('Böyle bir ev yok');
}

$apiUrl .= ($_GET['house'] ? "&house=" . ucfirst($_GET['house']) : '');
}

$characters = file_get_contents($apiUrl);

$characterDetails = [];

$characters = json_decode($characters, true);
$characterClass = new \Classes\Character();

foreach ($characters as $character) {
$characterDetails[] = [
'name' => $character['name'],
'house' => $character['house'] ?? '',
'role' => $character['role'] ?? '',
'bloodStatus' => $character['bloodStatus'],
'species' => $character['species']
];
}
$characters = $characterClass->getCharacters($_GET['house'] ?? null);

?>

Expand Down Expand Up @@ -63,30 +38,43 @@ function getTitle()
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Name</th>
<th scope="col">House</th>
<th scope="col">Role</th>
<th scope="col">Blood</th>
<th scope="col">Species</th>
<th scope="col">Avatar</th>
<th scope="col">Ad</th>
<th scope="col">Rol</th>
<th scope="col">Ev</th>
<th scope="col">Kan Durumu</th>
<th scope="col">Tür</th>
</tr>
</thead>
<tbody>
<?php
$counter = 1;
foreach ($characterDetails as $detail):
if (!isset($_GET['house']) || $_GET['house'] == strtolower($detail['house'])) {
?>
<tr>
<th scope="row"><?php echo $counter++; ?> </th>
<td><?php echo $detail['name']; ?></td>
<td><?php echo $detail['house']; ?></td>
<td><?php echo $detail['role']; ?></td>
<td><?php echo $detail['bloodStatus']; ?></td>
<td><?php echo $detail['species']; ?></td>
</tr>
<?php
}
endforeach;
foreach ($characters as $character){ ?>

<tr>
<th scope="row"><?php echo $counter++; ?> </th>
<td><img style=" width: 40%; height: auto;" alt="" class="card-img-top" src="<?php echo $character['image']; ?>"></td>
<td><?php echo $character['name'];?></td>
<td><?php echo $character['role'];?></td>
<td><?php echo $character['house'];?></td>
<td><?php echo $character['bloodStatus'];?></td>
<td><?php echo $character['species'];?></td>
<!--
Translate API için kullandım ama biraz yavaş yüklendiği için yorum satırı içerisine aldım
<th scope="row"><?//php echo $counter++; ?> </th>
<td><img style=" width: 40%; height: auto;" alt="" class="card-img-top" src="assets/images/characters/<?//php echo $detail['name']?>.jpg"></td>
<td><?//php echo $detail['name'];?></td>
<td><?//php translate("".$detail['role'], "en", "tr");?></td>
<td><?//php echo $detail['house'];?></td>
<td><?//php translate("".$detail['bloodStatus'], "en", "tr");?></td>
<td><?//php translate("".$detail['species'], "en", "tr");?></td>
-->
</tr>

<?php }



?>
</tbody>
</table>
Expand Down
51 changes: 25 additions & 26 deletions houses.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
<?php

$config = include 'config.php';
include_once 'base.inc.php';


function getTitle()
{
return 'Evler';
}

$houses = file_get_contents("https://www.potterapi.com/v1/houses?key={$config['api_key']}");

$decodedHouses = json_decode($houses, true);
$houseDetails = [];

foreach ($decodedHouses as $house) {
$houseDetails[] = [
'name' => $house['name'],
'founder' => $house['founder'],
'headOfHouse' => $house['headOfHouse']
];
}

$houseClass = new \Classes\House();
$houses = $houseClass->getHouses();

?>

Expand All @@ -33,39 +23,48 @@ function getTitle()


<div class="pt-5">

<div class="container">

<section class="jumbotron text-center pt-5 mb-5 bg-white">
<div class="container">
<h1 class="jumbotron-heading"><?php echo getTitle(); ?></h1>
</div>
</section>

<div class="row bg-white p-5">
<?php foreach ($houseDetails as $detail) { ?>
<?php foreach ($houses as $house) { ?>
<div class="col-md-6">
<div class="card mb-4 box-shadow">
<img class="card-img-top" src="/assets/images/<?php echo $detail['name'] ?>.jpg" alt="<?php echo $detail['name']; ?>">
<img class="card-img-top" src="assets/images/houses/<?php echo $house['name'] ?>.jpg"
alt="<?php echo $house['name']; ?>">
<div class="card-body">
<h5 class="card-title"><?php echo $detail['name']; ?></h5>
<h5 align="center" class="card-title">
<strong><?php echo strtoupper($house['name']); ?></strong></h5>
<p class="card-text">
<ul>
<li><strong>Founder: </strong><?php echo $detail['founder']; ?></li>
<li><strong>Head of House: </strong><?php echo $detail['headOfHouse']; ?></li>
</ul>

<strong>Evin Kurucusu :</strong> <?php echo $house['founder']; ?>
</p>
<p class="card-text">
<strong>Evin Başı &emsp; &emsp; :</strong> <?php echo $house['headOfHouse']; ?>
</p>
<p class="card-text">
<strong>Evin Maskotu&emsp;:</strong> <?php echo ucfirst($house['mascot']); ?>
</p>
<p class="card-text">
<strong> Evin Hayaleti &emsp;:</strong> <?php echo $house['houseGhost']; ?>
</p>
<p class="card-text">
<strong> Okul &emsp;&emsp;&emsp;&emsp;&emsp;:</strong> <?php echo $house['school']; ?>
</p>
<div class="justify-content-between align-items-center">
<div class="btn-group float-right">
<a href="characters.php?house=<?php echo strtolower($detail['name']); ?>" class="btn btn-sm btn-outline-secondary">Show Students</a>
<a href="characters.php?house=<?php echo $house['name']; ?>"
class="btn btn-sm btn-outline-secondary">Show Students</a>
</div>
</div>
</div>
</div>
</div>

<?php } ?>

</div>
</div>
</div>
Expand Down
8 changes: 6 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ function getTitle()
<div class="bg-white p-5">
<div class="col-md-12">


<p>Tebrikler! Seçmen şapka sizi <strong><?php echo $house; ?></strong> evine yerleştirdi.</p>
<?php
// api'dan gelen çift tırnak işaretlerini kaldırmak için yazıldı
$house = str_replace("\"","", $house);
?>
<p>Tebrikler! Seçmen şapka sizi <strong><a href="houses.php"><?php echo $house; ?></a></strong> evine yerleştirdi.</p>
<img class="card-img-top" src="assets/images/houses/<?php echo $house?>.jpg" alt="<?php echo $house; ?>">

</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion navbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<a class="nav-link <?php if ($_SERVER['REQUEST_URI'] == '/index.php') { echo 'active'; } ?>" href="index.php">Anasayfa</a>
</li>
<li class="nav-item">
<a class="nav-link <?php if ($_SERVER['REQUEST_URI'] == '/characters.php') { echo 'active'; } ?>" href="characters.php">Karakterler</a>
<a class="nav-link <?php if (strpos($_SERVER['REQUEST_URI'],'/characters.php') !== false) { echo 'active'; } ?>" href="characters.php">Karakterler</a>
</li>
<li class="nav-item">
<a class="nav-link <?php if ($_SERVER['REQUEST_URI'] == '/houses.php') { echo 'active'; } ?>" href="houses.php">Evler</a>
Expand Down
Loading