예제 #1
2
}

/*------------------------------------------------------
		A FAIRE DANS TOUS LES CAS
--------------------------------------------------------*/

if(!empty($_SESSION['idpays']) && (empty($_GET['ville']))){
	$filtre = " WHERE pays like '".$_SESSION['idpays']."' ";
}else $filtre = " WHERE pays like '%%' ";


$requetPays_   ="select * from departement ";
if ($_GET['order']) $requetPays_  .= "".$filtre." ORDER BY ".COrder::formate($_GET['order'])."";
else $requetPays_  .= "".$filtre." ORDER BY ".$order." DESC";

$requetPays = CBdd::select($requetPays_);
?>
<!-- InstanceEndEditable -->
<div id="mainwrap">
  <div id="header"><? include("../nav/header.php"); ?></div>
  <div id="top"><? include("../nav/menu_h.php"); ?></div>
  <div id="filet">
    <div id="zonetitre">
      <div id="signe"></div>
      <div id="titre"><!-- InstanceBeginEditable name="titre" -->Departement/Canton<!-- InstanceEndEditable --></div>
    </div>
  </div>
  <div id="contentarea">
    <div id="left"><? include("../nav/menu_g.php"); ?></div>
    <div id="center">
      <div id="page"><!-- InstanceBeginEditable name="page" --> <? echo CHtml::get_toolbar(array('add'=>2, 'cancel'=>1))?> <!-- InstanceEndEditable --></div>
예제 #2
0
function get_elements($id_parent = '') {
	$and =  'AND idgal = ' . $id_parent.'';
	$sql = "SELECT * FROM " . $this->table . " WHERE etat = 1 " . $and . " ORDER BY rang ASC";  
	$res = CBdd::select($sql);
	$this->nb_elements = mysql_num_rows($res);
	return $res;
}
예제 #3
0
	function create($sitemap_name = '') {
		
		if(!$sitemap_name) $sitemap_name = SS_ADMIN_TO_USERFILE . "/sitemap.xml";
		
		if(empty($sitemap_name)) $sitemap_name = "sitemap_" . $rep_name . ".xml";
		$changefreq 	= array('daily', 'weekly', 'monthly');
		$priority		= array('0.1', '0.5', '1.0');
		$tab_archive	= array();

		rsort($tab_archive);
		$xml = simplexml_load_file(SS_ADMIN_TO_USERFILE . '/google/sitemap_base.xml');
		
		//scan bdd
		$sql = "SELECT * FROM page WHERE etat = 1";
		$res = CBdd::select($sql);
		while($page = mysql_fetch_array($res)) {
			$url = $xml->addChild('url');
			$url->addChild('loc', CUrl::get_urlsite() . "/" . CFunction::formate_chaine(utf8_decode($page['nom']), '-') . "_p" . $page['id']. ".html");
			$url->addChild('lastmod', CDate::formate_date($page['date']));
			$url->addChild('changefreq', $changefreq[rand(0, 2)]);
			$url->addChild('priority', $priority[rand(0, 2)]);
		}

		$html = $xml->asXML();
		file_put_contents($sitemap_name, $html);
	}
예제 #4
0
파일: CFeed.php 프로젝트: rakotobe/Rakotobe
	function GetRSS() 
	{ 
		$this->checkValues(); 
		
		$rssValue = "<?xml version=\"1.0\"?>\r\n"; 	
		$rssValue .= "<rss version=\"2.0\">\r\n"; 	
		
		$rssValue .= "<channel>\r\n"; 
		$rssValue .= "<title>" . $this->channelTitle . "</title>\r\n"; 
		$rssValue .= "<link>" . $this->channelLink . "</link>\r\n"; 
		$rssValue .= "<description>" . $this->channelDesc . "</description>\r\n"; 
		
		$rssValue .= "<image>\r\n"; 
		$rssValue .= "<title>" . $this->imageTitle . "</title>\r\n"; 
		$rssValue .= "<url>" . $this->imageURL . "</url>\r\n"; 
		$rssValue .= "<link>" . $this->imageLink . "</link>\r\n"; 
		$rssValue .= "</image>\r\n"; 		
		
		$sql = "SELECT * FROM page WHERE etat = 1 ORDER BY date DESC";
		$res = CBdd::select($sql);
		
		while($page = mysql_fetch_array($res)) 
		{ 
			$rssValue .= "<item>\r\n"; 
			$rssValue .= "<title>" . $page['nom'] . "</title>\r\n"; 
			$rssValue .= "<description>" . $page['description'] . "</description>\r\n"; 
			$rssValue .= "<link>" .htmlentities(CUrl::get_href('page', $page['id'], $page['nom'])). "</link>\r\n"; 
			$rssValue .= "</item>\r\n"; 
		} 
		
		$rssValue .= "</channel>\r\n";		
		$rssValue .= "</rss>\r\n"; 
		
		return $rssValue; 
	}
