示例#1
0
	static function get_footer() {
		$footer = CBdd::select_row("select * from footer where etat = 1");
		if(!is_array($footer)) {
			$footer['text']	 		= self::get_text_default();
		}
		return $footer;
	}
示例#2
0
function __construct($id_page = 0, $id_art = 0, $id_cat = 0) {
	
	if($id_page) {
		$sql = 'SELECT nom, text, description, keywords FROM page WHERE id = ' . $id_page;
		$meta= CBdd::select_row($sql);
		$this->title = $meta['nom'];
		$keywords_default = $meta['keywords'] ? $meta['keywords'] : self::formate_to_keywords($meta['text']);
		$description_default = substr(self::formate_to_description($meta['text']) . '. ' . ucwords(str_replace(',', '', $keywords_default)), 0, 254);
		$this->description = $meta['description'] ? $meta['description'] : $description_default;
		$this->keywords = $meta['keywords'] ? $meta['keywords'] : $keywords_default;
	}
	elseif($id_art) {
		$sql = 'SELECT nom, nom as description, nom as keywords FROM article WHERE id = ' . $id_art;
		$meta= CBdd::select_row($sql);
		$this->title = $meta['nom'];
		$this->description = $meta['description'] ? $meta['description'] : $meta['nom'];
		$this->keywords = $meta['keywords'] ? $meta['keywords'] : $meta['nom'];
	}
	elseif($id_cat)  {
		$sql = 'SELECT nom, nom as description, nom as keywords  FROM categorie WHERE id = ' . $id_cat;
		$meta= CBdd::select_row($sql);
		$this->title = $meta['nom'];
		$this->description = $meta['description'] ? $meta['description'] : $meta['nom'];
		$this->keywords = $meta['keywords'] ? $meta['keywords'] : $meta['nom'];
	}
}
示例#3
0
	static function send($destinataire) {
		$expediteur = CBdd::select_one("SELECT email FROM user WHERE type = 2", "email");
		$id_texte	= CConfiguration::get_valeur('WELCOME_TEXT_ID');
		
		$sql_texte_select = "SELECT * FROM texte WHERE id = " . $id_texte;
		$texte = CBdd::select_row($sql_texte_select);
		
		$sql_user = "******" . $destinataire . "'";
		$user = CBdd::select_row($sql_user);
		
		$message = str_replace('$NOM', $user['nom'], $texte['text']);
		$message = str_replace('$PRENOM', $user['prenom'], $message);
		
		//echo $message;
		
		$sujet = $texte['nom'];
		
		$sql_unicite_message = "SELECT id FROM email WHERE destinataire = '" . addslashes($destinataire) . "' AND nom = '" . addslashes($sujet) . "'";
		// echo $sql_unicite_message;
		if(CBdd::select_one($sql_unicite_message, 'id')) {
			return 1;
		}
		
		$sql_email_insert = "INSERT INTO email(expediteur, destinataire, nom, text, etat) VALUES ('" . addslashes($expediteur) . "', '" . addslashes($destinataire) . "', '" . addslashes($sujet) . "', '" . addslashes($message) . "', '2')";
		
		
		CBdd::insert($sql_email_insert);
		
		return CMail::send_mail($destinataire, CFonction::force_stripslashes($sujet), CFonction::force_stripslashes($message), $expediteur, array(), 'Bcc: ' . $expediteur);
	}
示例#4
0
	static function get_design() {
		$design = CBdd::select_row("select * from design where etat = 1");
		if(!is_array($design)) {
			$design['imgbando'] 	= "bando.jpg";
			$design['text']	 		= self::get_text_default();
			$design['couleur1'] 	= "#dd8753";
			$design['couleur2']		= "#133087";
		}
		return $design;
	}
示例#5
0
	static function get_href($cible) {
		$href = "";
		if(CMail::is_email($cible)) {
			$tab_email = explode(",", $cible);
			foreach($tab_email as $email) {
				$sql = "SELECT id, nom, prenom FROM hbclients WHERE id = '" . $email . "' OR email = '" . $email . "'";
				$hbclients = CBdd::select_row($sql);
				$href .= '<span class="info"><a href="hb_clients.php?id=' . $hbclients['id'] . '&a=5">' .$email . '</a><div class="bulle">'. $hbclients['nom'] . '&nbsp;' . $hbclients['prenom'] . '</div></span>,';
			}
			$href = trim($href, ',');
		} else {
			$id = CBdd::select_one("SELECT id FROM hbgroupe WHERE id = '" . $cible . "' OR nom = '" . $cible . "'" , "id");
			$href = '<span class="info"><a href="hbgroupe.php?id=' . $id . '&a=5">' . $cible .'</a><div class="bulle">'. implode(', <br/>', self::get_array_nom_user($cible)) . '</span>';
		}
		return $href;
	}
