📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
otogaleriscripti.demodesign.com.tr
📝
hesaplama.class.php
← Geri Dön
<? class hesap_marka{ public $make_id; public $make_name; public function __construct($marka) { foreach ($marka as $mm=>$mmm) { $this->{$mm}=$mmm; } } } class hesap_model{ public $model_id; public $model_name; public function __construct($model) { foreach ($model as $mm=>$mmm) { $this->{$mm}=$mmm; } } } class hesap_yvk{ public $kasa_id; public $kasa_value; public $vites_id; public $vites_value; public $yakit_id; public $yakit_value; public function __construct($model) { foreach ($model as $mm=>$mmm) { $this->{$mm}=$mmm; } } } class hesaplama{ public $token=""; public function __construct() { $this->tokenal(); } public function tokenal() { $url = "http://api.otoendeks.com/login"; $curl = curl_init($url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, "{\"username\": \"nkmotors\", \"password\": \"nkmotors123\"}"); curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: application/json")); $result = curl_exec($curl); if(!$result){die("Connection Failure");} curl_close($curl); print_r($result); $result= json_decode($result); if(isset($result->access_token)){ $this->token=$result->access_token; } } public function markalar() { $url = "http://api.otoendeks.com/markalar"; $markalar = json_decode($this->curl($url)); print_r($markalar); foreach($markalar as $marka=>$mm){ $markalar[$marka]= new hesap_marka($mm); } return $markalar; } public function modeller($markaid) { $url = "http://api.otoendeks.com/modeller/".$markaid; $modeller = json_decode($this->curl($url)); foreach($modeller as $model){ $markalar[$model]= new hesap_model($model); } return $modeller; } public function yillar($marka,$model) { $url = "http://api.otoendeks.com/model-yillari/".$marka."/".$model; $modeller = json_decode($this->curl($url)); return $modeller; } public function yakitviteskasa($mm,$yil) { $url = "http://api.otoendeks.com/yakit-vites-kasa/".$mm."/".$yil; $sonuc = json_decode($this->curl($url)); return $sonuc; } public function yakit() { $url = "http://api.otoendeks.com/yakit-vites-kasa-detay/1"; $sonuc = json_decode($this->curl($url)); return $sonuc; } public function vites() { $url = "api.otoendeks.com/yakit-vites-kasa-detay/2"; $sonuc = json_decode($this->curl($url)); return $sonuc; } public function kasa() { $url = "api.otoendeks.com/yakit-vites-kasa-detay/3"; $sonuc = json_decode($this->curl($url)); return $sonuc; } public function aracarat($markamodel,$yil,$yakit,$vites,$kasa) { $url = "http://api.otoendeks.com/detay-liste/".$markamodel."/".$yil."/".$yakit."/".$vites."/".$kasa; return json_decode($this->curl($url)); } public function otoendex($aracid,$yil,$kilometre) { $url = "http://api.otoendeks.com/otoendeks-degeri/".$aracid."/".$yil."/".$kilometre; return json_decode($this->curl($url)); } private function curl($url) { $curl = curl_init($url); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Bearer '.$this->token)); $result = curl_exec($curl); if(!$result){die("Connection Failure");} curl_close($curl); return $result; } } ?>
💾 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