예제 #5
0
파일: CMenu.php 프로젝트: rakotobe/Rakotobe
function get_elements($id_parent = '') {
	$and = ($this->table_parent && $id_parent) ? 'AND id' . substr($this->table_parent, 0, 3) . ' = ' . $id_parent : '';
	$sql = "SELECT * FROM " . $this->table . " WHERE etat = 1 " . $and . " ORDER BY rang";
	$res = CBdd::select($sql);
	$this->nb_elements = mysql_num_rows($res);
	return $res;
}
예제 #6
0
	static function get_imapkeys() {
		$imapkeys = array();
		$sql = "SELECT imap FROM gr_email WHERE imap != ''";
		$res = CBdd::select($sql);
		while( $email = mysql_fetch_array($res) ) {
			array_push($imapkeys, $email['imap']);
		}
		return $imapkeys;
	}
예제 #7
0
파일: CMeta.php 프로젝트: rakotobe/Rakotobe
	function get_keyword() {
		$sql 		= "(SELECT nom FROM artiste ORDER BY rand() LIMIT 5) UNION (SELECT nom FROM chanson ORDER BY rand() LIMIT 5)";
		$res 		= CBdd::select($sql);
		$keyword 	= "klip, gasy, clip, malagasy, chanson, chant, dago, malagasy, hira, vari�t�";
		while($word = mysql_fetch_array($res)) {
			$keyword .= "," . $word['nom'];
		}
		return $keyword;
	}
예제 #8
0
파일: CForm.php 프로젝트: rakotobe/Rakotobe
	static function get_option($selectedvalue, $tablename, $colvaluename="id", $colvuename="nom", $where=1) {
		   $option = "";
		   $sql = "SELECT " . $colvaluename . ", " . $colvuename . " FROM " . $tablename . " WHERE " . $where . " ORDER BY " . $colvuename;
		   $result = CBdd::select($sql);
		   while($array = mysql_fetch_array($result)) {
		   		$selected = CForm::get_selected($selectedvalue, $array[$colvaluename]);
		   		$option = $option . "<option value='" . $array[$colvaluename] . "'" . $selected . ">" . ucfirst(utf8_encode(substr($array[$colvuename], 0, 16))) . "</option>\n";
		   }
		   return $option;
	}	
예제 #9
0
	static function select($istart=0,$ioffset=1000,$igrp=0,$order = 'mlt_iListId') 
	{
			$tGrps = array();
			
			$zSql = " ";
			$zSql .= " SELECT DISTINCT mlt_iListId FROM moul_tables ";
			$zSql .= " INNER JOIN moul_listes ON (moul_listes.id=moul_tables.mlt_iListId)";
			
			if($igrp == 1000)  {
				$grp = CTableMoulGpFic::get_elms_of_grp(0);
				foreach($grp as $i=>$grps){
					if($grps['fic']!='') $tGrps[$i] = $grps['fic'];
				}
				if($grps['fic']!=''){
					$zSql .= " WHERE mlt_iListId NOT IN (";
					for($i=0;$i<count($tGrps)-1;$i++) $zSql .= $tGrps[$i].",";
					$zSql .= $tGrps[$i].") ";
				}
			}
			
			if($igrp == 1001){
				$grp = CTableMoulGpFic::get_elms_of_grp();
				foreach($grp as $i=>$grps){
					if($grps['fic']!='') $tGrps[$i] = $grps['fic'];
				}
				if($grps['fic']!=''){
					$zSql .= " WHERE mlt_iListId IN (";
					for($i=0;$i<count($tGrps)-1;$i++) $zSql .= $tGrps[$i].",";
					$zSql .= $tGrps[$i].") ";
				}
			}
			
			if(($igrp != 0) && ($igrp != 1000) && ($igrp != 1001))  {
				$grp = CTableMoulGpFic::get_elms_of_grp($igrp);
				foreach($grp as $i=>$grps){
					if($grps['fic']!='') $tGrps[$i] = $grps['fic'];
				}
				if($grps['fic']!=''){
					$zSql .= " WHERE mlt_iListId IN (";
					for($i=0;$i<count($tGrps)-1;$i++) $zSql .= $tGrps[$i].",";
					$zSql .= $tGrps[$i].") ";
				}
			}
			
			$zSql .= " ORDER BY " . COrder::formate($order) ;
			$zSql .= " LIMIT " . $istart ."," . $ioffset;

			$toRes = CBdd::select($zSql);
			$tFichiers = array();
			while($toItm = mysql_fetch_assoc($toRes)){
				array_push($tFichiers,$toItm);
			}
			
		return 	$tFichiers;	
	}
