1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
require_once($_SERVER["DOCUMENT_ROOT"]."/monsite/administrateur/php_tools/connect.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/monsite/administrateur/php_class/Bd.Class.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/monsite/administrateur/php_tools/ApiHtml.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/monsite/administrateur/php_tools/outils_php.php");
class Agenda
{
// ************************************************************************************
// Partie Privée : Variables
// ************************************************************************************
var $id_agenda, $id_organisateur, $type_agenda, $theme_agenda, $lieu_agenda, $date_agenda, $nom_agenda;
var $resultat, $mode;
var $nbreResultats, $filtre;
// ************************************************************************************
// Constructeur
// ************************************************************************************
function Agenda($pScript,$pMode="agendaNew",$pPOST=array(),$pFILES=array())
{// Un parametre obligatoires
// On commence par initialiser les variables
$this->script=$pScript;
$this->mode=$pMode;
$this->resultat="";
$mypath_include=$_SERVER['DOCUMENT_ROOT']."/bretagne-energie-refont/";
$mypath="http://192.168.1.210/bretagne-energie-refont/";
if (isset($pPOST["Etat"]))
{
if (isset($pPOST["id_agenda"])) $this->id_agenda=$pPOST['id_agenda'];
if (isset($pPOST["id_organisateur"])) $this->id_organisateur=$pPOST['id_organisateur'];
if (isset($pPOST["type_agenda"])) $this->type_agenda=$pPOST['type_agenda'];
if (isset($pPOST["theme_agenda"])) $this->theme_agenda=$pPOST['theme_agenda'];
if (isset($pPOST["lieu_agenda"])) $this->lieu_agenda=$pPOST['lieu_agenda'];
if (isset($pPOST["date_agenda"])) $this->date_agenda=$pPOST['date_agenda'];
if (isset($pPOST["nom_agenda"])) $this->nom_agenda=$pPOST['nom_agenda'];
if (isset($_GET["option"])) $this->option=$_GET['option'];
}
switch($this->mode)
{
case "agendaNew" :
if (!isSet($pPOST["Etat"]))
{
break;
} // Soit il n'y a pas de saisie passées
else // soit on doit essayer d'enregistrer si certaines conditions sont respectées...
{
if (!$this->Enregistrer())
{ /*echo("Existe deja");*/
$this->script = $_SERVER["PHP_SELF"] . "?choix==agendaNew&message=Désolé, l'utilisateur existe déjà...";
break;
}
else
{
$this->script = $_SERVER["PHP_SELF"];
break;
}
}//end else
case "agendaModif" :
if(isset($_GET["id_agenda"])) { $this->resultat = $this->Charger($_GET["id_agenda"],$this->script); }
if(isset($pPOST["Etat"])) { $this->Update(); }
break;
case "updateOrganisateur" :
$this->UpdateOrganisateur();
break;
case "AfficheCaseCoche" : $this->resultat=$this->AfficheCaseCoche(); break;
case "agendaDel" : $this->Supprimer(); break;
case "agendaListe" : $this->resultat=$this->ChargerListe("DESC"); break;
case "prochainsAgenda" : $this->resultat=$this->ProchainsAgenda(); break;
case "listeDesAgendas" : $this->resultat=$this->listeDesAgendas(); break;
}// end switch
}// end constructeur |
Partager