📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
firmarehberipro.demodesign.com.tr
/
application
/
models
📝
Destek_model.php
← Geri Dön
<?php class Destek_model extends CI_Model { public function __construct() { parent::__construct(); } public function menucek($where = array()){ return $this->db->where($where)->order_by("kategori_sira ASC")->get("kategori")->result(); } public function firmaget($where = array()){ return $this->db->where($where)->get("firma")->row(); } public function yorumget($where = array()){ return $this->db->join('firma', 'firma.firma_id = yorum.firma_id')->join('kullanici', 'kullanici.kullanici_id = yorum.kullanici_id')->where(array("yorum_durum" => 1, "yorum_onecikart" => 1))->get("yorum")->result(); } public function byorumlar($where = array()){ return $this->db->join('firma', 'firma.firma_id = yorum.firma_id')->join('kullanici', 'kullanici.kullanici_id = yorum.kullanici_id')->where(array("yorum_durum" => 0))->get("yorum")->result(); } public function oyorumlar($where = array()){ return $this->db->join('firma', 'firma.firma_id = yorum.firma_id')->join('kullanici', 'kullanici.kullanici_id = yorum.kullanici_id')->where(array("yorum_durum" => 1))->get("yorum")->result(); } public function rezfirma($where = array()){ return $this->db->join('kullanici', 'kullanici.kullanici_id = firma.kullanici_id')->where($where)->get("firma")->row(); } public function kullaniciget($where = array()){ return $this->db->where($where)->get("kullanici")->row(); } public function yorumcek($where = array()){ return $this->db->join('kullanici', 'kullanici.kullanici_id = yorum.kullanici_id')->where($where)->order_by("yorum.yorum_id ASC")->get("yorum")->result(); } public function favorilerim($where = array()){ return $this->db->join('firma', 'firma.firma_id = favori.firma_id')->where($where)->order_by("favori.favori_id ASC")->get("favori")->result(); } public function blogcek($where = array()){ return $this->db->where($where)->order_by("blog_id DESC")->get("blog")->result(); } public function fmenucek($where = array()){ return $this->db->where($where)->order_by("kategori_sira ASC")->limit(5)->get("kategori")->result(); } public function sayfacek($where = array()){ return $this->db->where($where)->order_by("sayfa_sira ASC")->get("sayfa")->result(); } public function fsayfacek($where = array()){ return $this->db->where($where)->order_by("sayfa_sira ASC")->limit(5)->get("sayfa")->result(); } public function adminfirma($where = array()){ return $this->db->join('kategori', 'kategori.kategori_id = firma.kategori_id')->join('kullanici', 'kullanici.kullanici_id = firma.kullanici_id')->where($where)->order_by("firma.firma_id ASC")->get("firma")->result(); } public function firmalar2($where = array()){ return $this->db->join('kategori', 'kategori.kategori_id = firma.kategori_id')->where($where)->order_by("firma_id ASC")->get("firma")->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)->order_by("firma.firma_id ASC")->get("firma")->result(); } public function detaypaketler($where = array()){ return $this->db->join('kategori', 'kategori.kategori_id = paket.paket_altkategori')->where($where)->order_by("paket_sira ASC")->limit(8)->get("paket")->result(); } public function paketler2($where = array()){ return $this->db->where($where)->get("paket")->row(); } public function detaykategori($where = array()){ return $this->db->where($where)->get("kategori")->row(); } public function bekleyensiparis($where = array()){ return $this->db->join('paket', 'paket.paket_id = siparis.paket_id')->where($where)->order_by("siparis_id DESC")->get("siparis")->result(); } public function siparissay($where = array()) { $query = $this->db->where($where)->get("siparis"); return $query->num_rows(); } public function odemesay($where = array()) { $query = $this->db->select_sum("siparis_odeme")->where($where)->get("siparis"); $result = $query->result(); return $result[0]->siparis_odeme; } public function desteksay($where = array()) { $query = $this->db->where($where)->get("destek"); return $query->num_rows(); } public function altkategorisay($where = array()) { $query = $this->db->where($where)->get("kategori"); return $query->num_rows(); } public function yorumsay($where = array()) { $query = $this->db->where($where)->get("yorum"); return $query->num_rows(); } public function firmasay($where = array()) { $query = $this->db->where($where)->get("firma"); return $query->num_rows(); } public function kategorisay($where = array()) { $query = $this->db->where($where)->get("kategori"); return $query->num_rows(); } public function yorumpuan($where = array()){ $query = $this->db->select_avg('yorum_puan')->where($where)->get("yorum"); return $query->row(); } public function blogsay($where = array()) { $query = $this->db->where($where)->get("blog"); return $query->num_rows(); } public function kuponlar($where = array()){ return $this->db->join('paket', 'paket.paket_id = kupon.paket_id')->where($where)->order_by("kupon_id DESC")->get("kupon")->result(); } public function kuponlar2($where = array()){ return $this->db->where($where)->order_by("kupon_id DESC")->get("kupon")->result(); } public function sayfalar($where = array()){ return $this->db->where($where)->order_by("sayfa_sira ASC")->get("sayfa")->result(); } public function kullanicilar($where = array()){ return $this->db->where($where)->order_by("kullanici_id DESC")->get("kullanici")->result(); } public function slider($where = array()){ return $this->db->where($where)->order_by("slider_sira ASC")->get("slider")->result(); } public function konucek($where = array()){ return $this->db->where($where)->order_by("konu_id DESC")->get("destek_konu")->result(); } public function destekler($where = array()){ return $this->db->join('destek_konu', 'destek_konu.konu_id = destek.destek_konu')->where($where)->order_by("destek_id DESC")->get("destek")->result(); } public function adminadres($link) { $link = seo($link); if (empty($link)) { $link = "admin"; } $start = '<?php defined("BASEPATH") OR exit("No direct script access allowed");' . PHP_EOL; $keys = '$custom_slug_array["admin"] = "' . $link . '";'; $end = '?>'; $content = $start . $keys . $end; file_put_contents(FCPATH . "application/config/route_slugs.php", $content); } public function favoriekle($kullanici_id, $firma_id) { $this->db->where('kullanici_id', $kullanici_id); $this->db->where('firma_id', $firma_id); $query = $this->db->get('favori'); if (!empty($query->row())) { return true; } return false; } public function favoriekle_sil($user_id, $product_id) { if ($this->favoriekle($user_id, $product_id)) { $this->db->where('kullanici_id', $user_id); $this->db->where('firma_id', $product_id); $this->db->delete('favori'); } else { $data = array( 'kullanici_id' => $user_id, 'firma_id' => $product_id ); $this->db->insert('favori', $data); } } public function yorumyap($kullanici_id, $yorum, $yorumpuan, $firmaid) { $data = array( 'kullanici_id' => $kullanici_id, 'yorum_detay' => $yorum, 'yorum_puan' => $yorumpuan, 'firma_id' => $firmaid ); $this->db->insert('yorum', $data); } public function ozellikupdate($where = array(), $data = array()) { return $this->db->where($where)->update("kullanici", $data); } public function yorumupdate($where = array(), $data = array()) { return $this->db->where($where)->update("yorum", $data); } public function firmaupdate($where = array(), $data = array()) { return $this->db->where($where)->update("firma", $data); } public function kullaniciupdate($where = array(), $data = array()) { return $this->db->where($where)->update("kullanici", $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