public function Charger($colNom = NULL, $colCommentaire = NULL, $colDateCreation = NULL, $colDateDernierMess = NULL, $colNbVues = NULL, $colVersion = NULL, $colModeWiki = NULL, $colForumId = NULL, $colCreateurId = NULL, $colDernierPosteurId = NULL, $colTypeSujetId = NULL) { $id = $this->Id(); if ($id != NULL) { $bSujet = new BSujet(); $listeSujets = $bSujet->Charger($id, $colNom, $colCommentaire, $colDateCreation, $colDateDernierMess, $colNbVues, $colVersion, $colModeWiki, $colForumId, $colCreateurId, $colDernierPosteurId, $colTypeSujetId); $sujet = $this->UniqueResultatVerifie($listeSujets, WAM_0040, 'MSujet::Charger, aucun résultat pour l\'id [' . $id . '].'); if ($sujet != NULL) { $bSujet->GetNomsColonnes($colId, $colNom, $colCommentaire, $colDateCreation, $colDateDernierMess, $colNbVues, $colVersion, $colModeWiki, $colForumId, $colCreateurId, $colDernierPosteurId, $colTypeSujetId); $this->SetObjetFromSQL($sujet, false, $colNom, $colCommentaire, $colDateCreation, $colDateDernierMess, $colNbVues, $colVersion, $colModeWiki, $colForumId, $colCreateurId, $colDernierPosteurId, $colTypeSujetId); } } else { GLog::LeverException(EXM_0045, 'MSujet::Charger, pas d\'id.'); } }
<?php require_once 'cst.php'; require_once PATH_CLASSES . 'bSujet.php'; $sujet = GSession::LireVariableContexte('ModifSujet', 'SUJET'); $bSujet = new BSujet(); $groupe = $bSujet->RecupererGroupeSujet($sujet); if (GSession::HasDroit(FONC_MODIFIER_SUJET, $groupe)) { $titre = GSession::LireVariableContexte('Titre', 'SUJET'); $description = GSession::LireVariableContexte('Description', 'SUJET'); if ($titre != NULL && $titre != '' && $description != NULL && intval($sujet) != 0) { $bSujet->ModifierSujet($titre, $description, intval($sujet)); } }
<?php require_once 'cst.php'; require_once PATH_CLASSES . 'bMessage.php'; require_once PATH_CLASSES . 'bSujet.php'; require_once INC_GSESSION; $sujet = GSession::LireVariableContexte('CreatSujet', 'MESSAGE'); $bSujet = new BSujet(); $groupe = $bSujet->RecupererGroupeSujet($sujet); if (GSession::HasDroit(FONC_CREER_MESSAGE, $groupe)) { $bMessage = new BMessage(); $texte = GSession::LireVariableContexte('Texte', 'MESSAGE'); $joueur = GSession::LireSession('idJoueurConnecte'); if ($texte != NULL && $texte != '' && $sujet != NULL && intval($sujet) != 0) { $bMessage->AjouterMessage($texte, intval($sujet), $joueur); } }
<?php require_once 'cst.php'; require_once PATH_CLASSES . 'bSujet.php'; $sujet = GSession::LireVariableContexte('SupprSujet', 'SUJET'); $bSujet = new BSujet(); $groupe = $bSujet->RecupererGroupeSujet($sujet); if (GSession::HasDroit(FONC_SUPPRIMER_SUJET, $groupe)) { if (intval($sujet) > 0) { $bSujet->SupprimerSujet(intval($sujet)); } }
<?php require_once 'cst.php'; require_once PATH_CLASSES . 'bCategorie.php'; require_once PATH_CLASSES . 'bSujet.php'; require_once PATH_CLASSES . 'bMessage.php'; require_once INC_GSESSION; $categorie = GSession::LireVariableContexte('CreatCategorie', 'SUJET'); $bCategorie = new BCategorie(); $groupe = $bCategorie->RecupererGroupeCategorie($categorie); if (GSession::HasDroit(FONC_CREER_SUJET, $groupe)) { $bSujet = new BSujet(); $titre = GSession::LireVariableContexte('Titre', 'SUJET'); $description = GSession::LireVariableContexte('Description', 'SUJET'); $texte = GSession::LireVariableContexte('Texte', 'SUJET'); $joueur = GSession::LireSession('idJoueurConnecte'); if ($titre != NULL && $titre != '' && $texte != NULL && $texte != '' && $description != NULL && $categorie != NULL && intval($categorie) != 0) { $sujet = $bSujet->AjouterSujet($titre, $description, intval($categorie), $joueur); if ($sujet != NULL) { $bMessage = new BMessage(); $bMessage->AjouterMessage($texte, intval($sujet), $joueur); } } }
<?php require_once 'cst.php'; require_once INC_SLISTESUJETS; require_once INC_GSESSION; require_once PATH_CLASSES . 'bSujet.php'; require_once PATH_CLASSES . 'bConstantes.php'; $groupe = GSession::LireSession('idGroupe'); $cat = GSession::LireVariableContexte('Categorie', 'SUJET'); $bSujet = new BSujet(); $sujets = $bSujet->ChargerListeSujetsFromCategorie($cat); $liste = new SListeSujets('Liste des sujets', $cat, 'sujet', 'CreerSujet', 'ModifierSujet', 'SupprimerSujet', 'ChargerMessages'); while (list($i, $sujet) = each($sujets)) { if ($sujet[COL_CATEGORIE] == $cat) { $liste->AjouterElement($sujet[COL_ID], $sujet[COL_NOM], $sujet[COL_COMMENTAIRE], $sujet[COL_LOGIN], $sujet[COL_DATECREATION], $sujet[COL_DERNIERMESSAUTEUR], $sujet[COL_DERNIERMESSDATE], $sujet[COL_VUES], $sujet[COL_NBREPONSES], $sujet[COL_VERSION]); } }