%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/alliance/domains/sedl.alnetis.fr/public_html/inc/classes/
Upload File :
Create Path :
Current File : /home/alliance/domains/sedl.alnetis.fr/public_html/inc/classes/Colonne.php

<?php

class Colonne extends Load {

	var $bd;
	var $language;
	var $clef_primaire;

	function __construct($connection) {
		parent::__construct();
		$this->clef_primaire='id_'.$this->nom_table;
		$this->bd = new BaseOps($connection);
		$this->language = new Lang($connection);
		$this->profil = new Profil($connection);
		$this->admtext = new Admtext($connection);
		$this->activite = new Activite($connection);
		$this->profil = new Profil($connection);
	}

	function liste_section($edition,$profil,$lang,$template="admin",$valide=1){
		$html="";
		$query="SELECT s.*,sl.titre FROM `section_edition` se LEFT JOIN `section` s  ON se.section=s.id LEFT JOIN `section_lang` sl ON sl.section=s.id WHERE sl.lang=".$lang." AND s.profil=".$profil." AND se.valide=1 AND se.edition=".$edition." AND s.colonne=".$valide;
		$result = $this->bd->select_arrays($query);
		if($this->bd->count($query)>0){
			foreach($result as $section) {
				$html.='<li>
					<div style="background: #94cdff;">
						<strong>'.$section['titre'].'</strong> ';
						if($valide==0){
							$html.='<a href="admin/ajouter_colonne.php?section='.$section['id'].'&edition='.$edition.'" >Ajouter à la colonne</a>';	
						}
						else{
							$html.='<a href="admin/suppr_colonne.php?section='.$section['id'].'&edition='.$edition.'" >Retirer de la colonne</a>';	
						}
					$html.='</div>
				</li>';
			
			}
		}
		else{
			
		}
		return $html;
	}
	
	function getUneSectionCol($edition,$profil,$lang){
		$html="";
		$query="SELECT s.*,sl.titre,sl.permalien    FROM `section_edition` se LEFT JOIN `section` s  ON se.section=s.id LEFT JOIN `section_lang` sl ON sl.section=s.id WHERE sl.lang=".$lang." AND s.profil=".$profil." AND se.valide=1 AND se.edition=".$edition." AND s.colonne=1 ORDER BY RAND() LIMIT 1";
		if($this->bd->isres($query)) {
		$sec = $this->bd->select_array($query);
		$html.='<div class="col_profil_'.$sec['profil'].'">';
			//$html.='<div class="etiquette">'.$this->profil->getLibelle($sec['profil']).'</div>';
			$html.='<h3><a href="'.$this->language->getlangCode($lang).'/'.$sec['id'].'-'.$sec['permalien'].'/">'.$sec['titre'].'</a></h3>';
			if($sec['photo1']!=""){
				$html.='<a href="'.$this->language->getlangCode($lang).'/'.$sec['id'].'-'.$sec['permalien'].'/"><img src="'.thumb($sec['photo1'], 290,112,true).'" alt="" /></a>';
			}
			else {
				$html.='<a href="'.$this->language->getlangCode($lang).'/'.$sec['id'].'-'.$sec['permalien'].'/"><img src="images/noimg3.jpg" alt="" /></a>';
			}
			$html.='<ul class="acts">';
		if($this->bd->count($query)>0){
			$types_act=$this->activite->getTypeActivite($sec['profil'],$lang);
			foreach($types_act as $type_act){
				$activites=$this->activite->getListActivite($sec['id'],$type_act['id'],$lang,$edition,"col","all",1);
				if($activites!=""){
					$html.=$activites;
				}
				
			}
		}
		$html.='
		<li class="ligne_activite"><a href="'.$this->language->getlangCode($lang).'/'.$sec['id'].'-'.$sec['permalien'].'/">'.lang("all_activities").' »</a></li>
		</ul></div>';
		return $html; }
		else { return null; }
	}
	
	
	
}

?>

Zerion Mini Shell 1.0