示例#6
0
	function get_adress($courriel) {
		$sql 	 = "SELECT civilite, nom, prenom, societe, adresse, cp, ville, pays FROM user WHERE email = '" . $courriel . "'";
		$user 	 = CBdd::select_row($sql);
		$adress  = CTableCivilite::get_text($user['civilite']);
		$adress	.= "<br />";
		$adress .= $user['prenom']. " " . $user['nom'];
		$adress	.= "<br />";
		
		if(trim($user['societe'])) {
		$adress .= $user['societe'];
		$adress	.= "<br />";
		}
		
		$adress .= $user['adresse'];
		$adress	.= "<br />";
		$adress .= $user['cp']. " " . $user['ville'];
		$adress	.= "<br />";
		$adress .= ucwords(CTablePays::get_name($user['pays']));
		return ucwords($adress);
	}
示例#7
0
	static function get_href($cible) {
		$href = "";
		if(CMail::is_email($cible)) {
			$tab_email = explode(",", $cible);
			foreach($tab_email as $email) {
				$sql = "SELECT id, nom, prenom FROM user WHERE id = '" . $email . "' OR email = '" . $email . "'";
				$user = CBdd::select_row($sql);
				$href .= '<span class="info"><a href="user.php?id=' . $user['id'] . '&a=5">' .$email . '</a><div class="bulle">'. $user['nom'] . '&nbsp;' . $user['prenom'] . '</div></span>,';
			}
			$href = trim($href, ',');
		} else {
			$id = CBdd::select_one("SELECT id FROM groupe WHERE id = '" . $cible . "' OR nom = '" . $cible . "'" , "id");
			$list_user = self::get_array_nom_user($id);
			if(count($list_user)> 3) {
				$list_user = array_slice($list_user, 0, 3);
				$list_user[] = '...';
			}
			$href = '<span class="info"><a href="groupe.php?id=' . $id . '&a=5">' . $cible .'</a><div class="bulle">'. implode(', <br/>', $list_user) . '</span>';
		}
		return $href;
	}
示例#8
0
	static function get_element($idquestion, $numero="") {
		//recuperer la structure de la question
		$sql = "SELECT * FROM question WHERE id = " . $idquestion;
		$question = CBdd::select_row($sql);
		$html = "";
		
		//construre label
		$html .= '<label id="label_q' . $idquestion . '"><span>' . $numero . '</span><span class="question">' . $question['nom'] . '</span></label>';
		
		$html .= '<div class="reponse">';
		
		//construire le html selon type
		switch($question['type']) {
			case 'select' : 
				$choix_array = self::to_array($question['choix']);
				$html .= parent::get_select($choix_array, "", "q" . $question['id']);
				break;
			case 'input' :
				$obligatoire = $question['obligatoire'] ? 'class="obligatoire"' : '';
				$html .= parent::get_input($question['choix'], "q" . $question['id'], $obligatoire);
				break;
			case 'textarea' :
				$obligatoire = $question['obligatoire'] ? 'class="obligatoire"' : '';
				$html .= parent::get_textarea($question['choix'], "q" . $question['id'], $obligatoire);
				break;
			case 'radio' :
				$choix_array = self::to_array($question['choix']);
				$html .= parent::get_radio($choix_array, "", "q" . $question['id'], "<br />");
				break;
			case 'checkbox' :
				$choix_array = self::to_array($question['choix']);
				$html .= parent::get_checkbox($choix_array, "", "q" . $question['id'], "<br />");
				break;
		}
		
		$html .= '</div>';
		
		//renvoyer le résultat pour l'affichage
		return $html;
	}