예제 #10
0
	static function select_not_null() 
	{
		$zSql = " SELECT * FROM moul_groupes_tmp WHERE tmp_grp>0 AND tmp_fic>0 ";
		$res  = CBdd::select($zSql);
		$tarrs= array();
		while($otmp = mysql_fetch_assoc($res)){
			array_push($tarrs,$otmp);	
		}
		
		return $tarrs;
	}
예제 #11
0
	function rearrange($idart)
	{
		// CBdd::update('CALL rearrange_galerie('.$idart.');');
            $iKey = 1 ;
            $oRes = CBdd::select('SELECT id FROM galerie WHERE idart = ' . $idart . ' ORDER BY rang') ;
            while ($tiItems = mysql_fetch_assoc($oRes))
            {
                CBdd::execute("UPDATE galerie SET rang = " . $iKey . " WHERE id=" . $tiItems['id']) ;
                $iKey++ ;
            }
	}
예제 #12
0
	function show_db_content($arr_type=array('table', 'function', 'procedure')) {
		$arr_content = array();
		foreach($arr_type as $type) {
			$sql = "SHOW " . $type . " STATUS";
			$res = CBdd::select($sql);
			while($content = mysql_fetch_array($res)) {
				if($type == 'table') $key = 0; else $key = 1;
				array_push($arr_content, $content[$key]);
			}
		}
		return $arr_content;
	}
예제 #13
0
	static function get_elms_of_grp($iGp='')
	{
		$zSql 	 = " ";
		$zSql 	.= " SELECT * FROM moul_gpficmail ";
		if($iGp) $zSql 	.= " WHERE grp = " . $iGp ;
		$ores  = CBdd::select($zSql);
		$tzres = array();
		while($toItm = mysql_fetch_assoc($ores)){
			array_push($tzres,$toItm);
		}
		return $tzres;
	}
예제 #14
0
	static function select($order='mtp_iListId') 
	{
			$zSql = " SELECT DISTINCT mtp_iListId FROM moul_tables_tmp ";
			$zSql .= " INNER JOIN moul_listes ON (moul_listes.id = moul_tables_tmp.mtp_iListId) ";
			$zSql .= " ORDER BY " . COrder::formate($order);

			$toRes = CBdd::select($zSql);
			$tFichiers = array();
			while($toItm = mysql_fetch_assoc($toRes)){
				array_push($tFichiers,$toItm);
			}
		return 	$tFichiers;	
	}
예제 #15
0
		static function get_elms($fic='')
		{
			$zSql = " SELECT * FROM moul_groupes ";
			if($fic != ''){
				if($fic!=0) $zSql .= " WHERE fichiers >0 ";
				if($fic==0) $zSql .= " WHERE fichiers =0 ";
			}
			$ores = CBdd::select($zSql);
			$tzres = array();
				while($toItm = mysql_fetch_assoc($ores)){
					array_push($tzres,$toItm);
				}
			return 	$tzres;
		}
예제 #16
0
	static function get_elements() {
		//recuperer l'id des questions
		$sql = "SELECT id FROM question WHERE etat = 1 ORDER BY rang";
		$res = CBdd::select($sql);
		
		$html = "";
		//boucler sur les elements
		$i=1;
		while($question = mysql_fetch_array($res)) {
			$html .= "<p>" . self::get_element($question['id'], $i) . "</p>";
			$i++;
		}
		
		return $html;
	}
