📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
firmarehberipro.demodesign.com.tr
/
application
/
models
📝
Home_model.php
← Geri Dön
<?php class Home_model extends CI_Model { public $ayarName = "ayarlar"; public function __construct() { parent::__construct(); } public function ayarlar() { return $this->db->where(array("ayar_id" => 1))->get("ayarlar")->row(); } public function get($where = array()){ return $this->db->where($where)->get($this->ayarName)->row(); } public function firmaadd($data = array()){ return $this->db->insert("firma", $data); } public function kullaniciadd($data = array()){ return $this->db->insert("kullanici", $data); } public function siparisadd($data = array()){ return $this->db->insert("siparis", $data); } public function kategoriler($where = array(), $limit = 1){ return $this->db->where($where)->order_by("kategori_sira ASC")->limit($limit)->get("kategori")->result(); } public function kategoridetay($where = array()){ return $this->db->where($where)->order_by("kategori_sira ASC")->get("kategori")->result(); } public function get_records($where = array(), $limit, $count) { return $this->db->join('kategori', 'kategori.kategori_id = firma.kategori_id')->where($where)->order_by("firma.firma_id DESC")->limit($limit, $count)->get("firma")->result(); } public function get_blog($limit, $count) { return $this->db->limit($limit, $count)->get("blog")->result(); } public function kategoricek($where = array()){ return $this->db->where($where)->get("kategori")->row(); } public function blogcek($where = array()){ return $this->db->where($where)->get("blog")->row(); } public function populerpaket($where = array(), $limit = 1){ return $this->db->where($where)->order_by("paket_sira ASC")->limit($limit)->get("paket")->result(); } public function slidercek($where = array(), $limit = 1){ return $this->db->where($where)->order_by("slider_sira ASC")->limit($limit)->get("slider")->result(); } public function blogana($where = array()){ return $this->db->where($where)->order_by("blog_id DESC")->limit(3)->get("blog")->result(); } public function firmalar($where = array()){ return $this->db->join('kategori', 'kategori.kategori_id = firma.kategori_id')->join('kullanici', 'kullanici.kullanici_id = firma.kullanici_id')->where($where)->get("firma")->row(); } public function sayfa($where = array()){ return $this->db->where($where)->get("sayfa")->row(); } public function aramayap($keyword, $category){ return $this->db->join('kategori', 'kategori.kategori_id = firma.kategori_id')->join('kullanici', 'kullanici.kullanici_id = firma.kullanici_id')->group_start()->like(array('firma.firma_ad' => $keyword, 'kategori.kategori_ad' => $category))->group_end()->where(array("firma_durum" => 1))->order_by("firma_id DESC")->get("firma")->result(); } public function siparisler($where = array()){ return $this->db->where($where)->get("siparis")->row(); } public function kuponlar($where = array()){ return $this->db->where($where)->get("kupon")->row(); } public function kuponguncelle($where = array(), $data = array()) { return $this->db->where($where)->update("kupon", $data); } public function siparisguncelle($where = array(), $data = array()) { return $this->db->where($where)->update("siparis", $data); } public function uyelik_olustur($email){ $getUserData = $this->db->where(array("email" => $email))->get("musteriler")->row(); if(!$getUserData){ $insert = $this->db->insert("musteriler",array( "email" => $email, "tarih" => time() )); if($insert) return $this->db->insert_id(); else return false; } return $getUserData->id; } } ?>
💾 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