示例#9
0
      <th><a href="?order=societe">Soci&eacute;t&eacute;</a></th>
      <th><a href="?order=telephone">T&eacute;l&eacute;phone</a></th>
      <th><a href="?order=etat_contact">Etat</a></th>
      <th><a href="?order=date">Date d'ajout</a></th>
      <th>Prochain rdv</th>
      <th>Heure rdv</th>
      <th>Type rdv</th>
      <th>Modif</th>
      <th>Suppr</th>
      <th>Envoi</th>
      <th align="left"><input name="select" type="checkbox" id="select" onclick="reverse_check()" value=""/></th>
    </tr>
    <?php
		  $i = 0; 
		  while ($user = @mysql_fetch_array($r_user)) {
			  $rdv = CBdd::select_row("SELECT date, heure, type FROM rdv WHERE iduser = "******" ORDER BY date LIMIT 1");
	      ?>
    <tr>      
      <td><a href="user.php?a=5&id=<?php echo $user['id'] ?>" target="_parent"><?php echo $user['id'] ?></a></td>
      <td class="zinfo">             
        <?php
              $__text = CFunction::cut_string($user['nom'], $max_input_text+3);
              echo $__text;
              if($user['nom'] != $__text) {
              ?>
               <div class="bulle">
               <?php echo $user['nom']; ?>
              </div>
              <?php 
              }
              ?>              
示例#10
0
function get_nb_element() {
	$sql = "SELECT COUNT(*) as nombre FROM " . $this->table . " WHERE etat = 1 ";
	$res = CBdd::select_row($sql);
	return $res['nombre'];
}
示例#11
0
	}	
	$tfaq = new CTableFaq(array('etat'=>$etat, 'question'=>CFunction::addslashes($question), 'reponse'=>CFunction::addslashes($reponse)));
	$tfaq->insert();
	$msginfo = 'FAQ bien ajout&eacute;e';
	
	/*
	 *  CREATION AUTOMATIQUE DE LA PAGE
	 */
	
	$page_faq = CTablePage::select('*', 'text LIKE \'%<!--FAQ-->%\'');
	
	if(!$page_faq || !mysql_num_rows($page_faq)) {

		// Get first article
		
		$art = CBdd::select_row('SELECT id FROM article WHERE 1 ORDER BY id LIMIT 0,1');
		
		$tpag = new CTablePage(
			array(
				'nom'=>'FAQ', 
				'etat'=>$etat, 
				'idart'=>$art['id'], 
				'text'=>'<!--FAQ-->', 
				'head'=>'', 
				'description'=>'', 
				'keywords'=>'', 
				'send'=>0)
			);
		$tpag->insert();
	}
	