예제 #17
0
	function delete_user($md5_id) {
		$sql = "SELECT email FROM user WHERE md5(id) = '".$md5_id."'";
		$user_email = CBdd::select_one($sql, 'email');
		
		$sql = "SELECT * FROM email WHERE destinataire LIKE '%".$email."%'";
		
		$result = CBdd::select($sql);
		
		$count = mysql_num_rows($result);
		
		if(count($count)) {
			while($email = mysql_fetch_array($result, MYSQL_ASSOC)) {
				$destinataire = $email['destinataire'];
				$destinataire = str_replace($user_email, '', $destinataire);	
							
				$destinataire  = str_replace(array(',,', ';;', ';'), ",", $destinataire);
				
				$email['destinataire'] = trim($destinataire, ',');				
				
				if(empty($destinataire)) {
					$_email = new CTableEmail(array('id'=>$email['id']));
					$_email->delete();
				}
				else {
					
					//unset($email[id]);
					$email['text'] = CFunction::addslashes($email['text']);
					
					if(empty($email['id_campagne'])) {
						$email['id_campagne'] = 0;
					}
					
					if(empty($email['id_groupe'])) {
						$email['id_groupe'] = 0;
					}
					
					$_email = new CTableEmail($email);					
					$_email->update();
				}
			}
		}
		
		$sql = "DELETE FROM user WHERE md5(id) = '" . $md5_id . "'";			
		return CBdd::delete($sql);
	}
예제 #18
0
function get_liste_element($id,$start=0,$offset=2) {
	$sql = "SELECT * FROM " . $this->table . " WHERE etat = 1 AND id != ".$id." ORDER BY rang LIMIT ".$start.", ".$offset." ";
	$res = CBdd::select($sql);
	return $res;
}
예제 #19
0
  	<select id="idsec" name="idsec"  onchange="document.form_filtresec.submit();">
			<option value='0' selected="selected" >Tous secteurs</option>
			<?php echo CForm::get_option($_SESSION['secteur'], 'secteur', 'id_sec', 'nom_sec') ?>		   	
	</select>
</p>
</form>
</div>
<div class="floatleft" style="margin-left: 50px;">
<form id="form_filtrecat" name="form_filtrecat" method="get" action="motcle.php" enctype="multipart/form-data">
<p> <?php echo CForm::get_hidden(66) ?> </p>
<p>
	<label>Cat&eacute;gorie</label>
  	<select id="idcat" name="idcat"  onchange="document.form_filtrecat.submit();">
			<option value='0' selected="selected" >Toutes cat&eacute;gories</option>
			<? $Zsql = "SELECT * FROM cat WHERE secteur_cat =".$_SESSION['secteur'];
			   $oRes = CBdd::select($Zsql);
			   while ($oPays = mysql_fetch_assoc($oRes)): ?>
				   <option value="<?php echo $oPays['id_cat'] ?>"<? 
					   if($_SESSION['idcat'] == $oPays['id_cat'] )  echo "selected";?>> 
					   <? echo $oPays['nom_cat'] ?>
				   </option>
              <? endwhile;?>				      
	</select>
</p>
</form>
</div>
<hr class="clearfloat"/>
<?php
//----------------------------------------------------------------------------------------------
// LISTE
//----------------------------------------------------------------------------------------------
예제 #20
0
파일: run.php 프로젝트: rakotobe/Rakotobe
	

	//	$iOffset = ENVOI_NB_EMAILS_MAXI;
	
 //   $iMailMaxSend = CBdd::select_one() ;

