Example #1
0
 public function get_champs()
 {
     $obj_article = new article("champ");
     $obj_article->fields = "id,titre,filtre1";
     $result = $obj_article->query();
     foreach ($result as $row) {
         $this->list_champs[$row["id"]] = $row["titre"];
         if ($row["filtre1"] == "1") {
             $this->list_champ_crypte[] = $row["id"];
         }
     }
 }
Example #2
0
 public function req_article($name)
 {
     $obj_article = new article($name);
     $obj_article->fields = "id,titre";
     $obj_article->orderby = "titre ASC";
     if (isset($this->id)) {
         $obj_article->where = "id=" . $this->id;
     } else {
         $obj_article->limit = "1";
     }
     $this->result = $obj_article->query();
 }
Example #3
0
function getTexte($id)
{
    global $thisSite;
    //  $mySelect = new mySelect(__FILE__);
    //	$mySelect->tables=$thisSite->PREFIXE_TBL_GEN . "textes";
    //	$mySelect->fields="texte";
    //	$mySelect->where="id=:id AND lg=:lg";
    //	$mySelect->whereValue["id"]=array($id,PDO::PARAM_STR);
    //	$mySelect->whereValue["lg"]=array($thisSite->current_lang,PDO::PARAM_STR);
    //	$result=$mySelect->query();
    //	$row = current($result);
    //	return stripslashes($row["texte"]);
    $obj_article = new article("textes");
    $obj_article->where = "id=" . $id . "  AND lg='" . $thisSite->current_lang . "'";
    $result = $obj_article->query();
    $row = current($result);
    return $row;
}
Example #4
0
    $formMaj->set_datas();
}
$newfield = new hidden();
$newfield->field = "id_parent";
$newfield->multiLang = false;
$newfield->defaultValue = $idParent;
$newfield->add();
$newfield = new input();
$newfield->field = "titre";
$newfield->multiLang = true;
$newfield->label = "Titre (si différent du type)";
$newfield->add();
// on charge tout les types de texte
$obj_article = new article("type_texte_itineraire");
$obj_article->fields = "id,titre";
$result = $obj_article->query();
$tab_type_texte_itineraire = array();
foreach ($result as $row) {
    $tab_type_texte_itineraire[$row["id"]] = $row["titre"];
}
// on charge les types de texte utilisés
$mySelect = new mySelect(__FILE__);
$mySelect->tables = $myTable;
$mySelect->fields = "type_texte";
$mySelect->where = "actif=1 AND lg='fr' and id_parent=" . $idParent;
$result = $mySelect->query();
$tab_type_texte = array();
foreach ($result as $row) {
    $tab_type_texte[] = $row["type_texte"];
}
$newfield = new select();
Example #5
0
$userTitre = $_SESSION['auth']['titre'];
$SessionIdType = $_SESSION['auth']['id_type'];
if (isset($__GET['id'])) {
    // Traitement du paramètre passer en GET
    // Doit etre uniquement un entier
    $id = intval($__GET['id']);
    $var_field_id = "id_categorie";
    // Récupérer les éléments par rapport à l'id catégorie passé en GET
    include "../element/elements.php";
    // Récupérer une valeur du projet par rapport à son titre dans l'ordre croissant
    $listprojets = array();
    foreach ($tabElement as $Kelem => $Velem) {
        $obj_article = new article("projet");
        $obj_article->fields = "id,titre";
        $obj_article->where = "actif=1 AND id=" . $Velem['id_projet'];
        $listprojets[$Kelem] = $obj_article->query();
    }
    //echoa($listprojets);
    $projets = array();
    foreach ($listprojets as $kListProjet => $vListProjet) {
        foreach ($listprojets[$kListProjet] as $Kprojet => $Vprojet) {
            $projets[] = array('titre' => $Vprojet['titre']);
        }
    }
    // Récupérer les catégories par rapport aux éléments donnée par la requête $tabElement
    include "../element/categories.php";
    if (!empty($list_element)) {
        // Récupérer les champs
        include "../element/champs.php";
        // Inclure le fichier des portions de codes suivants
        include "../element/partials.php";
Example #6
0
<?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);
Example #7
0
 $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;
     // Si la case se souvenir de moi est cochée alors
     // Enregistrer les valeurs dans le cookie
     if ($_POST['remember']) {
         setcookie("UserCookie", $user['email'], time() + 60 * 60 * 24 * 14);
     }
     // Redirection page accueil (fichier:_pages/element.php, _pages/element.tpl)
     header('Location: ./element');
 } else {