示例#12
0
 if ($radioText && $idopportunite)
 {
     
     $zSqlEnvoieMail  = " SELECT opportunite.*, hbpiecesjointes.piece AS piece, text FROM opportunite" ;
     $zSqlEnvoieMail .= " LEFT JOIN hbpiecesjointes ON hbpiecesjointes.id = pieId" ;
     $zSqlEnvoieMail .= " LEFT JOIN texte ON texte.id = texId" ;
     $zSqlEnvoieMail .= " WHERE opportunite.id = " . $idopportunite ;
     
     $toEnvoyes = CBdd::select_row($zSqlEnvoieMail) ;
     
     $expediteur = CTableUser::get_email_admin() ;
     $destinataire = $email ;
     $liste_email = CTableHbGroupe::get_liste_email($destinataire);
     
     // --- Creation du mail en HTML
     $texte = CBdd::select_row("SELECT nom, text, style FROM texte WHERE id = " . $toEnvoyes['texId']);
     
     $body = CNmail::build_html_body($texte['style'], $texte['text']);
     
     $zDate = date('Y-m-d H:i:s')  ;
           
     $obj = new CTableEmail(array(
     	'expediteur'=>CFunctions::addslashes($expediteur),
     	'destinataire'=>CFunctions::addslashes($destinataire),
     	'nom'=>CFunctions::addslashes($texte['nom']),
     	'id_text' => $toEnvoyes['texId'],	
     	'text'=>mysql_escape_string(CFunctions::addslashes($texte['text'])),
     	'pj'=>CFunctions::addslashes($toEnvoyes['piece']),
     	'date' => $zDate));
     $iEmailId = $obj->insert();
     
示例#13
0
function get_element($id) {
	$sql = "SELECT * FROM " . $this->table . " WHERE etat = 1 AND id = " . $id . " ORDER BY rang";
	$res = CBdd::select_row($sql);
	$this->nb_elements = 1;
	return $res;
}
示例#14
0
function get_first_element($id_menu) {
	$sql = "SELECT * FROM " . $this->table . " WHERE id" . substr($this->table_parent, 0, 3) . " = " . $id_menu . " AND etat = 1 ORDER BY rang  LIMIT 1";
	$res = CBdd::select_row($sql);
	return $res;
}
示例#15
0
		<?php
		break;
	case 33:
		$des = new CTableEmail(array('id'=>$id));
		$des ->delete();
		echo 'Supprim&eacute; avec succ&egrave;s';
		break;
	case 4:		// AFFICHAGE
		$t_envoi = new CTableEmail(array('id'=>$id));
		$envoi = $t_envoi->select_row();
		
		if ( $envoi['type_envoi'] == 0 ){
			$groupe = CBdd::select_row("SELECT nom FROM groupe WHERE id = '".$envoi['id_groupe']."'");
		}
		elseif ( $envoi['type_envoi'] == 1 ){
			$groupe = CBdd::select_row("SELECT nom FROM gr_groupe WHERE id = '".$envoi['id_groupe']."'");	
		}
		
		$sql = "SELECT nom FROM texte WHERE id = ".$envoi['id_text'];
		$text = CBdd::select_one($sql, 'nom');	
		?>
		<fieldset>
          	<legend>Affichage de <?php echo $nom; ?></legend>
          	<p>
          		<label>Type Groupe</label>:          		
                	<?php if ( $envoi['type_envoi'] == 0 ){ echo "Groupe"; }elseif ( $envoi['type_envoi'] == 1 ){ echo "Groupe GR"; }  ?>              	
          	</p>
          	<p>
          		<label>Nom Groupe</label>:          		
                	<?php echo $groupe['nom'];  ?>              	
          	</p>
示例#16
0
include_once("../inc/init.php");
/*--------------------------------------------------------------------
		INITIALISATIONS
----------------------------------------------------------------------*/
$id		 =   0;

/*---------------------------------------------------------------------
		VARIABLES HTTP
----------------------------------------------------------------------*/
if(!empty($_GET['id'])) $id = $_GET['id'];

/*--------------------------------------------------------------------
		TRAITEMENTS
----------------------------------------------------------------------*/
$sql  = "SELECT nom, text, style FROM texte WHERE id = " . $id;
$cible = CBdd::select_row($sql);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Aper&ccedil;u du texte : <?php echo $cible['nom'] ?></title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
	padding:15px;
	text-align:justify;
}