//    if (MAIL_MAX_SEND >= $iMailMaxSend )
//    {
        // --- Les emails dans une vague (au nombre de $iOffset)
        $zSql  = " SELECT * FROM moul_tables_tmp ";
        $zSql .= " WHERE mtp_iEtat = 0 ";
        $zSql .= " ORDER BY mtp_id";
        $toRes = CBdd::select($zSql);
        
        $zSql = " SELECT mlt_zMail FROM moul_tables ";
        $tMails = CBdd::select($zSql);
        $tResultats = array();
        
        while($tTemp = mysql_fetch_assoc($tMails)){
            array_push($tResultats,$tTemp);
        }
        
        while($toItm1 = mysql_fetch_assoc($toRes)){
        
            // --- On met à jour le statut du mail qu'on traite
            $zSql   = " UPDATE moul_tables_tmp SET mtp_iEtat = 1 " ;
            $zSql  .= " WHERE mtp_iEtat = 0 AND mtp_id = " . $toItm1['mtp_id'] ;
            CBdd::update($zSql);

            //echo $toItm1['mtp_id'] . '-' . $toItm1['mtp_zMail'] . ' ' . "\n" ;
            $test = 0;
예제 #21
0
	static function get_array_email() {
		$sql = "SELECT mail_ent FROM entreprise";
		$res = CBdd::select($sql);
		$array_email = array();
		while($user = mysql_fetch_array($res)) {
			array_push($array_email, $user['mail_ent']);
		}
		return $array_email;
	}
예제 #22
0
$filtre  = " 1 " . $filtre_groupe;

$zSql	= "" ;
$zSql  .= " SELECT * FROM entreprise " ;
$zSql  .= " INNER JOIN cat ON cat.id_cat = entreprise.categorie_ent" ;
$zSql  .= " INNER JOIN secteur ON secteur.id_sec = cat.secteur_cat" ;
if (($_GET['alphaA']) ||($_SESSION['alphaA'])){
	if ($_GET['alphaA'] != '') $zSql  .=" AND nom_ent LIKE '" . $_GET['alphaA'] ."%'";
}

$zSql  .=   $filtre_groupe ;
if ($_GET['order']) $zSql  .= " ORDER BY ".COrder::formate($_GET['order']);
else $zSql  .= " ORDER BY nom_ent";
$zSql  .= " LIMIT " . $iStart . ", " . $iMaxPerPage ;
//print_r($zSql);
$r_user = CBdd::select($zSql);

//print_r($zSql);
?>
<body>
<div id="main">
  <?php if(($a != 4) && ($a != 5) ) { ?>
  <?php
//----------------------------------------------------------------------------------------------
// LISTE
//----------------------------------------------------------------------------------------------
   	$id_default_group = CTableConfiguration::get_value_by_element('DEFAULT_GROUP');
   	$disabled = ($id_default_group == $_SESSION['id_groupe'] )?'disabled="disabled"':'';
?>
<p class="alphabetique" ><a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=A'; else  echo $_SERVER['REQUEST_URI'].'?alphaA=A'?>" <? if(($_GET['alphaA'] == 'A') || ($_SESSION['alphaA'] == 'A')) echo 'style="font-weight:bold;"'?>  name="alphaA" id="alphaA" value="A">A</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=B'; else echo $_SERVER['REQUEST_URI'].'?alphaA=B' ?>"<? if(($_GET['alphaA'] == 'B') || ($_SESSION['alphaA'] == 'B')) echo 'style="font-weight:bold;"'?> name="alphaA" id="alphaA" value="B">B</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=C'; else echo $_SERVER['REQUEST_URI'].'?alphaA=C' ?>"<? if (($_GET['alphaA'] == 'C') || ($_SESSION['alphaA'] == 'C')) echo 'style="font-weight:bold;"'?> name="alphaA" id="alphaA" value="C">C</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=D'; else echo $_SERVER['REQUEST_URI'].'?alphaA=D' ?>"<? if(($_GET['alphaA'] == 'D') || ($_SESSION['alphaA'] == 'D')) echo 'style="font-weight:bold;"'?>>D</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=E'; else echo $_SERVER['REQUEST_URI'].'?alphaA=E'?>"<? if(($_GET['alphaA'] == 'E') || ($_SESSION['alphaA'] == 'E')) echo 'style="font-weight:bold;"'?>>E</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=F'; else echo $_SERVER['REQUEST_URI'].'?alphaA=F'; ?>"<? if(($_GET['alphaA'] == 'F') || ($_SESSION['alphaA'] == 'F')) echo 'style="font-weight:bold;"'?>>F</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=G'; else echo $_SERVER['REQUEST_URI'].'?alphaA=G';?>"<? if(($_GET['alphaA'] == 'G') || ($_SESSION['alphaA'] == 'G')) echo 'style="font-weight:bold;"'?>>G</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=H'; else echo $_SERVER['REQUEST_URI'].'?alphaA=H';?>"<? if(($_GET['alphaA'] == 'H') || ($_SESSION['alphaA'] == 'H')) echo 'style="font-weight:bold;"'?>>H</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=I'; else echo $_SERVER['REQUEST_URI'].'?alphaA=I';?>"<? if(($_GET['alphaA'] == 'I') || ($_SESSION['alphaA'] == 'I')) echo 'style="font-weight:bold;"'?>>I</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=J'; else echo $_SERVER['REQUEST_URI'].'?alphaA=J';?>"<? if(($_GET['alphaA'] == 'J') || ($_SESSION['alphaA'] == 'J')) echo 'style="font-weight:bold;"'?>>J</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=K'; else echo $_SERVER['REQUEST_URI'].'?alphaA=K';?>"<? if(($_GET['alphaA'] == 'K') || ($_SESSION['alphaA'] == 'K')) echo 'style="font-weight:bold;"'?>>K</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=L'; else echo $_SERVER['REQUEST_URI'].'?alphaA=L'?>"<? if(($_GET['alphaA'] == 'L') || ($_SESSION['alphaA'] == 'L')) echo 'style="font-weight:bold;"'?>>L</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=M'; else echo $_SERVER['REQUEST_URI'].'?alphaA=M'?>"<? if(($_GET['alphaA'] == 'M') || ($_SESSION['alphaA'] == 'M')) echo 'style="font-weight:bold;"'?>>M</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=N'; else echo $_SERVER['REQUEST_URI'].'?alphaA=N'?>"<? if(($_GET['alphaA'] == 'N') || ($_SESSION['alphaA'] == 'N')) echo 'style="font-weight:bold;"'?>>N</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=O'; else echo $_SERVER['REQUEST_URI'].'?alphaA=O';?>"<? if(($_GET['alphaA'] == 'O') || ($_SESSION['alphaA'] == 'O')) echo 'style="font-weight:bold;"'?>>O</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=P'; else echo $_SERVER['REQUEST_URI'].'?alphaA=P';?>"<? if(($_GET['alphaA'] == 'P') || ($_SESSION['alphaA'] == 'P')) echo 'style="font-weight:bold;"'?>>P</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=Q'; else echo $_SERVER['REQUEST_URI'].'?alphaA=Q';?>"<? if(($_GET['alphaA'] == 'Q') || ($_SESSION['alphaA'] == 'Q')) echo 'style="font-weight:bold;"'?>>Q</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=R'; else echo $_SERVER['REQUEST_URI'].'?alphaA=R';?>"<? if(($_GET['alphaA'] == 'R') || ($_SESSION['alphaA'] == 'R')) echo 'style="font-weight:bold;"'?>>R</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=S'; else echo $_SERVER['REQUEST_URI'].'?alphaA=S';?>"<? if(($_GET['alphaA'] == 'S') || ($_SESSION['alphaA'] == 'S')) echo 'style="font-weight:bold;"'?>>S</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=T'; else echo $_SERVER['REQUEST_URI'].'?alphaA=T';?>"<? if(($_GET['alphaA'] == 'T') || ($_SESSION['alphaA'] == 'T')) echo 'style="font-weight:bold;"'?>>T</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=U'; else echo $_SERVER['REQUEST_URI'].'?alphaA=U'?>"<? if(($_GET['alphaA'] == 'U') || ($_SESSION['alphaA'] == 'U')) echo 'style="font-weight:bold;"'?>>U</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=V'; else echo $_SERVER['REQUEST_URI'].'?alphaA=V';?>"<? if(($_GET['alphaA'] == 'V') || ($_SESSION['alphaA'] == 'V')) echo 'style="font-weight:bold;"'?>>V</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=W'; else echo $_SERVER['REQUEST_URI'].'?alphaA=W';?>"<? if(($_GET['alphaA'] == 'W') || ($_SESSION['alphaA'] == 'W')) echo 'style="font-weight:bold;"'?>>W</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=X'; else echo $_SERVER['REQUEST_URI'].'?alphaA=X';?>"<? if(($_GET['alphaA'] == 'X') || ($_SESSION['alphaA'] == 'X')) echo 'style="font-weight:bold;"'?>>X</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=Y'; else echo $_SERVER['REQUEST_URI'].'?alphaA=Y';?>"<? if(($_GET['alphaA'] == 'Y') || ($_SESSION['alphaA'] == 'Y')) echo 'style="font-weight:bold;"'?>>Y</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=Z'; else echo $_SERVER['REQUEST_URI'].'?alphaA=Z';?>"<? if($_GET['alphaA'] == 'Z') echo 'style="font-weight:bold;"'?>>Z</a>&nbsp;&nbsp;<a href="<? if ((preg_match('/\?/', $_SERVER['REQUEST_URI'])) == 1 ) echo $_SERVER['REQUEST_URI'].'&alphaA=%'; else echo $_SERVER['REQUEST_URI'].'?alphaA=%';?>"<? if(($_GET['alphaA'] == '%') || ($_SESSION['alphaA'] == '%')) echo 'style="font-weight:bold;"'?>>TOUT</a>&nbsp;&nbsp;</p>        
<div class="sortableListWithPagination">
예제 #23
0
파일: CFaqs.php 프로젝트: rakotobe/Rakotobe
	function get_elements($id_parent = '') {		
		$sql = "SELECT * FROM " . $this->table . " WHERE etat = 1 ORDER BY rang";
		$res = CBdd::select($sql);
		$this->nb_elements = mysql_num_rows($res);
		return $res;
	}	
예제 #24
0
		$msginfo = "Champ non valide";
		break;
	}
	CBdd::update("UPDATE configuration SET valeur='".$valeur."' WHERE id=".$id."");
	//$tconfig = new CTableConfiguration(array('id'=>$id, 'valeur'=>$valeur));
	//$tconfig ->update();
	$msginfo = "configuration bien modifi&eacute;e";
	$a = 0;
	break;
}

