コード例 #1
0
ファイル: AppController.php プロジェクト: wedesign-pf/code-g
 public function req_myselect($name)
 {
     $mySelect = new mySelect(__FILE__);
     $mySelect->tables = "{$thisSite->PREFIXE_TBL_CLI} .{$name}";
     $mySelect->fields = "id,titre";
     $mySelect->where = "actif=:actif";
     $mySelect->whereValue["actif"] = "1";
     $mySelect->orderby = "titre ASC";
     $this->result = $mySelect->query();
 }
コード例 #2
0
ファイル: class.articles.php プロジェクト: wedesign-pf/Tit
 public function query($debug = "")
 {
     global $thisSite;
     $mySelect = new mySelect(__FILE__);
     $mySelect->tables = $thisSite->PREFIXE_TBL_GEN . "articles";
     if ($this->fields == "") {
         $mySelect->fields = "*";
     } else {
         $mySelect->fields = $this->fields;
     }
     $mySelect->where = "actif=1 AND art = '" . $this->article . "'";
     if ($this->lg != "" && $this->lg != "all") {
         // si une langue est indiqué on l'utilise
         $mySelect->where .= " AND lg='" . $this->lg . "'";
     } else {
         if ($this->lg == "") {
             $mySelect->where .= " AND lg='" . $thisSite->current_lang . "'";
         }
     }
     if ($this->id != "") {
         $mySelect->where .= " AND id=" . $this->id;
     }
     if ($this->where != "") {
         $mySelect->where .= " AND " . $this->where;
     }
     if ($this->orderby == "") {
         $mySelect->orderby = "id ASC";
     } else {
         $mySelect->orderby = $this->orderby;
     }
     if ($this->limit != "") {
         $mySelect->limit = $this->limit;
     }
     $result = $mySelect->query($debug);
     // on ajoute les médias si demandé
     $whatMedias = explode(",", $this->medias);
     if (count($whatMedias) > 0) {
         foreach ($result as $x => $row) {
             foreach ($whatMedias as $media) {
                 $thisMedia = new media($this->article . "_" . $media);
                 $thisMedia->idParent = $row["id"];
                 $dataMedias = $thisMedia->get();
                 $result[$x][$media] = $dataMedias;
             }
         }
     }
     return $result;
 }
コード例 #3
0
ファイル: fonctions.php プロジェクト: wedesign-pf/Tit
function deleteArbo($idDel)
{
    global $thisSite;
    $arbo_site = array();
    $mySelect = new mySelect(__FILE__);
    $mySelect->tables = $thisSite->PREFIXE_TBL_GEN . "arbo";
    $mySelect->fields = "*";
    $result = $mySelect->query();
    foreach ($result as $row) {
        $nivRub = unserialize($row['arbo_menu']);
        //echoa($row['code_menu']);
        //echoa($nivRub);
        if (array_key_exists($idDel, $nivRub)) {
            unset($nivRub[$idDel]);
        }
        if (is_array($nivRub)) {
            foreach ($nivRub as $idRub => $nivsRub) {
                //echoa($nivsRub);
                if (is_array($nivsRub)) {
                    if (array_key_exists($idDel, $nivsRub)) {
                        unset($nivRub[$idRub][$idDel]);
                    }
                }
                if (is_array($nivsRub)) {
                    foreach ($nivsRub as $idsRub => $nivssRub) {
                        //echoa($nivssRub);
                        if (is_array($nivssRub)) {
                            if (array_key_exists($idDel, $nivssRub)) {
                                unset($nivRub[$idRub][$idsRub][$idDel]);
                            }
                        }
                    }
                }
                //$nivsRub
            }
        }
        //$nivRub
        //echoa($nivRub);
        $myUpdate = new myUpdate(__FILE__);
        $myUpdate->table = $thisSite->PREFIXE_TBL_GEN . "arbo";
        $myUpdate->field["arbo_menu"] = serialize($nivRub);
        $myUpdate->where = "code_menu='" . $row['code_menu'] . "'";
        $result = $myUpdate->execute();
    }
    // suppression dans l'arbo
}
コード例 #4
0
ファイル: fonctions_data.php プロジェクト: wedesign-pf/Tit
function getEmail($code)
{
    global $thisSite;
    $mySelect = new mySelect(__FILE__);
    $mySelect->tables = $thisSite->PREFIXE_TBL_GEN . "emails";
    $mySelect->fields = "*";
    $mySelect->where = "code=:code";
    $mySelect->whereValue["code"] = array($code, PDO::PARAM_STR);
    $result = $mySelect->query();
    $row = current($result);
    $titre = $row["titre"];
    $email = $row["email"];
    $ltemp = array();
    array_push($ltemp, $email);
    array_push($ltemp, $titre);
    return $ltemp;
}
コード例 #5
0
ファイル: class.site.php プロジェクト: wedesign-pf/Tit
 public function load_pages($debug = 0)
 {
     //   if(is_array($this->pages)) { return false; } // si existe déjà, on passe
     $pages = array();
     $mySelect = new mySelect(__FILE__);
     $mySelect->tables = $this->PREFIXE_TBL_GEN . "pages";
     $mySelect->fields = "*";
     $mySelect->where = "lg=:lg AND actif=1";
     $mySelect->whereValue["lg"] = array($this->current_lang, PDO::PARAM_STR);
     $mySelect->orderby = "id ASC";
     $result = $mySelect->query();
     foreach ($result as $row) {
         $idPage = stripslashes($row["id"]);
         $datasPages = $row;
         // si tag_title vide : tag_title = page_titre
         if ($datasPages["page_tag_title"] == "") {
             $datasPages["page_tag_title"] = $datasPages["page_titre"];
         }
         // page_url = URL simple sans arbo ni type de page
         // insert chemin absolue si !!racine!!
         $datasPages["page_url"] = str_replace($this->SEPVAR . "racine" . $this->SEPVAR, $this->RACINE, $datasPages["page_url"]);
         $pages[$idPage] = $datasPages;
     }
     $this->pages = $pages;
     $this->loadUrlPages();
     if ($debug == 1) {
         echoa($pages);
     }
     return true;
 }
コード例 #6
0
ファイル: bandeaux.php プロジェクト: wedesign-pf/code-g
$mySelect->fields = "id";
$mySelect->where = "( actif=1 AND periode_beg<=" . $date_test . " AND periode_end>=" . $date_test . ")";
$mySelect->where .= " OR ( actif=1 AND periode_beg=0 AND periode_end=0)";
$result = $mySelect->query();
$listBandeaux = array();
foreach ($result as $row) {
    $mySelect1 = new mySelect(__FILE__);
    $mySelect1->tables = $thisSite->PREFIXE_TBL_PUB . "bandeaux";
    $mySelect1->fields = "id";
    $mySelect1->where = "id_campagne=:id_campagne AND lg=:lg AND actif=1";
    if ($pub_force_bandeau != "") {
        $mySelect1->where .= " AND id='" . $pub_force_bandeau . "'";
    }
    $mySelect1->whereValue["id_campagne"] = array($row["id"], PDO::PARAM_INT);
    $mySelect1->whereValue["lg"] = array($thisSite->current_lang, PDO::PARAM_STR);
    $result1 = $mySelect1->query();
    foreach ($result1 as $row1) {
        $listBandeaux[] = $row1["id"];
    }
}
if (!is_array($thisSite->pubDejaPresenteDansLaPage)) {
    $thisSite->pubDejaPresenteDansLaPage = array();
}
$bandeauChoisi = "";
if (count($listBandeaux) > 0) {
    while (count($listBandeaux) > count($thisSite->pubDejaPresenteDansLaPage)) {
        // vérifie que le bandeau n'est pas déjà présent dans la page
        $key = array_rand($listBandeaux);
        $bandeauChoisi = $listBandeaux[$key];
        if (!in_array($bandeauChoisi, $thisSite->pubDejaPresenteDansLaPage)) {
            $thisSite->pubDejaPresenteDansLaPage[] = $bandeauChoisi;
コード例 #7
0
ファイル: categories.php プロジェクト: wedesign-pf/code-g
/**************************************************
*
*   Requête concernant la Table Catégorie
*
*************************/
// Récupérer les catégories par rapport aux éléments donnée par la requête $tabElement
$list_categorie_full = array();
foreach ($tabElement as $Kelem => $Velem) {
    $mySelect = new mySelect(__FILE__);
    $mySelect->tables = $thisSite->PREFIXE_TBL_CLI . "categories";
    $mySelect->fields = "*";
    $mySelect->where = "actif=:actif AND id=:id_categorie";
    $mySelect->whereValue["actif"] = "1";
    $mySelect->whereValue["id_categorie"] = $Velem['id_categorie'];
    $list_categorie_full[] = $mySelect->query();
}
$list_categorie = array();
foreach ($list_categorie_full as $keyList => $cat) {
    $cat = current($cat);
    $list_categorie['Categorie'][$cat['id']] = array('id' => $cat["id"], 'titre' => $cat["titre"], 'list_champ' => $cat["list_champ"], 'list_type_utilisateur' => $cat["list_type_utilisateur"]);
}
// Injecter $list_categorie dans $tabElement pour avoir un seul tableau propre
foreach ($tabElement as $k => $value) {
    //$id_categories[$k] = $value[id_categorie];
    $list_element['Element'][$k] = array('id' => $value[id], 'titre' => $value[titre], 'creation_date' => $value[creation_date], 'actif' => $value[actif], 'creation_utilisateur' => $value[creation_utilisateur], 'remarques' => $value[remarques], 'id_projet' => $value[id_projet], 'Categorie' => $list_categorie['Categorie'][$value['id_categorie']]);
}
if (!$list_element) {
    ?>
        <div class="row">
            <div class="col-sm-12">
コード例 #8
0
ファイル: class.form.php プロジェクト: wedesign-pf/Tit
 public function get_datas($debug = 0)
 {
     global $myAdmin;
     $mySelect = new mySelect(__FILE__);
     $mySelect->tables = $this->tables;
     $mySelect->fields = $this->fields;
     $mySelect->limit = 1;
     $mySelect->where = $this->whereFull;
     foreach ($this->whereValuebyLg as $clg => $whereValueFull) {
         $mySelect->whereValue = $whereValueFull;
         $result = $mySelect->query($debug);
         $row = current($result);
         //echoa($row);
         if (is_array($row)) {
             foreach ($row as $k => $v) {
                 $k = htmlspecialchars($k, ENT_QUOTES);
                 $row[$k] = htmlspecialchars($row[$k], ENT_QUOTES);
             }
             $this->datasForm[$clg] = $row;
         } else {
             $this->datasForm[$clg] = array();
         }
         //echoa($row);
     }
     if ($debug == 3) {
         echoa($this->datasForm);
     }
     return 1;
 }
コード例 #9
0
ファイル: elements.php プロジェクト: wedesign-pf/code-g
*   Requête concernant la Table Eléments
*
*************************/
// Récupérer les éléments par rapport aux variables "$var_field_id" et "$id"
$tabElement = array();
$mySelect = new mySelect(__FILE__);
$mySelect->tables = $thisSite->PREFIXE_TBL_CLI . "elements";
$mySelect->fields = "*";
if (!empty($action)) {
    $mySelect->where = "actif=:actif AND id=:id_element AND {$var_field_id}=:{$var_field_id}";
    $mySelect->whereValue["id_element"] = $id_element;
    $mySelect->whereValue["id_projet"] = $currentProjet['id'];
    $mySelect->whereValue["actif"] = "1";
} else {
    if (!$action) {
        $mySelect->where = "actif=:actif AND {$var_field_id}=:{$var_field_id}";
        $mySelect->whereValue["actif"] = "1";
        $mySelect->whereValue["{$var_field_id}"] = $id;
    }
}
$mySelect->orderby = "titre ASC";
$tabElement = $mySelect->query();
foreach ($tabElement as $KElement => $Element) {
    // Récupérer le prefix de id_utilisateur "admin-"
    $prefix_utilisateur[$KElement] = substr($Element["creation_utilisateur"], 0, 6);
    if ($prefix_utilisateur[$KElement] == "admin-") {
        // garder les valeurs apres "admin-"
        $nom_utilisateur[$KElement] = substr($Element["creation_utilisateur"], 6);
        $tabElement[$KElement]["creation_utilisateur"] = ucfirst($nom_utilisateur[$KElement]);
    }
}
コード例 #10
0
ファイル: class.selectM.php プロジェクト: wedesign-pf/Tit
 public function add($param = "")
 {
     if (!is_array($this->items) && $this->tags != true) {
         return 0;
     }
     global $myAdmin;
     global $formMaj;
     global $datas_lang;
     global $smarty;
     global $thisSite;
     if ($this->tags == true) {
         $this->multiLang = false;
         // multilangue géré par la table des tags
     }
     $this->LIST_LANG_EXTENSION_FIELD = $myAdmin->LIST_LANG_EXTENSION_FIELD;
     parent::add();
     $smarty->assign('this', $this);
     $listDisabled = array();
     if (!is_array($this->valuesDisabled)) {
         $valuesDisabled = explode(",", $this->valuesDisabled);
         $listDisabled = $valuesDisabled;
     } else {
         $listDisabled = $this->valuesDisabled;
     }
     foreach ($this->list_lang as $clg => $extlg) {
         $value = $this->getValue($clg);
         $values = explode(",", $value);
         if (!is_array($values)) {
             $values = array();
         }
         if ($this->tags == true) {
             if ($listItems == "") {
                 $listItems = array();
                 $mySelect2 = new mySelect(__FILE__);
                 $mySelect2->tables = $thisSite->PREFIXE_TBL_GEN . "tags";
                 $mySelect2->fields = "*";
                 $mySelect2->where = "parent=:parent AND lg=:lg";
                 $mySelect2->whereValue["parent"] = array($this->field, PDO::PARAM_STR);
                 $mySelect2->whereValue["lg"] = array("fr", PDO::PARAM_STR);
                 $mySelect2->orderby = "titre ASC";
                 $result2 = $mySelect2->query();
                 foreach ($result2 as $row2) {
                     $listItems[$row2['id']] = $row2['titre'];
                 }
             }
         } else {
             $listItems = $this->items;
         }
         if ($this->iconeLangue() == true || $this->tags == true) {
             $smarty->assign('marginLeft', 50);
         } else {
             $smarty->assign('marginLeft', 0);
         }
         $indice = 0;
         $datasItem = array();
         $count_items = count($listItems);
         $myGroup = "";
         foreach ($listItems as $val => $text) {
             $val = delQuotes($val);
             $value = delQuotes($value);
             if (in_array($val, $listDisabled)) {
                 $stateDisabled = "state-disabled";
                 $disabled = "disabled";
             } else {
                 $stateDisabled = "";
                 $disabled = "";
             }
             if (in_array(htmlspecialchars($val, ENT_QUOTES), $values)) {
                 $selected = "selected";
             } else {
                 $selected = "";
             }
             if ($count_items == 1) {
                 $str_indice = "";
             } else {
                 $str_indice = "_" . $indice;
             }
             $idField = $this->field . $extlg . $str_indice;
             $datasItem[$indice] = array("val" => $val, "text" => $text, "idField" => $idField, "stateDisabled" => $stateDisabled, "disabled" => $disabled, "selected" => $selected);
             $myGroup = $idField;
             $indice++;
             $marginLeft = 0;
         }
         //echoa($datasItem);
         $datasItemByLg[$clg] = $datasItem;
     }
     // lg
     $smarty->assign('datasItemByLg', $datasItemByLg);
     $allmyGroup = $smarty->getTemplateVars("myGroup");
     $allmyGroup .= $this->field . $extlg . ":\"" . $myGroup . "\",\n";
     $smarty->assign("myGroup", $allmyGroup);
     $data = $smarty->fetch($this->pathTemplate . 'inc/fields/class.selectM.tpl');
     addStructure("addJsStructure", DOS_OUTILS_ADMIN . "multiple-select/jquery.multiple.select.js");
     $this->smartAssign($this->field, $data);
     return $data;
 }
コード例 #11
0
function load_intitules_by_lang()
{
    global $thisSite;
    $intitules_lang = array();
    $mySelect = new mySelect(__FILE__);
    $mySelect->tables = $thisSite->PREFIXE_TBL_GEN . "intitules";
    $mySelect->fields = "*";
    $mySelect->where = "lg=:lg";
    $mySelect->whereValue["lg"] = array($thisSite->current_lang, PDO::PARAM_STR);
    $result = $mySelect->query();
    foreach ($result as $row) {
        $intitules_lang[$row["code"]] = add_variables($row["titre"]);
    }
    $thisSite->intitulesLang = $intitules_lang;
}
コード例 #12
0
ファイル: class.page.php プロジェクト: wedesign-pf/Tit
 public function addArbo()
 {
     global $thisSite;
     if ($this->idPage == 0 || $this->idPage == "") {
         return false;
     }
     $myTable = $thisSite->PREFIXE_TBL_GEN . "arbo";
     if ($this->idPageParent == "") {
         $this->idPageParent = 0;
     }
     if ($this->code_menu == "noneItem" || $this->code_menu == "") {
         $this->code_menu = "horsmenu";
     }
     $mySelect = new mySelect(__FILE__);
     $mySelect->tables = $myTable;
     $mySelect->fields = "arbo_menu";
     $mySelect->where = "code_menu='" . $this->code_menu . "'";
     $result = $mySelect->query();
     $row = current($result);
     $arbo_menu = unserialize($row['arbo_menu']);
     if (is_array($this->idPageParent)) {
         $arbo_menu[$this->idPageParent[0]][$this->idPageParent[1]][$this->idPage] = "";
     } else {
         if ($this->idPageParent > 0) {
             $arbo_menu[$this->idPageParent][$this->idPage] = "";
         } else {
             $arbo_menu[$this->idPage] = "";
         }
     }
     $myUpdate = new myUpdate(__FILE__);
     $myUpdate->table = $myTable;
     $myUpdate->field["arbo_menu"] = serialize($arbo_menu);
     $myUpdate->where = "code_menu='" . $this->code_menu . "'";
     $result = $myUpdate->execute();
 }
コード例 #13
0
$mySelect->tables = $thisSite->PREFIXE_TBL_CLI . "categories";
$mySelect->fields = "list_champ";
$mySelect->where = "actif=:actif AND id=:id";
$mySelect->whereValue["actif"] = "1";
$mySelect->whereValue["id"] = $__GET['idc'];
$result = $mySelect->query();
$row = current($result);
$list_champ_categorie = explode(",", $row["list_champ"]);
foreach ($list_champ_categorie as $idChamp) {
    $mySelect = new mySelect(__FILE__);
    $mySelect->tables = $thisSite->PREFIXE_TBL_CLI . "elements_champs";
    $mySelect->fields = "valeur";
    $mySelect->where = "id_element=:id_element AND id=:id";
    $mySelect->whereValue["id_element"] = $__GET['ide'];
    $mySelect->whereValue["id"] = $idChamp;
    $resultValeur = $mySelect->query();
    $rowValeur = current($resultValeur);
    if ($rowValeur["valeur"] != "") {
        if (in_array($idChamp, $list_champ_crypte)) {
            $rowValeur["valeur"] = decrypt_string("KEY", $rowValeur["valeur"]);
        }
    }
    ?>

<section>
    <div class="row">
        <label class='label col col-2'><?php 
    echo $list_champ[$idChamp];
    ?>
</label>
        <div class='col col-8 '>
コード例 #14
0
ファイル: connexion.php プロジェクト: wedesign-pf/code-g
 }
 /************************** 
  * 
  *  AUTHENTIFICATION DE L'UTILISATEUR
  *  - Vérifier si l'utilisateur existe en BDD, selon les paramères saisie dans le formulaire de connexion
  *
  *********************************************/
 // Récupérer l'utilisateur qui correspond au données saisies
 $mySelect = new mySelect(__FILE__);
 $mySelect->tables = $thisSite->PREFIXE_TBL_CLI . "utilisateurs";
 $mySelect->fields = "id,titre,email,id_type";
 $mySelect->where = "actif=:actif AND email=:email AND mdp=:mdp";
 $mySelect->whereValue["actif"] = "1";
 $mySelect->whereValue["email"] = $_POST['email'];
 $mySelect->whereValue["mdp"] = $password;
 $user = $mySelect->query();
 // Si l'utilisateur existe en base de données grâce aux informations saisies alors
 if (!empty($user)) {
     // Récupérer le titre du type d'utilisateur de l'utilisateur en question
     $obj_article = new article("type_utilisateur");
     $obj_article->fields = "id,titre";
     $obj_article->where = "id=" . $user[0]['id_type'];
     // $obj_article->whereValue["idType"]=$user[0]['id_type'];
     $tabType = $obj_article->query();
     // Injectetr dans le tableau Utilisateur le type utilisateur
     foreach ($user as $value) {
         $user[0]['type'] = $tabType[0][titre];
     }
     // Enregistrer les valeurs de l'utilisateur en Session
     $auth = current($user);
     $_SESSION['auth'] = $auth;
コード例 #15
0
ファイル: partials.php プロジェクト: wedesign-pf/code-g
        foreach ($list_champ as $KlistChamp => $VlistChamp) {
            if ($VlistChamp['id'] == $idc) {
                $listChamp[$kidc][] = array('id' => $VlistChamp['id'], 'titre' => $VlistChamp['titre'], 'filtre' => $VlistChamp['filtre']);
            }
        }
    }
}
// Récupérer les valeurs qui correspond aux champs
$listValeurs = array();
foreach ($list_element['Element'] as $klistE => $vlistE) {
    $mySelect = new mySelect(__FILE__);
    $mySelect->tables = $thisSite->PREFIXE_TBL_CLI . "elements_champs";
    $mySelect->fields = "id,valeur";
    $mySelect->where = "id_element=:id_element";
    $mySelect->whereValue["id_element"] = $vlistE['id'];
    $listValeur[] = $mySelect->query();
}
$listFiltre = array();
foreach ($listChamp as $KLC => $ChampFiltre) {
    foreach ($listChamp[$KLC] as $KeyLC => $VLC) {
        $listFiltre[$KLC] = $VLC['filtre'];
    }
}
// Injecter dans listChamps le tableaux des valeurs
$list_Champ_Valeur = array();
foreach ($listChamp as $Klistchamp => $Vlistchamp) {
    $list_Champ_Valeur[$Klistchamp]['Champ'] = $Vlistchamp;
    $list_Champ_Valeur[$Klistchamp]['Valeur'] = $listValeur[$Klistchamp];
}
// Décrypter les valeurs crypter
$newChampValeurs = array();
コード例 #16
0
ファイル: sitemap.php プロジェクト: wedesign-pf/Tit
     if ($sitemap_changefreq == "") {
         $sitemap_changefreq = "monthly";
     }
     if (stristr($tab_rub["lien_rub"], "javascript") === FALSE) {
         echo "<url>\n<loc>" . $thisSite->racineWithLang . $tab_rub["lien_rub"] . "</loc>\n<priority>{$sitemap_priority}</priority>\n<changefreq>{$sitemap_changefreq}</changefreq>\n</url>\n";
     }
     if (count($tab_rub["SRUBS"]) > 0) {
         foreach ($tab_rub["SRUBS"] as $id_srub => $tab_srub) {
             list($titre_srub, $lien_srub) = $tab_srub;
             $mySelect2 = new mySelect(__FILE__);
             $mySelect2->tables = $thisSite->PREFIXE_TBL_GEN . "pages";
             $mySelect2->fields = "*";
             $mySelect2->where = "id=:id AND actif=1 and lg=:lg";
             $mySelect2->whereValue["id"] = array($id_srub, PDO::PARAM_INT);
             $mySelect2->whereValue["lg"] = array($thisSite->current_lang, PDO::PARAM_STR);
             $result2 = $mySelect2->query();
             $row2 = current($result2);
             $sitemap_priority = $row2['page_sitemap_priority'];
             $sitemap_changefreq = $row2['page_sitemap_changefreq'];
             if ($sitemap_priority == "") {
                 $sitemap_priority = "0.5";
             }
             if ($sitemap_changefreq == "") {
                 $sitemap_changefreq = "monthly";
             }
             if ($tab_srub["lien"] != "") {
                 echo "<url>\n<loc>" . $thisSite->racineWithLang . $tab_srub["lien"] . "</loc>\n<priority>{$sitemap_priority}</priority>\n<changefreq>{$sitemap_changefreq}</changefreq>\n</url>\n";
             }
         }
     }
 }
コード例 #17
0
ファイル: controller.php プロジェクト: wedesign-pf/code-g
 public function sumbit_check_onglet($id_projet, $id_categorie, $id_element)
 {
     global $thisSite;
     $mySelect = new mySelect(__FILE__);
     $mySelect->tables = $thisSite->PREFIXE_TBL_CLI . "elements";
     $mySelect->fields = "*";
     $mySelect->where = "actif=:actif AND id=:id AND id_projet=:id_projet AND id_categorie=:id_categorie";
     $mySelect->whereValue["id"] = $id_element;
     $mySelect->whereValue["id_projet"] = $id_projet;
     $mySelect->whereValue["id_categorie"] = $id_categorie;
     $mySelect->whereValue["actif"] = "1";
     $result = $mySelect->query();
     if (empty($result)) {
         $this->clear_panel = true;
         return $this->clear_panel;
     }
 }
コード例 #18
0
ファイル: class.medias.php プロジェクト: wedesign-pf/code-g
 public function get()
 {
     global $thisSite;
     $mySelectM = new mySelect(__FILE__);
     $mySelectM->tables = $thisSite->PREFIXE_TBL_GEN . "medias";
     $mySelectM->fields = "*";
     $mySelectM->orderby = "chrono ASC";
     $mySelectM->where = "lg=:lg AND actif=1 AND field_media='" . $this->field . "'";
     if ($this->idParent > 0) {
         $mySelectM->where .= " AND id_parent=:idParent";
         $mySelectM->whereValue["idParent"] = array($this->idParent, PDO::PARAM_INT);
     }
     if ($this->idMedia > 0) {
         $mySelectM->where .= " AND id=:idMedia";
         $mySelectM->whereValue["idMedia"] = array($this->idMedia, PDO::PARAM_INT);
     }
     if ($this->onlySelection > 0) {
         $mySelectM->where .= " AND image_principale=1";
     }
     $mySelectM->whereValue["lg"] = array($thisSite->current_lang, PDO::PARAM_STR);
     $resultM = $mySelectM->query();
     $allMedias = array();
     $x = 1;
     foreach ($resultM as $rowM) {
         $temp = array();
         if ($rowM["fichier_media"] == "" && $rowM["lien_destination"] == "") {
             continue;
         }
         $temp["id"] = $rowM["id"];
         if ($rowM["type"] == "image") {
             $temp["image"] = $rowM["fichier_media"];
             for ($indiceVignette = 0; $indiceVignette < 5; $indiceVignette++) {
                 $temp["vig" . $indiceVignette] = get_vignette($rowM["fichier_media"], $indiceVignette);
             }
             $temp["legende"] = $rowM["titre_media"];
             $temp["fichier_destination"] = $rowM["fichier_destination"];
             $temp["lien_destination"] = $rowM["lien_destination"];
             $temp["cible_destination"] = $rowM["cible_destination"];
             $temp["image_principale"] = $rowM["image_principale"];
         }
         if ($rowM["type"] == "file") {
             $temp["fichier"] = $rowM["fichier_media"];
             $temp["legende"] = $rowM["titre_media"];
             if ($temp["legende"] == "") {
                 $temp["legende"] = get_nom_fichier($rowM["fichier_media"]);
             }
         }
         if (strpos($rowM["type"], "video") === 0) {
             $temp["lien_video"] = $rowM["fichier_media"];
             $temp["type_video"] = $rowM["type"];
             $temp["legende"] = $rowM["titre_media"];
             $temp["image_principale"] = $rowM["image_principale"];
             $temp["thumb"] = $this->imageVideo($rowM["type"], $rowM["fichier_media"], $this->sizeThumbVideo);
             $temp["player"] = $this->embedVideo($rowM["type"], $rowM["fichier_media"]);
         }
         if ($rowM["type"] == "link") {
             $temp["lien"] = $rowM["lien_destination"];
             $temp["cible"] = $rowM["cible_destination"];
             $temp["legende"] = $rowM["titre_media"];
             if ($temp["legende"] == "") {
                 $temp["legende"] = get_nom_fichier($rowM["lien_destination"]);
             }
         }
         /*if($rowM["image_principale"]==1) {
               $allMedias[0]=$temp;
           } else {
               $allMedias[$x]=$temp;
               $x++;
           }*/
         $allMedias[$x] = $temp;
         $x++;
     }
     return $allMedias;
 }
コード例 #19
0
ファイル: class.mediaFile.php プロジェクト: wedesign-pf/Tit
 public function add($param = "")
 {
     global $myAdmin;
     global $formMaj;
     global $datas_lang;
     global $smarty;
     global $thisSite;
     parent::add();
     if ($this->insideForm == false) {
         $this->fileRequired = true;
         $this->legendeEnabled = true;
     }
     if ($this->insideForm == true) {
         $prefixe_field = $this->field . "__";
         $mySelect = new mySelect(__FILE__);
         $mySelect->tables = $thisSite->PREFIXE_TBL_GEN . "medias";
         $mySelect->fields = "*";
         $mySelect->orderby = "id DESC";
         // pour prendre le premier élément
         $mySelect->where = "field_media=:field_media AND id_parent=:id_parent";
         $mySelect->whereValue["field_media"] = array($this->field, PDO::PARAM_STR);
         //$formMaj->tables . "." .
         $id_parent = $formMaj->datasForm[$myAdmin->LANG_DATAS]["id"];
         if ($id_parent == "") {
             $id_parent = $formMaj->datasForm[""]["id"];
         }
         $mySelect->whereValue["id_parent"] = array($id_parent, PDO::PARAM_INT);
         $resultmySelect = $mySelect->query();
         foreach ($resultmySelect as $rowS) {
             $lg = $rowS["lg"];
             $value_fichier_media[$lg] = $rowS["fichier_media"];
             $value_titre_media[$lg] = $rowS["titre_media"];
             if ($lg == $myAdmin->LANG_DEF) {
                 // pour les données monolangue
                 $value_idMedia = $rowS["id"];
                 $value_fichier_media[""] = $rowS["fichier_media"];
                 $value_titre_media[""] = $rowS["titre_media"];
             }
         }
     } else {
         $prefixe_field = "";
     }
     $newfield = new file();
     $newfield->field = $prefixe_field . "fichier_media";
     $newfield->multiLang = $this->multiLangType;
     if ($this->insideForm == true) {
         $newfield->label = $this->label;
     } else {
         $newfield->label = $datas_lang["fichier_media"];
     }
     $newfield->value = $value_fichier_media;
     $newfield->startFolder = $this->startFolder;
     $newfield->tooltip = $this->tooltip;
     $newfield->addClass = $this->addClass;
     $newfield->extensionsAuthorized = "";
     if ($this->extensionsAuthorized != "") {
         $newfield->extensionsAuthorized = $this->extensionsAuthorized;
     }
     $newfield->multi = $this->multi;
     $newfield->upload = $this->upload;
     $newfield->uploadDirect = $this->uploadDirect;
     $newfield->widthLabel = 2;
     $newfield->widthField = 9;
     $newfield->placeholder = $this->placeholder;
     $result = $newfield->add();
     $field_fichier_media = $result;
     if ($this->fileRequired == true) {
         $newfield->rule("required", true);
     }
     // champ Titre: légende de l'image, du fichier ou du lien
     if ($this->legendeEnabled == true) {
         $newfield = new input();
         $newfield->field = $prefixe_field . "titre_media";
         $newfield->multiLang = true;
         $newfield->value = $value_titre_media;
         $newfield->label = $datas_lang["legende"];
         $newfield->tooltip = $datas_lang["tooltipsLegende"];
         $newfield->widthLabel = 2;
         $newfield->widthField = 9;
         $result = $newfield->add();
         $field_titre_media = $result;
     }
     $smarty->assign('field_fichier_media', $field_fichier_media);
     $smarty->assign('field_titre_media', $field_titre_media);
     if ($this->insideForm == true) {
         $newfield = new hidden();
         $newfield->field = "fieldMedia__" . $this->field;
         $newfield->multiLang = false;
         $newfield->value = serialize(array("type" => $this->type, "field_media" => $this->field, "idMedia" => $value_idMedia));
         $result = $newfield->add();
         $smarty->assign('fieldMediaField', $result);
     }
     $smarty->assign('this', $this);
     $data = $smarty->fetch($this->pathTemplate . 'inc/fields/class.mediaFile.tpl');
     if ($this->insideForm == true) {
         $this->smartAssign($this->field, $data);
     } else {
         $this->smartAssign("media", $data);
     }
     return $data;
 }
コード例 #20
0
ファイル: header.php プロジェクト: wedesign-pf/code-g
<?php

session_start();
accessAuth();
$obj_article = new article("projet");
// Récupérer le nom de l'utilisateur connecté
$userTitre = $_SESSION['auth']['titre'];
// Récupérer la liste des projets
$obj_article = new article("projet");
$obj_article->fields = "id,titre";
$obj_article->orderby = "titre ASC";
$list_projet = $obj_article->query();
// récupérer la liste des catégories
$mySelect = new mySelect(__FILE__);
$mySelect->tables = $thisSite->PREFIXE_TBL_CLI . "categories";
$mySelect->fields = "id,titre";
$mySelect->where = "actif=:actif";
$mySelect->whereValue["actif"] = "1";
$mySelect->orderby = "titre ASC";
$list_categorie = $mySelect->query();
$smarty->assign('user_titre', $userTitre);
$smarty->assign('list_projet', $list_projet);
$smarty->assign('list_categorie', $list_categorie);
コード例 #21
0
ファイル: statistiques.php プロジェクト: wedesign-pf/code-g
    $listCampagnes[$row["id"]] = $row["titre"];
}
$datas_page["listCampagnes"] = $listCampagnes;
$newfield = new select();
$newfield->field = "F__id_campagne";
$newfield->label = $datas_lang["pubCampagne"];
$newfield->widthField = 3;
$newfield->items = $listCampagnes;
$newfield->allItems = true;
$newfield->value = ${$newfield->field};
$newfield->add();
$mySelect = new mySelect(__FILE__);
$mySelect->tables = $myTableEmplacements;
$mySelect->fields = "id,titre";
$mySelect->orderby = "titre ASC";
$result = $mySelect->query();
$listEmplacements = array();
foreach ($result as $row) {
    $listEmplacements[$row["id"]] = $row["titre"];
}
$datas_page["listEmplacements"] = $listEmplacements;
$newfield = new select();
$newfield->field = "F__id_emplacement";
$newfield->label = $datas_lang["pubEmplacement"];
$newfield->widthField = 3;
$newfield->items = $listEmplacements;
$newfield->allItems = true;
$newfield->value = ${$newfield->field};
$newfield->add();
$newfield = new select();
$newfield->field = "F__lg";
コード例 #22
0
ファイル: init_article.php プロジェクト: wedesign-pf/Tit
if (is_array($datasArticle["filtre"])) {
    foreach ($datasArticle["filtre"] as $f => $filtre) {
        if ($datasArticle["filtre"][$f]["field"] == "") {
            $datasArticle["filtre"][$f]["field"] = "filtre" . $f;
        }
    }
}
// si période demandée pour l'article, on ajoute un filtre automatiquement
if (array_key_exists("periode", $datasArticle["fields_show"])) {
    $datasArticle["filtre"][0]["field"] = "date";
    $datasArticle["filtre"][0]["type"] = "date";
    $datasArticle["filtre"][0]["label"] = "Date";
}
if (is_array($datasArticle["filtre"])) {
    ksort($datasArticle["filtre"]);
}
if ($datasArticle["maxElements"] == 1) {
    $mySelect = new mySelect(__FILE__);
    $mySelect->tables = $thisSite->PREFIXE_TBL_GEN . "articles";
    $mySelect->fields = "id";
    $mySelect->where = "art='" . $datasArticle["name"] . "'";
    $res = $mySelect->query();
    $rowx = current($res);
    $idCurrent = $rowx["id"];
    //
    $extensionPageCurrent = "-maj";
}
$maxElements = $datasArticle["maxElements"];
$forceTemplate = DOS_PAGES_ADMIN . "modeles/article" . $extensionPageCurrent;
include $forceTemplate . ".php";
$smarty->assign("datasArticle", $datasArticle);