Merhaba dostlarım, raporlarken dolar euro olarak anlık çevrim yapmak istiyorum. sizce nasıl yapabilirim?
kayitlar tablosuna kurne olarak sutun açtım, dolar ve euro
<?php
include "inc.header.php";
$gun = integer($_GET["gun"]);
$ay = integer($_GET["ay"]);
$yil = integer($_GET["yil"]);
$tur = CleanGet($_GET["tur"]);
$kategori = integer($_GET["kategori"]);
?>
<div class="jumbotron">
<div class="row">
<div style="float: right;">
<select name="kategori" id="kategori" class="form-control" required >
<option value=""><?=ALL_CATEGORIES;?></option>
<?php
if ($tur == "gelir"){
echo '<option value="99">Tüm CepBank</option>';
$q = $db->query("select * from kategori where bune = '' or (bune = 'ikili') order by id ASC");
foreach ($q AS $a) {
$selected = "";
if ($kategori == $a["id"]) {
$selected = " selected";
}
echo "<option value='".$a["id"]."'".$selected.">".$a["adi"]."</option>";
}
}else{
$q = $db->query("select * from kategori where bune = 'gider' or (bune = 'ikili') order by id ASC");
foreach ($q AS $a) {
$selected = "";
if ($kategori == $a["id"]) {
$selected = " selected";
}
echo "<option value='".$a["id"]."'".$selected.">".$a["adi"]."</option>";
}
}
?>
</select>
<script>
$(function() {
$("#kategori").change(function() {
var id = $(this).val();
window.location = '?gun=<?=$gun;?>&ay=<?=$ay;?>&yil=<?=$yil;?>&tur=<?=$tur;?>&kategori='+id;
});
});
</script>
</div>
<div class="clear"></div>
<?php
if (isset($_GET["ay"])) {
if (isset($_GET["sil"])) {
$db->query("delete from kayitlar where id = '".integer($_GET["sil"])."'");
$db->query("delete from kayitlar where anaId = '".integer($_GET["sil"])."'");
echo Bilgilendirme::Basarili(KAYIT_SILINDI);
}
$where = "";
$baslik = "".$yil." - ".$gun."";
if ($ay != "") {
$where .= " and ay = '".$ay."'";
$baslik .= " ".BuyukHarflereCevir(AyAdiBul($ay))." -";
}
if (isset($_GET["kategori"])) {
if ($kategori != "") {
if ($kategori == "99") {
if ($tur == "gider"){
$where .= " and kategori = '15'";
}else{
$where .= " and kategori = '9' or (kategori = '10') or (kategori = '11') or (kategori = '12') or (kategori = '13') or (kategori = '14')";
}
}else{
$where .= " and kategori = '".$kategori."'";
$baslik .= " ".KategoriAdiBul($kategori)." ".CATEGORY."";
}
}
}
if ($tur == "gelir") {
$turAdi = GELIR;
}elseif ($tur == "gider") {
$turAdi = GIDER;
}
$baslik .= " ".BuyukHarflereCevir($turAdi)." ".KAYITLAR."";
echo "<h3>".$baslik."</h3>";
echo '
<table class="table table-striped datatable">
<thead>
<tr>
<th>'.MONTH.' / '.YEAR.'</th>
<th>'.TARIH.'</th>
<th width="10%">'.CATEGORY.'</th>
<th width="23%">'.DETAILS.'</th>
<th style="text-align: center;">Neden</th>
<th style="text-align: center;">'.PAYMENT_TYPE.'</th>
<th style="text-align: center;">Ekleyen</th>
<th style="text-align: center;">'.ACTION.'</th>
<th style="text-align: right;" width="10%">'.AMOUNT.'</th>
</tr>
</thead>
<tbody>
';
if ($gun != ""){
$query = "select * from kayitlar where harcamaTarihi = '$yil-$ay-$gun' and tur = '".$tur."' ".$where." and gelirneden = '' order by ay DESC, yil DESC, id DESC";
}else{
$query = "select * from kayitlar where ay = '".$ay."' and yil = '".$yil."' and tur = '".$tur."' ".$where." and gelirneden = '' order by ay DESC, yil DESC, id DESC";
}
echo $query;
$q = $db->query($query);
foreach ($q AS $a) {
echo "
<tr>
<td>".AyAdiBul($a["ay"])." / ".$a["yil"]."</td>
<td>".Tarih(strtotime($a["harcamaTarihi"]))."</td>
<td>".KategoriAdiBul($a["kategori"])."</td>
<td>".$a["aciklama"]."</td>
<td style='text-align: center;'>".$a["giderneden"]."</td>
<td style='text-align: center;'>".OdemeTuruAdiBul($a["odemeTuru"])."</td>
<td style='text-align: center;'>".$a["ekleyen"]."</td>
<td style='text-align: center;'>
<!--<a href='index.php?duzenle=".$a["id"]."' class='btn btn-warning' title='".EDIT."'>".EDIT_SYMBOL."</a>--!>
<a href='".$_SERVER["REQUEST_URI"]."&sil=".$a["id"]."' class='btn btn-danger' title='".SIL."' onclick=\"return confirm('Silmek istediginize Emin misiniz?');\">".DELETE_SYMBOL."</a>
</td>
<td style='text-align: right;'>".Fiyat($a["tutar"])."</td>
</tr>
";
$toplam += ($a["tutar"]);
}
echo "
<tfoot>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th style='text-align: right;' colspan='3'>".TOTAL.": ".Fiyat($toplam)." ".$kurSembol."</th>
</tr>
</tfoot>
";
echo "</tbody></table>";
}
?>
</div>
<?php include "inc.footer.php";?>