/*------------------------------------------------------
		A FAIRE DANS TOUS LES CAS
--------------------------------------------------------*/
$Zsql = "SELECT * FROM configuration ORDER BY nom";
$r_configuration = CBdd::select($Zsql)
//$r_configuration = CTableConfiguration::select("*", $filtre, $order);
?>
<!-- InstanceEndEditable -->
<div id="mainwrap">
  <div id="header"><?php include("../nav/header.php"); ?></div>
  <div id="top"><?php include("../nav/menu_h.php"); ?></div>
  <div id="filet">
    <div id="zonetitre">
      <div id="signe"></div>
      <div id="titre"><!-- InstanceBeginEditable name="titre" -->Configuration<!-- InstanceEndEditable --></div>
    </div>
  </div>
  <div id="contentarea">
    <div id="left"><?php include("../nav/menu_g.php"); ?></div>
    <div id="center">
예제 #25
0
	break;
}

/*------------------------------------------------------
		A FAIRE DANS TOUS LES CAS
--------------------------------------------------------*/
$select = "*";
$filtre = "1";

$order = COrder::formate($order) ;
$sql   = " SELECT opportunite.*, hbpiecesjointes.piece AS pj, texte.nom AS txt FROM opportunite" ;
$sql  .= " LEFT JOIN hbpiecesjointes ON hbpiecesjointes.id = pieId" ;
$sql  .= " LEFT JOIN texte ON texte.id = texId" ;
$sql  .= ($order) ? " ORDER BY " . $order : '' ;

