<?php include("_ayarlar.php"); ?>
<?php include("_fonksiyonlar.php"); ?>
<?php $title = "Ekonomi"; ?>
<?php include("_header.php"); ?>

<section class="section">
    <div class="container">
            <div class="col-12">
                <div class="heading text-center">Ekonomi</div>
            </div>
            <?php
                $jsonVeri=file_get_contents("https://api.genelpara.com/embed/altin.json");
                $kur=json_decode($jsonVeri,1);
            ?>
            <div class="row">
            <table class="table table-striped table-hover">
                    <thead>
                        <tr>
                        <th scope="col">Döviz</th>
                        <th scope="col">Alış</th>
                        <th scope="col">Satış</th>
                        <th scope="col">Değişim</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <th scope="row">USD</th>
                            <td><?php echo $kur['USD']['alis']; ?></td>
                            <td><?php echo $kur['USD']['satis']; ?></td>
                            <td><?php echo $kur['USD']['degisim']; ?></td>
                        </tr>
                        <tr>
                            <th scope="row">EUR</th>
                            <td><?php echo $kur['EUR']['alis']; ?></td>
                            <td><?php echo $kur['EUR']['satis']; ?></td>
                            <td><?php echo $kur['EUR']['degisim']; ?></td>
                        </tr>
                        <tr>
                            <th scope="row">GBP</th>
                            <td><?php echo $kur['GBP']['alis']; ?></td>
                            <td><?php echo $kur['GBP']['satis']; ?></td>
                            <td><?php echo $kur['GBP']['degisim']; ?></td>
                        </tr>                        
                        <tr>
                            <th scope="row">Gram Altın</th>
                            <td><?php echo $kur['GA']['alis']; ?></td>
                            <td><?php echo $kur['GA']['satis']; ?></td>
                            <td><?php echo $kur['GA']['degisim']; ?></td>
                        </tr>
                        <tr>
                            <th scope="row">Çeyrek Altın</th>
                            <td><?php echo $kur['C']['alis']; ?></td>
                            <td><?php echo $kur['C']['satis']; ?></td>
                            <td><?php echo $kur['C']['degisim']; ?></td>
                        </tr>                      
                    </tbody>
                </table>
            </div>
        </div>
    </div>

<?php include("_footer.php"); ?>