Пример #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
	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
	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);
	}
Пример #6
0
	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;
	}
Пример #7
0
	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;
	}	
Пример #8
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;
	}
Пример #9
0
	static function get_option($selectedvalue, $idconfiguration) {
		   $option = "";
		   $sql = "SELECT choix FROM configuration WHERE id = " . $idconfiguration;
		   $result = CBdd::select_one($sql, "choix");
		   $choix_possible = explode('|', $result);
		   foreach($choix_possible as $valeur) {
		   		$selected = CForm::get_selected($selectedvalue, $valeur);
		   		$option = $option . "<option value='" . $valeur . "'" . $selected . ">" . $valeur . "</option>\n";
		   }
		   return $option;
	}
Пример #10
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;
	}
Пример #11
0
	static function get_down($tablename, $id, $actif=0) {
		if($actif) {
			$sql = "select isendrang_" . $tablename . "(" . $id . ") as ok";
			$res = CBdd::select_one($sql, 'ok');
			$ret = ($res!=1) ? "<a href=?id=$id&a=1><img src='../img/downarrow.png' alt='down' /></a>" : "";
		} else {
			$sql = "select isendrang_" . $tablename . "(" . $id . ") as ok";
			$res = CBdd::select_one($sql, 'ok');
			$ret = ($res!=1) ? "<img src='../img/downarrow.png' alt='down' class='grise'/>" : "";
		}
		return $ret;
	}
Пример #12
0
	public static function test_ficgrpmail_in_campagne($iType=0,$iId=0){
		$zSql = " ";
		$zSql .= " SELECT id_groupe FROM campagne ";
		if($iType == 2){
			$zSql .= " INNER JOIN email ON ( email.id_campagne = campagne.id ) ";
			$zSql .= " INNER JOIN moul_groupes ON ( moul_groupes.id = email.id_groupe) ";
			$zSql .= " WHERE email.id_groupe = " . $iId . " AND email.type_groupe = " . $iType;
			$oRes = CBdd::select_one($zSql,'id_groupe');
			if($oRes) return 1;
			else return 0;
		}
	}
Пример #13
0
	function load($message_number) {
		$sql_0 = "INSERT INTO email(id, nom, text, expediteur, destinataire, date, imap) VALUES ";
		$sql_1 = "";
		$info = $this->get_info($message_number);
		$sql_1 = "(null, '". addslashes($info['subject']) . "', '" . addslashes($this->get_text($message_number)) . "', '". $info['from'] . "', '". $info['to'] . "', '". $this->formate_date($info['date']) . "', '". $info['message_id'] . "'),";
		$sql = $sql_1 ? trim($sql_0 . $sql_1, ",") : "";
		if($sql) {
			return CBdd::insert($sql);
		} else {
			return false;
		}
	}
Пример #14
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;
	}
Пример #15
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);
	}
Пример #16
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);
	}
Пример #17
0
			         <?php echo utf8_encode($nomCat); ?>
			    </div>	
			  </td>
              <td align="center"><?php if ($user['dateajout_ent'] != "00-00-0000") echo CDate::date_switch($user['dateajout_ent'])  ?></td>
              <td align="center"><?php echo CHtmlUser::get_etat_contact($user['id_ent'], $user['etat_contact'], 0) ?></td>
              
			            
			  <td style="text-align: center;">
              		<?php echo $opp_num[$user['idopportunite']]; ?>
              		
		      </td>

              <td align="center"><a href="contact.php?a=5&id=<?php echo $user['id_ent'] ?>" target="_parent"><img src="../img/b_edit.png" alt="modifier, afficher" /></a></td>
              <td align="center"><?php echo CHtmlSession::get_delbutton($a, $user['id_ent'], $id, $user['id_ent']) ?></td>
              <td><a href="envoi.php?destinataire=<?php echo $user['email'] ?>&a=4" target="_parent">&gt;&gt;</a></td>
              <td align="center"><?php if(CBdd::select_one("SELECT count(id) AS nb_reponse FROM reponse WHERE iduser = "******"../src/reponse.php?id=<?php echo $user['id_ent'] ?>" target="popup" onclick="popup(this.href, this.target, '600', '500'); return false;"> >> </a>
                <?php } ?></td>
              <td><input type="checkbox" name="ids[]" class="id_del" value="<?php echo $user['id_ent'] ?>"/></td>
            </tr>
            <?php $i++; 
			}
			}
			?>
</table>
   <p> <?php echo CForm::get_hidden(7); ?> </p>   
   		<p>
   		<input type="hidden" name="id_groupe" value="<?php echo $_SESSION['id_groupe']; ?>"/>   		
   		</p>
   			
</form>
Пример #18
0
	static function get_valeur($nom) {
		$sql = "SELECT valeur FROM configuration WHERE nom = '" . $nom . "'";
		$valeur = CBdd::select_one($sql, 'valeur');
		return $valeur;
	}
Пример #19
0
function get_id_element_parent($id_sousmenu) {
	$col = "id" . substr($this->table_parent, 0, 3);
	$sql = "SELECT id" . substr($this->table_parent, 0, 3) . " FROM " . $this->table . " WHERE id = " . $id_sousmenu;
	$res = CBdd::select_one($sql, $col);
	return $res;
}
Пример #20
0
			<th align="left"><a href="?order=txt">Textes</a></th>
    		<th align="left"><a href="?order=pj">Pieces-jointes</a></th>
            <th><a href="?order=date">Date d'ajout</a></th>
           <th>Publi&eacute;</th>
            <th>Modif</th>
            <th title="suppr"> Suppr </th>
          </tr>
          <?php
		  $i = 0; 
		  while ($opportunite = mysql_fetch_array($r_opportunite)) {	
				  $xzsql = "SELECT nom from texte where id=".$opportunite['texId'];
				//print_r($xzsql);
				$text = CBdd::select_one($xzsql,'nom');
				$xzsql = "SELECT piece from hbpiecesjointes where id=".$opportunite['pieId'];
				//print_r($xzsql);
				$piece= CBdd::select_one($xzsql,'piece');
				?>
          <tr>
            <td><a href="?a=5&id=<?=$opportunite['id'] ?>"><?=$opportunite['id'] ?></a></td>
            <td><?=utf8_encode ($opportunite['nom']); ?></td>
			<td><?=$text ; ?></td>
  			<td><?=str_replace('../../userfiles/pieces_jointes/', '',$piece); ?></td>
            <td align="center"><?=CDate::date_switch(CDate::formate_date($opportunite['date'])) ?></td>
            <td align="center"><?=CHtml::get_etat($opportunite['id'], $opportunite['etat'], $opportunite['id']); ?></td>
            <td align="center"><?=CHtmlSession::get_editbutton($opportunite['id'], $opportunite['id']) ?></td>
            <td align="center"><?=CHtml::get_delbutton($a, $opportunite['id'], $id,  $opportunite['id']) ?></td>
          </tr>
          <?php } ?>
        </table>
        <?php } ?>
Пример #21
0
	function reverse_cmtr() {
		CBdd::update("UPDATE image SET etat_com = 1-etat_com WHERE id = ".$this->table['id']);
	}
Пример #22
0
	static function insert($mail,$file)
	{
		$date = date("Y-m-d H:i:s");
		$zSql = " INSERT INTO moul_tables_tmp (mtp_id,mtp_iListId,mtp_zMail,mtp_iEtat,mtp_zDateCreation) VALUES('','" . $file . "','" . $mail . "','0','".$date."') ";
		CBdd::insert($zSql);
	}
Пример #23
0
	static function get_idrdv_of_user($iduser) {
		return CBdd::select_one("SELECT id FROM rdvContact WHERE iduser="******" LIMIT 1", "id");
	}
Пример #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
	static function login_ok($login, $passe, $critere = '') {
		$sql = "SELECT id FROM user WHERE login = '******' AND passe = '" . $passe . "'" . $critere;
		$id  = CBdd::select_one($sql, "id");
		if ($id != "") 	return $id;
		else     		return '';
	}
Пример #26
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')));
Пример #27
0
          </div>
          </fieldset>
        </form>        
        <form id="modif_envoi" method="post" action="envoi-campagne.php">
        	<!-- Cadre contextuelle -->
         	<div id="cadre-envoi">         		
         		<?php
         			if($nb_envoi > 0) {
         				$campagne = new CTableCampagne(array('id'=>$id));
           				$envoi = $campagne->get_envoi_1();  
           				
           				$sql = "SELECT DATE_FORMAT(date, '%Y/%m/%d') AS min_range FROM email WHERE date < '".$envoi['date']."' AND id_campagne = ".$envoi['id_campagne']." ORDER BY date DESC LIMIT 0, 1";
									$left = CBdd::select_one($sql, 'min_range');
									
									$sql = "SELECT DATE_FORMAT(date, '%Y/%m/%d') AS max_range FROM email WHERE date > '".$envoi['date']."' AND id_campagne = ".$envoi['id_campagne']." ORDER BY date ASC LIMIT 0, 1";
									$right = CBdd::select_one($sql, 'max_range');
		
         				?>
         				<fieldset>
          					<legend>Modifier Envoi 1</legend>
          					<p>
				          		<label>Type Groupe</label>
          						<span style="font-size:12px">Groupe</span>  <input type="radio" id="groupe" name="isGr" value="0" <?php if ($envoi['type_envoi'] == 0) echo 'checked="checked"'; ?> onclick="javascript:location.href='<?= URL_RACINE; ?>adminpanther/src/campagne.php?id=<?php echo $id ?>&a=5&isGr=0'" />
          						<span style="font-size:12px">Groupe GR</span> <input type="radio" id="groupe_gr" name="isGr" value="1" <?php if ($envoi['type_envoi'] == 1) echo 'checked="checked"'; ?> onclick="javascript:location.href='<?= URL_RACINE; ?>adminpanther/src/campagne.php?id=<?php echo $id ?>&a=5&isGr=1'" />
				          	</p>
          					<p>
				          		<label>Nom Groupe</label>
          						<select name="id_groupe">
				                	<?php 
				                		if ( $envoi['type_envoi'] == 0 ){
				                			echo CForm::get_option($envoi['id_groupe'], 'groupe') ;
Пример #28
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;
	}
Пример #29
0
		break;
	}
	$tart= new CTableArticle(array('nom'=>CFunction::addslashes($nom), 'etat'=>$etat, 'idcat'=>$idcat));
	$tart->insert();
	$msginfo = "sous-menu bien ajout&eacute;";
	$a = 0;
	break;
	
case 5 : // Modifier 1
	if(!empty($_GET['id'])) $id = $_GET['id'];
	$tart= new CTableArticle(array('id'=>$id));
	$art = $tart->select_row();
	$nom  = $art ['nom'];
	$etat = $art ['etat'];
	$idcat = $art ['idcat'];
	$idreda		= CBdd::select_one("SELECT idreda FROM article_cat WHERE id = ".$id, 'idreda');
	
	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']);
	if(!empty($_POST['etat'])) 	$etat 	= $_POST['etat'];
	if(!empty($_POST['idcat'])) $idcat 	= $_POST['idcat'];
	
	if ($nom=="") {
Пример #30
0
	function get_nb() {
		$sql = "SELECT count(id) AS nb FROM " . $this->table['tablename'];
		$nb = CBdd::select_one($sql, 'nb');
		return $nb;
	}