$r_opportunite = CBdd::select($sql);


?>
<!-- InstanceEndEditable -->
<div id="mainwrap">
  <div id="header"><?php include("../nav/header.php"); ?></div>
  <div id="top"><?php include("../nav/menu_h.php"); ?></div>
  <div id="filet">
    <div id="zonetitre">
      <div id="signe"></div>
      <div id="titre"><!-- InstanceBeginEditable name="titre" -->Opportunit&eacute;s<!-- InstanceEndEditable --></div>
    </div>
  </div>
  <div id="contentarea">
    <div id="left"><?php include("../nav/menu_g.php"); ?></div>
예제 #26
0
	function export($separator = ',') {
		$id_groupe 	= $this->table['id'];
		$nom_groupe = self::get_element($id_groupe);
		$nom_csv	= CFunction::formate_chaine($nom_groupe) . ".csv";
		
		header("Content-Type: application/csv-tab-delimited-table"); 
		header("Content-disposition: filename=" . $nom_csv);
		
		$resQuery = CBdd::select("SELECT civilite, nom, prenom, societe, adresse, cp, ville, pays, email, telephone, mobile, web FROM user WHERE id IN (" . implode(",", self::get_array_id_user($id_groupe)) . ")"); 
		
		if ($resQuery) { 
			   // titre des colonnes 
			   $fields = mysql_num_fields($resQuery); 
			   $i = 0; 
			   $field_name = '';
			   while ($i < $fields) { 
					$field_name .= '"' . mysql_field_name($resQuery, $i).'"'.$separator; 
					$i++; 
			   } 
			   $field_name = trim($field_name, $separator);
			   echo $field_name . "\r\n";
			  
			   // donn�es de la table 
			   while ($arrSelect = mysql_fetch_array($resQuery, MYSQL_ASSOC)) { 
					$data = '';
					foreach($arrSelect as $key=>$elem) {
						if($key == "civilite") {
							$elem = CTableCivilite::get_name($elem);
						} elseif ($key == "pays") {
							$elem = CTablePays::get_name($elem);
						}
						$data .= '"' . html_entity_decode($elem) . '"'.$separator; 
					} 
					$data = trim($data, $separator);
					echo $data . "\r\n"; 
			   }
			   return 1;
		} else {
			return 0;
		}
	}
