📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
e-ticaretv9.demodesign.com.tr
/
cron
📝
currency.php
← Geri Dön
<?php include('../init.php'); $data = file_get_contents('https://www.tcmb.gov.tr/kurlar/today.xml?_=1637968403392'); $usd = m_explode($data,'<ForexSelling>','</ForexSelling>',1,0); $euro = m_explode($data,'<ForexSelling>','</ForexSelling>',4,0); $sterlin = m_explode($data,'<ForexSelling>','</ForexSelling>',5,0); $informations = $db->table('products')->where('foreign_type','>',0)->order('id','asc')->get(); if($informations['total_count']>0) { foreach($informations['data'] as $info) { if($info['foreign_type']==1) { if($info['foreign_currency']==2) { $sale_price = $usd*$info['foreign_price']; } if($info['foreign_currency']==3) { $sale_price = $euro*$info['foreign_price']; } if($info['foreign_currency']==4) { $sale_price = $sterlin*$info['foreign_price']; } if($sale_price>0) { $data = [ 'sale_price' => $sale_price, ]; $query = $db->table('products')->where('id','=',$info['id'])->update($data); } } else { if($info['foreign_currency']==2) { $sale_price = m_setting('usd_try')*$info['foreign_price']; } if($info['foreign_currency']==3) { $sale_price = m_setting('euro_try')*$info['foreign_price']; } if($info['foreign_currency']==4) { $sale_price = m_setting('sterlin_try')*$info['foreign_price']; } if($sale_price>0) { $data = [ 'sale_price' => $sale_price, ]; $query = $db->table('products')->where('id','=',$info['id'])->update($data); } } } }
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula