本文整理汇总了PHP中CBdd类的典型用法代码示例。如果您正苦于以下问题:PHP CBdd类的具体用法?PHP CBdd怎么用?PHP CBdd使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CBdd类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_footer
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;
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:7,代码来源:CTableFooter.php
示例2: __construct
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'];
}
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:26,代码来源:CMeta.php
示例3: send
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 = "SELECT * FROM user WHERE email = '" . $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);
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:30,代码来源:CWelcome.php
示例4: GetRSS
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;
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:35,代码来源:CFeed.php
示例5: create
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);
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:26,代码来源:CSitemap.php
示例6: get_keyword
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;
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:9,代码来源:CMeta.php
示例7: get_option
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;
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:10,代码来源:CForm.php
示例8: get_design
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;
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:10,代码来源:CTableDesign.php
示例9: get_option
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;
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:11,代码来源:CFormConfiguration.php
示例10: show_db_content
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;
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:12,代码来源:CInstall.php
示例11: get_down
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;
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:12,代码来源:CHtml_.php
示例12: test_ficgrpmail_in_campagne
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;
}
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:12,代码来源:CTableCampagne.php
示例13: load
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;
}
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:12,代码来源:CImap.php
示例14: get_elements
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;
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:15,代码来源:CFormQuestion.php
示例15: delete_user
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);
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:45,代码来源:CDesinscription.php
示例16: get_adress
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);
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:20,代码来源:CPublipostage.php
示例17: utf8_encode
<?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">>></a></td>
<td align="center"><?php if(CBdd::select_one("SELECT count(id) AS nb_reponse FROM reponse WHERE iduser = " . $user['id_ent'], 'nb_reponse')) { ?>
<a href="../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>
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:31,代码来源:user_groupeUtilitaire.php
示例18: get_valeur
static function get_valeur($nom) {
$sql = "SELECT valeur FROM configuration WHERE nom = '" . $nom . "'";
$valeur = CBdd::select_one($sql, 'valeur');
return $valeur;
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:5,代码来源:CConfiguration.php
示例19: get_id_element_parent
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;
}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:6,代码来源:CSousmenu.php
示例20: while
<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é</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 } ?>
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:30,代码来源:opportunite.php
注:本文中的CBdd类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论