예제 #27
-1
$ident = array();
?>
<select name="ville" id="ville" onchange="document.form_filtreart.submit();">
	<option value="%%"><? 
			if ($_SESSION['idpays'] == 'CH') { ?>
				Choisir Canton
			<?}else if ($_SESSION['idpays'] == 'FR'){ ?>
				Choisir D&eacute;partement
			<? }else{?> Tous
			<? }?>
	</option>
	<? 
	if (!empty($_SESSION['idpays'])) $pays = $_SESSION['idpays'];
	else $pays = '%%';
	$xsql = "SELECT DISTINCT * FROM departement WHERE pays like '".$pays."'";
	$oRes_ = CBdd::select($xsql) ;
	while ($oCat = mysql_fetch_assoc($oRes_)): 
			$n++;
			?>
					<option value="<? echo $oCat['id_dep'] ?>" <? if ($_SESSION['ville'] == $oCat['id_dep']) echo 'selected'; ?>><? if ($oCat['nom'] == 'geneve') {?> Genève<?} else echo ucfirst(strtolower(trim($oCat['nom']))) ?></option>
					
		    <? 
	endwhile; 
	?>
</select>	
</p>
</form>
</div >
<hr class="clearfloat"/>
<?
//----------------------------------------------------------------------------------------------
예제 #28
-1
	static function select($select="*", $from, $where="1", $order="rang, id", $autre="") {
		
		$res = null;	
		$sql = 'SELECT DISTINCT '.$select.' FROM '.$from.' WHERE '.$where.' ORDER BY '.$order.'	'.$autre;
		$res = CBdd::select($sql);
		
		
		if(!$res) {
			$old_sql = $sql;
			$sql = 'SELECT '.$select.' FROM '.$from.' WHERE '.$where.'	'.$autre;			
			$res = CBdd::select($sql);	
		}
		
		return $res;
	}
예제 #29
-1
$zSql	= "" ;
$zSql  .= " SELECT * FROM commune " ;
$zSql  .=   $filtre ;
if (($_GET['alphaA']) ||($_SESSION['alphaA'])){
	if ($_GET['alphaA'] != '') $zSql  .=" AND nom_com LIKE '" . $_GET['alphaA'] ."%'";
}

if ($_GET['order']) $zSql  .= " ORDER BY ".COrder::formate($_GET['order']);
else $zSql  .= " ORDER BY nom_com";
$zSql  .= " LIMIT " . $iStart . ", " . $iMaxPerPage ;
//$zSql  .=   $order ;


//print_r($zSql);
$requetCcom = CBdd::select($zSql);

//print_r($zSql);

?>
<body>
<div id="main">
  <?php if(($a != 4) && ($a != 5) ) { ?>
  <?php
//----------------------------------------------------------------------------------------------
// LISTE
//----------------------------------------------------------------------------------------------
?>
<?php 
   	$id_default_group = CTableConfiguration::get_value_by_element('DEFAULT_GROUP');
   	$disabled = ($id_default_group == $_SESSION['id_groupe'] )?'disabled="disabled"':'';
예제 #30
-2
파일: user.php 프로젝트: rakotobe/Rakotobe
			<p style="display:inline;">
			  <label style="width:60px">Recherche&nbsp;&nbsp;</label>
			  <input name="recherche" type="text" value=""/>
			</p>   
			<p style="display:inline;">
			  <input type="submit" value="ok"/>
			</p>
		  </div>  
		  <hr class="clearfloat" />		
          <div class="floatleft">
          <p>
          <label style="width:80px;">Opportunit&eacute;</label>
	          <ul class="listOpportunite"><br/>
	              <?php 
				  $sql = "SELECT * FROM opportunite WHERE etat = 1" ;
				  $res = CBdd::select($sql);
				  $i = 0;
				  while($opportunite = mysql_fetch_array($res)) {
				  	$opp_num[$opportunite['id']] = $i + 1;
				  ?>
	    		  <?php // if(($i+1)%7 == 0) echo '</ul><ul class="listOpportunite">' ; ?>
	              <li style="padding-bottom:10px;"><input class="filtre_idopportunite" name="filtre_idopportunite[<?php echo $i ?>]" type="checkbox" value="<?php echo $opportunite['id'] ?>" <?php echo CForm::get_checked(@$filtre_idopportunite[$i], $opportunite['id']) ?>/><?php echo $i+1, '.&nbsp;', utf8_encode ($opportunite['nom']) ;?>&nbsp;&nbsp;&nbsp;&nbsp;</li>
	              <?php $i++; } ?>
	          </ul>
          </p>
          </div>
		  <hr class="clearfloat"/>

            <div class="floatright" style="margin:0 15px 15px 0;">
				<p>
				  <input type="submit" value="Actualiser"/>