📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
otogaleriscripti.demodesign.com.tr
/
includes
/
models
📝
Zones.php
← Geri Dön
<? class Zone{ public $id,$Name,$CityId; public function __construct($id,$name,$cityId) { $this->id = $id; $this->Name = $name; $this->CityId = $cityId; } } class Zones{ private $Obj=[]; public function getAll(){ global $dbh; $sth = $dbh->prepare("select * from zones"); $sth->execute(); $rows = $sth->fetchAll(PDO::FETCH_OBJ); $this->Obj =[]; foreach ($rows as $obj) { /** @var Zone $obj */ $this->Obj[] = new Zone($obj->id,$obj->Name,$obj->CityId); } return $this; } public function getByCity($cityId){ global $dbh; $sth = $dbh->prepare("select * from zones where CityId='".$cityId."'"); $sth->execute(); $rows = $sth->fetchAll(PDO::FETCH_OBJ); $this->Obj =[]; foreach ($rows as $obj) { /** @var Zone $obj */ $this->Obj[] = new Zone($obj->id,$obj->Name,$obj->CityId); } return $this; } public function getByCities($cityIds){ global $dbh; $sth = $dbh->prepare("select * from zones where CityId in('".join("','",$cityIds)."')"); $sth->execute(); $rows = $sth->fetchAll(PDO::FETCH_OBJ); $this->Obj =[]; foreach ($rows as $obj) { /** @var Zone $obj */ $this->Obj[] = new Zone($obj->id,$obj->Name,$obj->CityId); } return $this; } public function asJson(){ return json_encode($this->Obj); } public function asObj(){ return ($this->Obj); } } ?>
💾 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