label {
	color: gray;
示例#17
0
                if (empty($id_texte)) {
                    $error_type = 3;
                    $error_signe['id_texte'] = "*";
                }
                if ($error_type > 0) {
                    if($_id_groupe && !$is_email) {
                        $msginfo = "Ce groupe ne contient aucun contact !";
                    }
                    else {
                        $msginfo = "Champ non valide";
                    }
                    $a = 4;
                    break;
                }

                $texte = CBdd::select_row("SELECT nom, text, style FROM texte WHERE id = " . $id_texte);

	/* Create HTML Email Here */

                $body = CNmail::build_html_body($texte['style'], $texte['text']);


                $obj = new CTableEmail(array(
                'expediteur'=>CFunction::addslashes($expediteur),
                'destinataire'=>CFunction::addslashes($destinataire),
                'nom'=>CFunction::addslashes($texte['nom']),
                'id_text'=>$id_texte,
                'text'=>mysql_escape_string(CFunction::addslashes($texte['text'])),
                'pj'=>CFunction::addslashes($pj),
                'date'=>$date . ' ' . date('H:i:s')));
示例#18
0
	$msginfo = 'Commune ajout&eacute;e';
	$a = 0;
	break;
	
case 5 : // Modifier 1	
	if(!empty($_GET['id'])) $id = $_GET['id'];
	
	$_SESSION['id'] = $id;
	$tcat 		= new CTableCommune(array('id_com'=>$id));
	$cat  		= $tcat->select_row();
	$nom  		= $cat['id_com'];
	$etat  		= $cat['actif'];
	$idcat		= $cat['secteur_cat'];
	
	$requetteSql = "SELECT commune.*, departement.* FROM commune INNER JOIN departement ON commune.departement=departement.id_dep WHERE id_com=".$id."";
	$comVal = CBdd::select_row($requetteSql);
	//print_r($zsql);
	//echo $comVal['nom_com'];
	//print_r($id);
	if(!CLogin::protect_action($idreda)) {
		$a = 0;
		$msginfo = 'Action non autoris&eacute;e';
	}
		
	break;
		
case 55 : // Modifier 2
	
	
	if(!empty($_POST['id'])) 			$id 				= $_POST['id'];
	if(!empty($_POST['nom'])) 			$nom 				= trim($_POST['nom']);
示例#19
0
		RECUPERATIONS
----------------------------------------------------------------------*/
$expediteur  = (!empty($_GET['expediteur'])) 	? stripslashes($_GET['expediteur']) 	: "";

/*---------------------------------------------------------------------
		INITIALISATION
----------------------------------------------------------------------*/
$msginfo 		= "";


/*---------------------------------------------------------------------
		ENVOI
----------------------------------------------------------------------*/
$sql = "SELECT * FROM user WHERE email = '" . $expediteur . "'";

$user = CBdd::select_row($sql);

// Commune
$nomCom = CCom::recupnomCom('commune', 'nom_com', 'id_com', $user['commune_alias']);
if ($nomCom == '') $nomCom = CCom::recupnomCom('communeD', 'nom_comD', 'id_user', $user['id']);

/*---------------------------------------------------------------------
		CONFIRMATION
----------------------------------------------------------------------*/
?>
<script type="text/javascript">
$('nom').value		= '<?php echo addslashes($user['nom']); ?>'		;
$('prenom').value 	= '<?php echo addslashes($user['prenom']); ?>'	;
$('ville').value 	= '<?php echo addslashes($nomCom); ?>'	;
$('pays').value 	= '<?php echo addslashes($user['pays']); ?>'		;
$('telephone').value = '<?php echo addslashes($user['telephone']); ?>';
示例#20
0
						for($i=1; $i<=$n_img; $i++) {
							?>
							<div class="<?php echo $i==1?'active':''; ?>"><?php echo $i; ?></div>
							<?php
						}
					?>
				</div>
				<div class="scroll">
					<div class="left"><img src="/userfiles/template/default/img/control_left.gif" alt="" onclick="javascript:scroll_left();"/></div>
					<div class="right"><img src="/userfiles/template/default/img/control_right.gif" alt="" onclick="javascript:scroll_right();"/></div>
				</div>
			<?php
		}
		else {
			$sql = "SELECT * FROM image WHERE etat = 1 AND idgal = " . $id_galerie_courant . " AND defaut = 1 ORDER BY rang";
			$img = CBdd::select_row($sql);

			?>
		    	<div class="slideshow">
					<div class="active"><img src="/userfiles/image/galeries/<?php echo $gal['dossier'];?>/<?php echo $img['image'];?>" alt="<?php echo $gal['dossier'];?>/<?php echo $img['image'];?>"/></div>
				</div>
				<div class="text">
					<div id="ticker">
    					<span><a href="<?php echo $gal['lien']; ?>"><?php echo $gal['texte']; ?></a></span>
					</div>
					<?php
						if($gal['etat_defilement'] == 1) {
							?>
							<script type="text/javascript">
							$j(document).ready(function(){
								$j("div#ticker").liScroll({travelocity: 0.05});
示例#21
0
<?php 
$sql = "SELECT * FROM video WHERE etat = 1 AND id_page = " . $id_page_courant . " ORDER BY rang";
$res = CBdd::select($sql);
$nb_video = mysql_num_rows($res);
$current_video = null;

if($id_video_courant == 0) {
	$sql = "SELECT id FROM video WHERE etat = 1 AND id_page = " . $id_page_courant . " ORDER BY rang LIMIT 1";
	$id_video_courant = CBdd::select_one($sql, 'id');
}

if($id_video_courant > 0){
	$sql = "SELECT * FROM video WHERE id = " . $id_video_courant;
	$current_video = CBdd::select_row($sql);
}
?>
<?php 
	if($nb_video > 1) {		
		?>
		<div class="video-list">
			<ul>
			<?php 
			$i = 1;
			while($video = mysql_fetch_assoc($res)) {
				$link = CUrl::get_href('video', $video['id'], $video['nom']);
				?>
				<li class="<?php echo $id_video_courant==$video['id']?'active-video':''; ?>"><a href="<?php echo $link; ?>"><?php echo $video['nom']; ?></a></li>
				<?php
				$i++;
			}
			?>
$iOppTypeId = CFunctions::getUserParam('iOppTypeId', 0) ;

//$zTableUtilite = ($iOppTypeId) ? 'opportunite' : 'hbopportunites' ;
$zTableUtilite = 'opportuniteContact';

$zSqlText  = " SELECT texte.* FROM texte" ;
$zSqlText .= " INNER JOIN " . $zTableUtilite . " ON texId = texte.id" ;
$zSqlText .= " WHERE " . $zTableUtilite . ".id = " . $iOppId ;

$toTextes = CBdd::select_row($zSqlText) ;

$zSqlPj  = " SELECT hbpiecesjointes.* FROM hbpiecesjointes" ;
$zSqlPj .= " INNER JOIN " . $zTableUtilite . " ON pieId = hbpiecesjointes.id" ;
$zSqlPj .= " WHERE " . $zTableUtilite . ".id = " . $iOppId ;

$toPieces = CBdd::select_row($zSqlPj) ;

$zHtml = '' ;

if ($toTextes)
{
    $zTxtCut = CFunctions::cut_string($toTextes['nom'], 15) ;
    $zHtml .= '<p>' ;
    $zHtml .= '    <label class="info">' . $zTxtCut ;
    $zHtml .= ($zTxtCut != $toTextes['nom']) ? '    <span class="bulle">' . $toTextes['nom'] . '</span>' : '' ;
    $zHtml .= '    </label>' ;
    $zHtml .= '    <input type="radio" value="1" class="radioText" name="radioText" /> Oui' ;
    $zHtml .= '    <input type="radio" value="0" class="radioText" name="radioText" checked="checked" /> Non' ;
    $zHtml .= '</p>' ;
}
示例#23
0
	static function get_enum($table, $label) {
		$sql = "SHOW COLUMNS FROM " . $table . " LIKE '" . $label . "'";
		$res = CBdd::select_row($sql);
		$arr = explode(",", str_replace("','", ",", trim(substr($res[1], 5, -1), "'")));
		return $arr;
	}
示例#24
0
        <th nowrap="nowrap"><a href="?order=dateajout_ent">Date d'ajout</a></th>
        <th>Opp</th>
        <th><a href="?order=etatcontact_ent">Actif</a></th>
        <th>Modif</th>
        <th>Suppr</th>
        <th>Envoi</th>
        <th>Q/R</th>
        <th><input name="select" type="checkbox" id="select" onclick="reverse_check()" value=""/></th>
    </tr>
    <?php
		  $i = 0; 
		  
		  if ($r_user){
		  while ($user = mysql_fetch_array($r_user)) {
		  	
		  	$relance = CBdd::select_row("SELECT COUNT(id) as num FROM email WHERE date < NOW() AND type='relance' AND destinataire LIKE '%".$user['mail_ent']."%'");

	      ?>
            <tr>
              <td><a href="?a=5&id=<?php echo $user['id_ent'] ?>"><?php echo $user['id_ent'] ?></a></td>
              <?
				$chaine=$user['image_ent'];
			    $line = 'detail/';
				$position = strpos($chaine,$line);
				$depart = $position + 7;
				//$longueur = $depart + 50;
				$image = substr($chaine, $depart, 50);
			?>
			  <!-- <td align="center"><a href="<? //echo SS_ADMIN_TO_USERFILE;?>/userfiles/image/entreprise/detail/<?php //echo $image ?>"><?php //echo //$image; ?></a></td> -->
			   <td class="zinfo"> 			  
			      <?php
示例#25
0
}

/*--------------------------------------------------------------------
		TRAITEMENTS
----------------------------------------------------------------------*/
switch ($a) {

case 0 : // Afficher
	break;
		
case 5 : // Modifier 1
	//$tconfig 		= new CTableConfiguration(array('id'=>$id));
	if(!empty($_GET['id'])) $id = $_GET['id'];
	$Zsql   = "SELECT * FROM configuration WHERE id = ".$id;
	//print_r($Zsql);
	$configuration = CBdd::select_row($Zsql) ;
	//$configuration  = $tconfig->select_row();
	$nom  			= $configuration['nom'];
	$valeur  		= $configuration['valeur'];
	$choix  		= $configuration['choix'];
	break;
		
case 55 : // Modifier 2
	if(!empty($_POST['id'])) 		$id 		= $_POST['id'];
	if(!empty($_POST['valeur'])) 	$valeur 	= CFunction::addslashes(trim($_POST['valeur']));

	if ($valeur=="") {
		$error_type = 2;
		$error_signe['valeur'] = "*";
	}
	if ($error_type > 0) {
示例#26
0
include_once("../inc/init.php");
/*--------------------------------------------------------------------
		INITIALISATIONS
----------------------------------------------------------------------*/
$id		 =   0;

/*---------------------------------------------------------------------
		VARIABLES HTTP
----------------------------------------------------------------------*/
if(!empty($_GET['id'])) $id = $_GET['id'];

/*--------------------------------------------------------------------
		TRAITEMENTS
----------------------------------------------------------------------*/
$sql  = "SELECT * FROM menus WHERE id = " . $id;
$menu = CBdd::select_row($sql);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Aper&ccedil;u du menu : <?php echo $menu['titre'], ' du ' ,  CDate::formate_date($menu['date']); ?> </title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
	padding:15px;
	text-align:justify;
}

label {
	color: gray;
示例#27
0
            <th align="left"><a href="?order=id">Id</a></th>
            <th align="left"><a href="?order=nom">Nom</a></th>
            <th align="left"><a href="?order=text">Texte</a></th>
            <th><a href="?order=date">P&eacute;riode</a></th>
            <th><a href="?order=etat">Etat</a></th>
            <th>Modif</th>
            <th title="suppr"> Suppr </th>
          </tr>
          <?php
		  $i = 0; 
		  $periode = 'J';
		  while ($email = @mysql_fetch_array($r_email)) {
	  			if($email['periode'] > 0) {
	  				$periode = 'J+'.$email['periode'];
	  			}
	  		$texte = CBdd::select_row("SELECT id FROM texte WHERE nom = '".$email['text']."'");
	      ?>
          <tr>
            <td><a href="show_texte.php?id=<?php echo $texte['id'] ?>" target="popup" onclick="popup(this.href, this.target, '800', '600');"> <?php echo $email['id'] ?> </a></td>
            <td><?php echo $email['nom'] ?></td>
            <td><?php echo $email['text'] ?></td>
            <td align="center"><?php echo $periode; ?></td>
            <td align="center"><?php echo CHtml::get_etat($email['id'], $email['etat'], CTableUser::is_admin($_SESSION['idmbr'])); ?></td>
            <td align="center"><?php echo CHtmlSession::get_editbutton($email['id'], CTableUser::is_admin($_SESSION['idmbr'])) ?></td>
            <td align="center"><?php echo CHtmlSession::get_delbutton($a, $email['id'], $id, CTableUser::is_admin($_SESSION['idmbr'])) ?></td>
          </tr>
          <?php } ?>
        </table>
        <?php } ?>
        <?php 
//----------------------------------------------------------------------------------------------
示例#28
0
/*--------------------------------------------------------------------
		INITIALISATIONS
----------------------------------------------------------------------*/
$id_page		=   0;
$msginfo 		= 	"";

/*---------------------------------------------------------------------
		VARIABLES HTTP
----------------------------------------------------------------------*/
if(!empty($_GET['id_page'])) $id_page = $_GET['id_page'];

/*--------------------------------------------------------------------
		TRAITEMENTS
----------------------------------------------------------------------*/
$sql  = "SELECT nom, text, head FROM page WHERE id = $id_page";
$page = CBdd::select_row($sql);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Aper&ccedil;u de la page : <?php echo $page['nom']; ?></title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
	padding:15px;
	text-align:justify;
}
</style>
<?php echo $page['head'] ?>
</head>
示例#29
0
	static function get_groupe($id)
	{
		$sql = "SELECT * FROM groupeUtilitaire WHERE FIND_IN_SET(".$id.", REPLACE(`text`, '|', ',')) > 0";
		return CBdd::select_row($sql);
	}
示例#30
0
    /**
     * L'enregistrement actuel a t il le rang le plus grand
     *
     */
    public function isEndRang()
    {
        $toTables = $this->__getById() ;

        $isEndRang = 0 ;

        if ($toTables[$this->zRangColone])
        {
            // --- le rang le plus grand
            $zWhere  = ($this->zParentColone) ? $this->zParentColone . " = " . $toTables[$this->zParentColone] : "" ;
            $zAnd   .= ($zWhere) ? " AND " : "" ;

            $zSql = "SELECT MAX(" . $this->zRangColone . ") AS " . $this->zRangColone . " FROM " . $this->zTableName . " WHERE 0 = 0 " . $zAnd . $zWhere ;
            $toEnregEnds = CBdd::select_row($zSql) ;

            // --- verification
            if (isset($toEnregEnds[$this->zRangColone]) && $toEnregEnds[$this->zRangColone] == $toTables[$this->zRangColone])
            {
                $isEndRang = 1 ;
            }
        }

        return $isEndRang ;
    }