ב הוא חיבור של הרב יהושע בועז שתוכנו מראי מקומות למקורותشسdggרות הל555ה התafhgfh
במסgרות ה gh//شی הוא חיבור של הרב יהושע בועז שתוכנו מראי מקומות למקורותהתנדaghhhhו12ין יעל, המעציfghfghfע
/
www-data
/
newsites
/
adminpanel
/
application
/
models
/
Upload FileeE
HOME
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Gallery_Model extends CI_Model { public function index() { } public function get_hostname() { $query=$this->db->query("select @a:=@a+1 sno,sd.id as hostid,sd.host_name,sd.admissions,sd.academics,sd.achivements,sd.contact_us, CASE WHEN sd.is_active='1' THEN 'Yes' else 'No' END AS active from site_data sd,(SELECT @a:= 0) AS a where sd.is_active='1'"); $usersdata = $query->result_array(); $count = count($usersdata); //print_r($usersdata);exit; if(empty($count)) { $log = 0; return $log ; } else { return $usersdata; } } public function get_gallery($id) { $query=$this->db->query("select @a:=@a+1 sno,g.id,sd.host_name,g.caption,g.image, CASE WHEN g.is_active='1' THEN 'Yes' else 'No' END AS active from gallery g left Join site_data sd on(sd.id=g.host_id),(SELECT @a:= 0) AS a where g.id='".$id."' and g.is_active='1'"); $usersdata = $query->result_array(); return $usersdata; } public function get_gallery_data() { $query=$this->db->query("select @a:=@a+1 sno,g.id,sd.host_name,g.caption,g.image, CASE WHEN g.is_active='1' THEN 'Yes' else 'No' END AS active from gallery g left Join site_data sd on(sd.id=g.host_id),(SELECT @a:= 0) AS a where g.is_active='1'"); $usersdata = $query->result_array(); $count = count($usersdata); //print_r($usersdata);exit; if(empty($count)) { $log = 0; return $log ; } else { return $usersdata; } } public function add_gallerydata($host_id,$file_name1,$caption,$active) { $current_date=date('Y-m-d'); $query=$this->db->query("insert into gallery (host_id,image,caption,is_active) VALUES('$host_id','$file_name1','$caption','$active')"); } }