diff --git a/seed/galette/dictionaries/40_galette.xml b/seed/galette/dictionaries/40_galette.xml
new file mode 100644
index 0000000..55e7a87
--- /dev/null
+++ b/seed/galette/dictionaries/40_galette.xml
@@ -0,0 +1,9 @@
+
+
+
+
+ /etc/galette/config.inc.php
+ /etc/nginx/default.d/galette.conf
+
+
+
diff --git a/seed/galette/extras/machine/20_sensmotdire.xml b/seed/galette/extras/machine/20_sensmotdire.xml
new file mode 100644
index 0000000..ac4f5b3
--- /dev/null
+++ b/seed/galette/extras/machine/20_sensmotdire.xml
@@ -0,0 +1,20 @@
+
+
+
+
+ 256
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ 512
+
+
+
diff --git a/seed/galette/manual/image/postinstall/galette.sh b/seed/galette/manual/image/postinstall/galette.sh
new file mode 100644
index 0000000..8dc7e16
--- /dev/null
+++ b/seed/galette/manual/image/postinstall/galette.sh
@@ -0,0 +1,8 @@
+set -e
+
+mkdir -p "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/local/share"
+cp -a $IMAGE_DIR_RECIPIENT_IMAGE/postinstall/galette "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/local/share"
+chown -R root: "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/local/share/galette"
+ln -s /etc/galette/config.inc.php "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/local/share/galette/includes/config.inc.php"
+
+cd $ORIPWD
diff --git a/seed/galette/manual/image/postinstall/galette/ajouter_adherent.php b/seed/galette/manual/image/postinstall/galette/ajouter_adherent.php
new file mode 100644
index 0000000..9628b29
--- /dev/null
+++ b/seed/galette/manual/image/postinstall/galette/ajouter_adherent.php
@@ -0,0 +1,810 @@
+ modif ou création
+ $values = Array();
+ $id_adh = "";
+ $values['date_crea_adh'] = "";
+ if (isset($_GET["id_adh"]))
+ if (is_numeric($_GET["id_adh"]))
+ $id_adh = $_GET["id_adh"];
+ if (isset($_POST["id_adh"]))
+ if (is_numeric($_POST["id_adh"]))
+ $id_adh = $_POST["id_adh"];
+
+ // Si c'est un user qui est loggé, on va à sa fiche
+ if ($_SESSION["admin_status"]!=1)
+ $id_adh = $_SESSION["logged_id_adh"];
+ $values['id_adh'] = $id_adh;
+ // variables d'erreur (pour affichage)
+ $error_detected = "";
+ $warning_detected = "";
+ $confirm_detected = "";
+
+ //
+ // DEBUT parametrage des champs
+ // On recupere de la base la longueur et les flags des champs
+ // et on initialise des valeurs par defaut
+
+ // recuperation de la liste de champs de la table
+ $fields = $DB->MetaColumns(PREFIX_DB."adherents");
+ foreach ($fields as $champ => $proprietes)
+ {
+ $proprietes_arr = get_object_vars($proprietes);
+ // on obtient name, max_length, type, not_null, has_default, primary_key,
+ // auto_increment et binary
+
+ $fieldname = $proprietes_arr["name"];
+
+ // on ne met jamais a jour id_adh
+ if ($fieldname!="id_adh" && $fieldname!="date_echeance")
+ $$fieldname= "";
+
+ $fieldlen = $fieldname."_len";
+ $fieldreq = $fieldname."_req";
+
+ // definissons aussi la longueur des input text
+ $max_tmp = $proprietes_arr["max_length"];
+ if ($max_tmp == "-1")
+ $max_tmp = 10;
+ $fieldlen = $fieldname."_len";
+ $$fieldlen=$max_tmp;
+
+ // et s'ils sont obligatoires (Ã partir de la base)
+ if ($proprietes_arr["not_null"]==1)
+ $$fieldreq = "style=\"color: #FF0000;\"";
+ else
+ $$fieldreq = "";
+ }
+ reset($fields);
+
+ // et les valeurs par defaut
+ $id_statut = "4";
+ $values['titre_adh'] = "1";
+
+ //
+ // FIN parametrage des champs
+ //
+
+ //
+ // Validation du formulaire
+ //
+
+ if (isset($_POST["valid"]))
+ {
+ // verification de champs
+ $update_string = "";
+ $insert_string_fields = "";
+ $insert_string_values = "";
+
+ // recuperation de la liste de champs de la table
+ foreach ($fields as $champ => $proprietes)
+ {
+ $proprietes_arr = get_object_vars($proprietes);
+ // on obtient name, max_length, type, not_null, has_default, primary_key,
+ // auto_increment et binary
+
+ $fieldname = $proprietes_arr["name"];
+
+ // on précise les champs non modifiables
+ if (
+ ($_SESSION["admin_status"]==1 && $fieldname!="id_adh"
+ && $fieldname!="date_echeance") ||
+ ($_SESSION["admin_status"]==0 && $fieldname!="date_crea_adh"
+ && $fieldname!="panier_adh"
+ && $fieldname!="pain_adh"
+ && $fieldname!="volaille_adh"
+ && $fieldname!="chevre_adh"
+ && $fieldname!="boeuf_adh"
+ && $fieldname!="veau_adh"
+ && $fieldname!="cochon_adh"
+ && $fieldname!="farine_adh"
+ && $fieldname!="id_adh"
+ && $fieldname!="titre_adh"
+ && $fieldname!="id_statut"
+ && $fieldname!="nom_adh"
+ && $fieldname!="prenom_adh"
+ && $fieldname!="activite_adh"
+ && $fieldname!="bool_exempt_adh"
+ && $fieldname!="bool_admin_adh"
+ && $fieldname!="date_echeance"
+ && $fieldname!="info_adh")
+ )
+ {
+ if (isset($_POST[$fieldname]))
+ $post_value=trim($_POST[$fieldname]);
+ else
+ $post_value="";
+ // on declare les variables pour la présaisie en cas d'erreur
+ $values[$fieldname] = htmlentities(stripslashes($post_value),ENT_QUOTES);
+ $fieldreq = $fieldname."_req";
+
+ // vérification de la présence des champs obligatoires
+ if ($$fieldreq!="" && $post_value=="")
+ $error_detected .= "
"._T("- Champ obligatoire non renseigné.")."";
+ else
+ {
+ // validation des dates
+ if($proprietes_arr["type"]=="date" && $post_value!="")
+ {
+ if (preg_match("/^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/", $post_value, $array_jours) || $post_value=="")
+ {
+ if (checkdate($array_jours[2],$array_jours[1],$array_jours[3]) || $post_value=="")
+// $value=$DB->DBDate(mktime(0,0,0,$array_jours[2],$array_jours[1],$array_jours[3]));
+ $value = $DB->DBDate($array_jours[3].'/'.$array_jours[2].'/'.$array_jours[1]);
+ else
+ $error_detected .= ""._T("- Date non valide !")."";
+ }
+ else
+ $error_detected .= ""._T("- Mauvais format de date (jj/mm/aaaa) !")."";
+ }
+ elseif ($fieldname=="email_adh")
+ {
+ $post_value=strtolower($post_value);
+ if (!is_valid_email($post_value) && $post_value!="")
+ $error_detected .= ""._T("- Adresse E-mail non valide !")."";
+ else
+ $value = $DB->qstr($post_value, true);
+
+ if ($post_value=="" && isset($_POST["mail_confirm"]))
+ $error_detected .= ""._T("- Vous ne pouvez pas envoyer de confirmation par mail si l'adhérent n'a pas d'adresse !")."";
+ }
+ elseif ($fieldname=="url_adh")
+ {
+ if (!is_valid_web_url($post_value) && $post_value!="" && $post_value!="http://")
+ $error_detected .= ""._T("- Adresse web non valide ! Oubli du http:// ?")."";
+ else
+ {
+ if ($post_value=="http://")
+ $post_value="";
+ $value = $DB->qstr($post_value, true);
+ }
+ }
+ elseif ($fieldname=="login_adh")
+ {
+ if (strlen($post_value)<4)
+ $error_detected .= ""._T("- L'identifiant doit être composé d'au moins 4 caractères !")."";
+ else
+ {
+ // on vérifie que le login n'est pas déjà utilisé
+ $requete = "SELECT id_adh
+ FROM ".PREFIX_DB."adherents
+ WHERE login_adh=". $DB->qstr($post_value, true);
+ if ($id_adh!="")
+ $requete .= " AND id_adh!=" . $DB->qstr($id_adh, true);
+echo $requete;
+ $result = $DB->Execute($requete);
+ if (!$result->EOF || $post_value==PREF_ADMIN_LOGIN)
+ $error_detected .= ""._T("- Cet identifiant est déjà utilisé par un autre adhérent !")."";
+ else
+ $value = $DB->qstr($post_value, true);
+ }
+ }
+ elseif ($fieldname=="mdp_adh")
+ {
+ if (strlen($post_value)<4)
+ $error_detected .= ""._T("- Le mot de passe doit être composé d'au moins 4 caractères !")."";
+ else
+ $value = $DB->qstr($post_value, true);
+ }
+ else
+ {
+ // on se contente d'escaper le html et les caracteres speciaux
+ $value = $DB->qstr($post_value, true);
+ }
+
+ // mise à jour des chaines d'insertion/update
+ if ($value=="''")
+ $value="NULL";
+ $update_string .= ",".$fieldname."=".$value;
+ $insert_string_fields .= ",".$fieldname;
+ $insert_string_values .= ",".$value;
+ }
+ }
+ }
+ reset($fields);
+
+ // modif ou ajout
+ if ($error_detected=="")
+ {
+ if ($id_adh!="")
+ {
+ // modif
+
+ $requete = "UPDATE ".PREFIX_DB."adherents
+ SET " . substr($update_string,1) . "
+ WHERE id_adh=" . $id_adh;
+ $DB->Execute("SET NAMES utf8");
+ $DB->Execute($requete);
+ $DB->Execute("SET NAMES latin1");
+ $result = $DB->Execute("SET NAMES latin1");
+ dblog(_T("Mise à jour de la fiche adhérent :")." ".strtoupper($_POST["nom_adh"])." ".$_POST["prenom_adh"], $requete);
+
+ $date_fin = get_echeance($DB, $id_adh);
+ if ($date_fin!="")
+// $date_fin_update = $DB->DBDate(mktime(0,0,0,$date_fin[1],$date_fin[0],$date_fin[2]));
+ $date_fin_update = $DB->DBDate($date_fin[2].'/'.$date_fin[1].'/'.$date_fin[0]);
+ else
+ $date_fin_update = "NULL";
+ $requete = "UPDATE ".PREFIX_DB."adherents
+ SET date_echeance=".$date_fin_update."
+ WHERE id_adh=" . $id_adh;
+ }
+ else
+ {
+ // ajout
+ $insert_string_fields = substr($insert_string_fields,1);
+ $insert_string_values = substr($insert_string_values,1);
+ $requete = "INSERT INTO ".PREFIX_DB."adherents
+ (" . $insert_string_fields . ")
+ VALUES (" . $insert_string_values . ")";
+ dblog(_T("Ajout de la fiche adhérent :")." ".strtoupper($_POST["nom_adh"])." ".$_POST["prenom_adh"], $requete);
+
+ }
+ if ($DB->Execute($requete) === false) {
+ print 'error inserting: '. $DB->ErrorMsg().'
';
+ return;
+ };
+ // il est temps d'envoyer un mail
+ if (isset($_POST["mail_confirm"]))
+ if ($_POST["mail_confirm"]=="1")
+ if ($email_adh!="")
+ {
+ $mail_subject = _T("Vos identifiants Galette");
+ $mail_text = _T("Bonjour,")."\n";
+ $mail_text .= "\n";
+ $mail_text .= _T("Vous venez d'être inscrit sur le système de gestion d'adhérents de l'association.")."\n";
+ $mail_text .= _T("Il vous est désormais possible de suivre en temps réel l'état de votre adhésion")."\n";
+ $mail_text .= _T("et de mettre à jour vos coordonnées par l'interface web prévue à cet effet.")."\n";
+ $mail_text .= "\n";
+ $mail_text .= _T("Veuillez vous identifier à cette adresse :")."\n";
+ $mail_text .= "http://".$_SERVER["SERVER_NAME"].dirname($_SERVER["REQUEST_URI"])."\n";
+ $mail_text .= "\n";
+ $mail_text .= _T("Identifiant :")." ".custom_html_entity_decode($values['login_adh'])."\n";
+ $mail_text .= _T("Mot de passe :")." ".custom_html_entity_decode($values['mdp_adh'])."\n";
+ $mail_text .= "\n";
+ $mail_text .= _T("A très bientôt !")."\n";
+ $mail_text .= "\n";
+ $mail_text .= _T("(ce mail est un envoi automatique)")."\n";
+ $mail_headers = "From: ".PREF_EMAIL_NOM." <".PREF_EMAIL.">\n";
+ mail ($email_adh,$mail_subject,$mail_text, $mail_headers);
+ }
+
+ // récupération du max pour insertion photo
+ // ou passage en mode modif apres insertion
+ if ($id_adh=="")
+ {
+ $requete = "SELECT max(id_adh)
+ AS max
+ FROM ".PREFIX_DB."adherents";
+ $max = $DB->Execute($requete);
+ $id_adh_new = $max->fields["max"];
+ }
+ else
+ $id_adh_new = $id_adh;
+
+ if (isset($_FILES["photo"]["tmp_name"]))
+ if ($_FILES["photo"]["tmp_name"]!="none" &&
+ $_FILES["photo"]["tmp_name"]!="")
+ {
+
+ if ($_FILES['photo']['type']=="image/jpeg" ||
+ (function_exists("ImageCreateFromGif") && $_FILES['photo']['type']=="image/gif") ||
+ $_FILES['photo']['type']=="image/png" ||
+ $_FILES['photo']['type']=="image/x-png")
+ {
+ $tmp_name = $HTTP_POST_FILES["photo"]["tmp_name"];
+
+ // extension du fichier (en fonction du type mime)
+ if ($_FILES['photo']['type']=="image/jpeg")
+ $ext_image = ".jpg";
+ if ($_FILES['photo']['type']=="image/png" || $_FILES['photo']['type']=="image/x-png")
+ $ext_image = ".png";
+ if ($_FILES['photo']['type']=="image/gif")
+ $ext_image = ".gif";
+
+ // suppression ancienne photo
+ // NB : une verification sur le type de $id_adh permet d'eviter une faille
+ // du style $id_adh = "../../../image"
+ @unlink(WEB_ROOT . "photos/".$id_adh_new.".jpg");
+ @unlink(WEB_ROOT . "photos/".$id_adh_new.".gif");
+ @unlink(WEB_ROOT . "photos/".$id_adh_new.".jpg");
+ @unlink(WEB_ROOT . "photos/tn_".$id_adh_new.".jpg");
+ @unlink(WEB_ROOT . "photos/tn_".$id_adh_new.".gif");
+ @unlink(WEB_ROOT . "photos/tn_".$id_adh_new.".jpg");
+
+ // copie fichier temporaire
+ if (!@move_uploaded_file($tmp_name,WEB_ROOT . "photos/".$id_adh_new.$ext_image))
+ $warning_detected .= ""._T("- La photo semble ne pas avoir été transmise correstement. L'enregistrement a cependant été effectué.")."";
+ else
+ resizeimage(WEB_ROOT . "photos/".$id_adh_new.$ext_image,WEB_ROOT . "photos/tn_".$id_adh_new.$ext_image,130,130);
+ }
+ else
+ {
+ if (function_exists("imagegif"))
+ $warning_detected .= ""._T("- Le fichier transmis n'est pas une image valide (GIF, PNG ou JPEG). L'enregistrement a cependant été effectué.")."";
+ else
+ $warning_detected .= ""._T("- Le fichier transmis n'est pas une image valide (PNG ou JPEG). L'enregistrement a cependant été effectué.")."";
+ }
+ }
+
+ // retour à la liste ou passage à la contribution
+ if ($warning_detected=="" && $id_adh=="")
+ {
+ header("location: ajouter_contribution.php?id_adh=".$id_adh_new);
+ die();
+ }
+ elseif ($warning_detected=="" && !isset($_FILES["photo"]))
+ {
+ header("location: gestion_adherents.php");
+ die();
+ }
+ elseif ($warning_detected=="" && ($_FILES["photo"]["tmp_name"]=="none" || $_FILES["photo"]["tmp_name"]==""))
+ {
+ header("location: gestion_adherents.php");
+ die();
+ }
+ $id_adh=$id_adh_new;
+ }
+ }
+
+ // suppression photo
+ if (isset($_POST["del_photo"]))
+ {
+ @unlink(WEB_ROOT . "photos/" . $id_adh . ".jpg");
+ @unlink(WEB_ROOT . "photos/" . $id_adh . ".png");
+ @unlink(WEB_ROOT . "photos/" . $id_adh . ".gif");
+ @unlink(WEB_ROOT . "photos/tn_" . $id_adh . ".jpg");
+ @unlink(WEB_ROOT . "photos/tn_" . $id_adh . ".png");
+ @unlink(WEB_ROOT . "photos/tn_" . $id_adh . ".gif");
+ }
+
+ //
+ // Pré-remplissage des champs
+ // avec des valeurs issues de la base
+ // -> donc uniquement si l'enregistrement existe et que le formulaire
+ // n'a pas déja été posté avec des erreurs (pour pouvoir corriger)
+
+ if (!isset($_POST["valid"]) || (isset($_POST["valid"]) && $error_detected==""))
+ if ($id_adh != "")
+
+
+ {
+ // recup des données
+ $requete = "SELECT *
+ FROM ".PREFIX_DB."adherents
+ WHERE id_adh=$id_adh";
+ $result = $DB->Execute($requete);
+ if ($result->EOF)
+ {
+ header("location: index.php");
+ die();
+ }
+
+
+
+ // recuperation de la liste de champs de la table
+ //$fields = &$DB->MetaColumns(PREFIX_DB."cotisations");
+ foreach ($fields as $champ => $proprietes)
+ {
+ //echo $proprietes_arr["name"]." -- (".$result->fields[$proprietes_arr["name"]].")
";
+
+
+ $val="";
+ $proprietes_arr = get_object_vars($proprietes);
+ // on obtient name, max_length, type, not_null, has_default, primary_key,
+ // auto_increment et binary
+
+ // déclaration des variables correspondant aux champs
+ // et reformatage des dates.
+
+ // on doit faire cette verif pour une enventuelle valeur "NULL"
+ // non renvoyée -> ex: pas de societe membre
+ // sinon on obtient un warning
+ if (isset($result->fields[$proprietes_arr["name"]]))
+ $val = $result->fields[$proprietes_arr["name"]];
+
+ if($proprietes_arr["type"]=="date" && $val!="")
+ {
+ list($a,$m,$j)=explode("-",$val);
+ $val="$j/$m/$a";
+ }
+ $values[$proprietes_arr["name"]]=htmlentities(stripslashes(addslashes($val)), ENT_QUOTES);
+ }
+ reset($fields);
+ }
+ else
+ {
+ // initialisation des champs
+
+ }
+
+ // la date de creation de fiche, ici vide si nouvelle fiche
+ if ($values['date_crea_adh']=="")
+ $values['date_crea_adh'] = date("d/m/Y");
+ if ($url_adh=="")
+ $url_adh = "http://";
+ if ($mdp_adh=="")
+ $mdp_adh = makeRandomPassword();
+
+ // variable pour la desactivation de champs
+ if ($_SESSION["admin_status"]==0)
+ $disabled_field = "disabled";
+ else
+ $disabled_field = "";
+
+
+ include("header.php");
+
+?>
+
+ ()
+
+
diff --git a/seed/galette/manual/image/postinstall/galette/ajouter_contribution.php b/seed/galette/manual/image/postinstall/galette/ajouter_contribution.php
new file mode 100644
index 0000000..73d413b
--- /dev/null
+++ b/seed/galette/manual/image/postinstall/galette/ajouter_contribution.php
@@ -0,0 +1,392 @@
+ modif ou création
+ $id_cotis = "";
+ if (isset($_GET["id_cotis"]))
+ if (is_numeric($_GET["id_cotis"]))
+ $id_cotis = $_GET["id_cotis"];
+ if (isset($_POST["id_cotis"]))
+ if (is_numeric($_POST["id_cotis"]))
+ $id_cotis = $_POST["id_cotis"];
+
+ // variables d'erreur (pour affichage)
+ $error_detected = "";
+
+ //
+ // DEBUT parametrage des champs
+ // On recupere de la base la longueur et les flags des champs
+ // et on initialise des valeurs par defaut
+
+ // recuperation de la liste de champs de la table
+ $fields = $DB->MetaColumns(PREFIX_DB."cotisations");
+ foreach ($fields as $champ => $proprietes)
+ {
+ $proprietes_arr = get_object_vars($proprietes);
+ // on obtient name, max_length, type, not_null, has_default, primary_key,
+ // auto_increment et binary
+
+ $fieldname = $proprietes_arr["name"];
+ $fieldreq = $fieldname."_req";
+ $fieldlen = $fieldname."_len";
+
+ // on ne met jamais a jour id_cotis -> on le saute
+ if ($fieldname!="id_cotis")
+ $$fieldname = "";
+
+ // definissons aussi la longueur des input text
+ $max_tmp = $proprietes_arr["max_length"];
+ if ($max_tmp == "-1")
+ $max_tmp = 10;
+ $$fieldlen = $max_tmp;
+
+ // et s'ils sont obligatoires (Ã partir de la base)
+ if ($proprietes_arr["not_null"]==1)
+ $$fieldreq = " style=\"color: #FF0000;\"";
+ else
+ $$fieldreq = "";
+ }
+ reset($fields);
+
+ // et les valeurs par defaut
+ $id_type_cotis = "1";
+ $duree_mois_cotis = "12";
+
+ //
+ // FIN parametrage des champs
+ //
+
+ $values = Array();
+ $values['id_adh'] = "";
+ if (isset($_GET["id_adh"]))
+ $values['id_adh'] = $_GET["id_adh"];
+ elseif (isset($_POST["id_adh"]))
+ $values['id_adh'] = $_POST["id_adh"];
+ if ($values['id_adh']!="")
+ {
+ $requete = "SELECT nom_adh, prenom_adh FROM ".PREFIX_DB."adherents WHERE id_adh=".$DB->qstr($values['id_adh']);
+ $resultat = $DB->Execute($requete);
+ if (!$resultat->EOF)
+ {
+ $nom_adh = $resultat->fields[0];
+ $prenom_adh = $resultat->fields[1];
+ $resultat->Close();
+ }
+ }
+
+ //
+ // Validation du formulaire
+ //
+
+ if (isset($_POST["valid"]))
+ {
+ // verification de champs
+ $update_string = "";
+ $insert_string_fields = "";
+ $insert_string_values = "";
+
+ // recuperation de la liste de champs de la table
+ //$fields = &$DB->MetaColumns(PREFIX_DB."cotisations");
+ foreach ($fields as $champ => $proprietes)
+ {
+ $proprietes_arr = get_object_vars($proprietes);
+ // on obtient name, max_length, type, not_null, has_default, primary_key,
+ // auto_increment et binary
+
+ $fieldname = $proprietes_arr["name"];
+ $fieldreq = $fieldname."_req";
+
+ // on ne met jamais a jour id_cotis -> on le saute
+ if ($fieldname!="id_cotis")
+ {
+ if (isset($_POST[$fieldname]))
+ $post_value=trim($_POST[$fieldname]);
+ else
+ $post_value="";
+
+ // on declare les variables pour la présaisie en cas d'erreur
+ $$fieldname = htmlentities(stripslashes($post_value),ENT_QUOTES);
+
+ // vérification de la présence des champs obligatoires
+ if ($$fieldreq!="" && $post_value=="")
+ $error_detected = ""._T("- Vérifiez que tous les champs obligatoires sont renseignés.")."";
+ else
+ {
+ $value = "";
+ // validation des dates
+ if($proprietes_arr["type"]=="date")
+ {
+ if (preg_match("/^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/", $post_value, $array_jours))
+ {
+ if (checkdate($array_jours[2],$array_jours[1],$array_jours[3]))
+ $value=$DB->DBDate(mktime(0,0,0,$array_jours[2],$array_jours[1],$array_jours[3]));
+ else
+ $error_detected .= ""._T("- Date non valide !")."";
+ }
+ else
+ $error_detected .= ""._T("- Mauvais format de date (jj/mm/aaaa) !")."";
+ }
+ elseif(strstr($proprietes_arr["type"],"int"))
+ {
+ if (is_numeric($post_value) || $post_value=="")
+ $value=$DB->qstr($post_value,ENT_QUOTES);
+ else
+ $error_detected .= ""._T("- La durée doit être un entier !")."";
+ }
+ elseif(strstr($proprietes_arr["type"],"float"))
+ {
+ $us_value = strtr($post_value, ",", ".");
+ if (is_numeric($us_value) || $us_value=="")
+ $value=$DB->qstr($us_value,ENT_QUOTES);
+ else
+ $error_detected .= ""._T("- Le montant doit être un chiffre !")."";
+ }
+ else
+ {
+ // on se contente d'escaper le html et les caracteres speciaux
+ $value = $DB->qstr($post_value,ENT_QUOTES);
+ }
+
+ // mise à jour des chaines d'insertion/update
+ $update_string .= ",".$fieldname."=".$value;
+ $insert_string_fields .= ",".$fieldname;
+ $insert_string_values .= ",".$value;
+ }
+ }
+ }
+ reset($fields);
+
+ // modif ou ajout
+ if ($error_detected=="")
+ {
+ if ($id_cotis!="")
+ {
+ // modif
+
+ $requete = "UPDATE ".PREFIX_DB."cotisations
+ SET " . substr($update_string,1) . "
+ WHERE id_cotis=" . $DB->qstr($id_cotis);
+ dblog(_T("Mise à jour d'une contribution :")." ".strtoupper($nom_adh)." ".$prenom_adh, $requete);
+ }
+ else
+ {
+ // ajout
+
+ $requete = "INSERT INTO ".PREFIX_DB."cotisations
+ (" . substr($insert_string_fields,1) . ")
+ VALUES (" . substr($insert_string_values,1) . ")";
+
+ dblog(_T("Ajout d'une contribution :")." ".strtoupper($nom_adh)." ".$prenom_adh, $requete);
+ }
+ $DB->Execute("SET NAMES utf8");
+ $DB->Execute($requete);
+ $DB->Execute("SET NAMES latin1");
+
+ // mise a jour de l'échéance
+ $date_fin = get_echeance($DB, $values['id_adh']);
+ if ($date_fin!="")
+ $date_fin_update = $DB->DBDate(mktime(0,0,0,$date_fin[1],$date_fin[0],$date_fin[2]));
+ else
+ $date_fin_update = "'NULL'";
+
+ $requete = "UPDATE ".PREFIX_DB."adherents
+ SET date_echeance=".$date_fin_update."
+ WHERE id_adh='".$values['id_adh']."'";
+ $DB->Execute($requete);
+
+ // retour à la liste
+ header("location: gestion_contributions.php?id_adh=".$values['id_adh']);
+
+ // récupération du max pour passage en mode modif apres insertion
+ if ($id_cotis=="")
+ {
+ $requete = "SELECT max(id_cotis)
+ AS max
+ FROM ".PREFIX_DB."cotisations";
+ $max = $DB->Execute($requete);
+ $id_cotis = $max->fields["max"];
+ }
+ }
+ }
+
+ //
+ // Pré-remplissage des champs
+ // avec des valeurs issues de la base
+ // -> donc uniquement si l'enregistrement existe et que le formulaire
+ // n'a pas déja été posté avec des erreurs (pour pouvoir corriger)
+
+ if (!isset($_POST["valid"]) || (isset($_POST["valid"]) && $error_detected==""))
+ if ($id_cotis != "")
+ {
+ // recup des données
+ $requete = "SELECT *
+ FROM ".PREFIX_DB."cotisations
+ WHERE id_cotis=$id_cotis";
+ $result = $DB->Execute($requete);
+ if ($result->EOF)
+ header("location: index.php");
+
+
+
+ // recuperation de la liste de champs de la table
+ //$fields = &$DB->MetaColumns(PREFIX_DB."cotisations");
+ foreach ($fields as $champ => $proprietes)
+ {
+ $proprietes_arr = get_object_vars($proprietes);
+ // on obtient name, max_length, type, not_null, has_default, primary_key,
+ // auto_increment et binary
+
+ // déclaration des variables correspondant aux champs
+ // et reformatage des dates.
+
+ $val = $result->fields[$proprietes_arr["name"]];
+
+ if($proprietes_arr["type"]=="date" && $val!="")
+ {
+ list($a,$m,$j)=explode("-",$val);
+ $val="$j/$m/$a";
+ }
+ $values[$proprietes_arr["name"]] = htmlentities(stripslashes(addslashes($val)), ENT_QUOTES);
+ }
+ }
+ else
+ {
+ // initialisation des champs
+
+ }
+
+ // la date de creation de fiche, ici vide si nouvelle fiche
+ if ($date_cotis=="")
+ $date_cotis = date("d/m/Y");
+
+ include("header.php");
+
+?>
+
+ ()
+
+
diff --git a/seed/galette/manual/image/postinstall/galette/etiquettes_adherents.php b/seed/galette/manual/image/postinstall/galette/etiquettes_adherents.php
new file mode 100644
index 0000000..6f96771
--- /dev/null
+++ b/seed/galette/manual/image/postinstall/galette/etiquettes_adherents.php
@@ -0,0 +1,208 @@
+qstr($value);
+ }
+ $requete .= $where_clause." ORDER by nom_adh, prenom_adh;";
+ $resultat = &$DB->Execute($requete);
+
+ $pdf = new pdffile;
+ $pdf->set_default('margin', 0);
+ $firstpage = $pdf->new_page("a4-landscape");
+ $param["height"] = PREF_ETIQ_CORPS;
+ $param["fillcolor"] = $pdf->get_color('#000000');
+ $param["align"] = "center";
+ $param["width"] = 1;
+ $param["strokecolor"] = $pdf->get_color('#000000');
+ if ($resultat->EOF)
+ die();
+ $yorigin=545;
+ $xorigin=round(PREF_ETIQ_MARGES*2.835);
+ $row=1;
+ $nb_etiq=0;
+ $concatname = "";
+ $i=0;
+ $j=0;
+ while (date("Ym",strtotime("$j saturday", strtotime($datenow))) <= $annee.$mois)
+ {
+ $j++;
+ if (date("m",strtotime("$j saturday", strtotime($datenow))) == $mois) {
+ $panier[$i][0]=0;
+ $panier[$i][1]=0;
+ $date[$i]=date("d/m/Y",strtotime($j . " saturday", strtotime($datenow)));
+ $date2[$i]=date("Y-m-d",strtotime($j . " saturday", strtotime($datenow)));
+ $i++;
+ }
+ if ($j > 10) {
+ print "Problème dans le calcul des mois !";
+ die();
+ }
+ }
+ $col = $i;
+ $ligne = 18;
+ $x1 = 70;
+ $x2 = 300;
+ $ecart = 480/$col;
+ $hecart = 490/$ligne;
+
+
+ while (!$resultat->EOF)
+ {
+ $y1 = $yorigin-(($row-1)*($hecart));
+ $y2 = $y1 - $hecart;
+ if ($row==1)
+ {
+ $param["font"] = "Helvetica-Bold";
+ $pdf->draw_rectangle($yorigin+20, $x1, $yorigin, $x2, $firstpage, $param);
+ $pdf->draw_paragraph($yorigin+20, $x1, $yorigin, $x2, "Nom", $firstpage, $param);
+ $pdf->draw_rectangle($yorigin+20, $x2, $yorigin, $x2+40, $firstpage, $param);
+ $pdf->draw_paragraph($yorigin+20, $x2, $yorigin, $x2+40, "Prix", $firstpage, $param);
+ $i=0;
+ while($i<$col)
+ {
+ $xdr1=$x2+40+$i*$ecart;
+ $xdr2=$x2+40+($i+1)*$ecart;
+ $pdf->draw_paragraph($yorigin+20, $xdr1, $yorigin, $xdr2, $date[$i], $firstpage, $param);
+ $pdf->draw_rectangle($yorigin+20, $xdr1, $yorigin, $xdr2, $firstpage, $param);
+ $i++;
+ }
+ }
+ if ( ($_POST['panier'] == "legume" && $resultat->fields[9] != "-1") || ($_POST['panier'] == "pain" && $resultat->fields[10] != "0") ) {
+ $nom_adh_ext="";
+ switch($resultat->fields[4])
+ {
+ case "1" :
+ $nom_adh_ext .= _T("M.");
+ break;
+ case "2" :
+ $nom_adh_ext .= _T("Mme.");
+ break;
+ default :
+ $nom_adh_ext .= _T("Mlle.");
+ }
+
+ $nom_adh_ext .= " ".strtoupper($resultat->fields[1])." ".ucfirst(strtolower($resultat->fields[2]));
+ $concatname = $concatname . " - " . $nom_adh_ext;
+ $param["font"] = "Helvetica";
+ $pdf->draw_paragraph($y1-5, $x1, $y2, $x2, $nom_adh_ext, $firstpage, $param);
+ $pdf->draw_rectangle ($y1, $x1, $y2, $x2, $firstpage, $param);
+ $pdf->draw_rectangle($y1, $x2, $y2, $x2+40, $firstpage, $param);
+// $pdf->draw_rectangle($y1, $x2+20, $y2, $x2+40, $firstpage, $param);
+ if ($_POST['panier'] == "legume")
+ {
+ $qpanier=$resultat->fields[9];
+ if ($qpanier == "0" )
+ $qpanier_result="pp";
+ else
+ $qpanier_result="GP";
+ } else if ($_POST['panier'] == "pain") {
+ $qpanier=$resultat->fields[10];
+ if ($qpanier == "1" )
+ $qpanier_result="3";
+ if ($qpanier == "2" )
+ $qpanier_result="5";
+ if ($qpanier == "3" )
+ $qpanier_result="7";
+ if ($qpanier == "4" )
+ $qpanier_result="9,50";
+ }
+ $pdf->draw_paragraph($y1, $x2, $y2, $x2+40, $qpanier_result, $firstpage, $param);
+ $i=0;
+ while($i<$col)
+ {
+ $absence = &$DB->Execute("SELECT * FROM `galette_absences` WHERE `id_adh` = " . $resultat->fields[0] . " AND `date_abs` = '$date2[$i]'");
+ if (!$absence->EOF)
+ $pdf->draw_paragraph($y1, $x2+$i*$ecart+40, $y2, $x2+($i+1)*$ecart+40, "Absent", $firstpage, $param);
+ else
+ $panier[$i+1][$qpanier]=$panier[$i+1][$qpanier]+1;
+ $pdf->draw_rectangle($y1, $x2+$i*$ecart+40, $y2, $x2+($i+1)*$ecart+40, $firstpage, $param);
+ $i++;
+ }
+
+ $row++;
+ if ($row>$ligne)
+ {
+ $row=1;
+ $firstpage = $pdf->new_page("a4-landscape");
+ }
+ $nb_etiq++;
+ }
+ $resultat->MoveNext();
+ }
+ $i=0;
+ while($i<$col)
+ {
+ $pdf->draw_rectangle($y2, $x2+$i*$ecart+40, $y2-20, $x2+($i+1)*$ecart+40, $firstpage, $param);
+ if ($_POST['panier'] == "legume")
+ $display="pp : " . $panier[$i+1][0] . " | GP : " . $panier[$i+1][1];
+ if ($_POST['panier'] == "pain")
+ $display="3E : " . $panier[$i+1][1] . " | 5E : " . $panier[$i+1][2] . " | 7E : " . $panier[$i+1][3] . " | 9E50 : " . $panier[$i+1][4];
+
+ $pdf->draw_paragraph($y2, $x2+$i*$ecart+40, $y2-20, $x2+($i+1)*$ecart+40, $display, $firstpage, $param);
+ $i++;
+ }
+
+ $resultat->Close();
+ dblog(_T("Génération de ")." ".$nb_etiq." "._T("feuille emargement"),$concatname);
+ header("Content-Disposition: filename=feuille_emargement.pdf");
+ header("Content-Type: application/pdf");
+ $temp = $pdf->generate();
+ header('Content-Length: ' . strlen($temp));
+ echo $temp;
+?>
diff --git a/seed/galette/manual/image/postinstall/galette/etiquettes_adherents_2.php b/seed/galette/manual/image/postinstall/galette/etiquettes_adherents_2.php
new file mode 100644
index 0000000..30b9ef7
--- /dev/null
+++ b/seed/galette/manual/image/postinstall/galette/etiquettes_adherents_2.php
@@ -0,0 +1,127 @@
+qstr($value);
+ }
+ $requete .= $where_clause." ORDER by nom_adh, prenom_adh;";
+ // echo $requete;
+ $resultat = &$DB->Execute($requete);
+
+ $pdf = new pdffile;
+ $pdf->set_default('margin', 0);
+ $firstpage = $pdf->new_page("a4");
+ $param["height"] = PREF_ETIQ_CORPS;
+ $param["fillcolor"] = $pdf->get_color('#000000');
+ $param["align"] = "center";
+ $param["width"] = 1;
+ $param["strokecolor"] = $pdf->get_color('#DDDDDD');
+
+ if ($resultat->EOF)
+ die();
+
+ $yorigin=842-round(PREF_ETIQ_MARGES*2.835);
+ $xorigin=round(PREF_ETIQ_MARGES*2.835);
+ $col=1;
+ $row=1;
+ $nb_etiq=0;
+ $concatname = "";
+ while (!$resultat->EOF)
+ {
+ $nom_adh_ext="";
+ switch($resultat->fields[4])
+ {
+ case "1" :
+ $nom_adh_ext .= _T("M.");
+ break;
+ case "2" :
+ $nom_adh_ext .= _T("Mme.");
+ break;
+ default :
+ $nom_adh_ext .= _T("Mlle.");
+ }
+
+ $x1 = $xorigin + ($col-1)*(round(PREF_ETIQ_HSIZE*2.835)+round(PREF_ETIQ_HSPACE*2.835));
+ $x2 = $x1 + round(PREF_ETIQ_HSIZE*2.835);
+ $y1 = $yorigin-($row-1)*(round(PREF_ETIQ_VSIZE*2.835)+round(PREF_ETIQ_VSPACE*2.835));
+ $y2 = $y1 - round(PREF_ETIQ_VSIZE*2.835);
+
+ $nom_adh_ext .= " ".strtoupper($resultat->fields[1])." ".ucfirst(strtolower($resultat->fields[2]));
+ $concatname = $concatname . " - " . $nom_adh_ext;
+ $param["font"] = "Helvetica-Bold";
+ $pdf->draw_paragraph($y1-10, $x1, $y1-10-(round(PREF_ETIQ_VSIZE*2.835)/5)+5, $x2, $nom_adh_ext, $firstpage, $param);
+ $param["font"] = "Helvetica";
+ $pdf->draw_paragraph ($y1-10-(round(PREF_ETIQ_VSIZE*2.835)/5), $x1, $y1-10-(round(PREF_ETIQ_VSIZE*2.835)/5)-(round(PREF_ETIQ_VSIZE*2.835)*4/5), $x2, $resultat->fields[3]."\n".$resultat->fields[8]."\n".$resultat->fields[5]." - ".$resultat->fields[6]."\n".$resultat->fields[7], $firstpage, $param);
+ $pdf->draw_rectangle ($y1, $x1, $y2, $x2, $firstpage, $param);
+ $resultat->MoveNext();
+
+ $col++;
+ if ($col>PREF_ETIQ_COLS)
+ {
+ $col=1;
+ $row++;
+ }
+ if ($row>PREF_ETIQ_ROWS)
+ {
+ $col=1;
+ $row=1;
+ $firstpage = $pdf->new_page("a4");
+ }
+ $nb_etiq++;
+ }
+ $resultat->Close();
+ dblog(_T("Génération de ")." ".$nb_etiq." "._T("étiquette(s)"),$concatname);
+
+ header("Content-Disposition: filename=example.pdf");
+ header("Content-Type: application/pdf");
+ $temp = $pdf->generate();
+ header('Content-Length: ' . strlen($temp));
+ echo $temp;
+?>
diff --git a/seed/galette/manual/image/postinstall/galette/footer.php b/seed/galette/manual/image/postinstall/galette/footer.php
new file mode 100644
index 0000000..7a5de70
--- /dev/null
+++ b/seed/galette/manual/image/postinstall/galette/footer.php
@@ -0,0 +1,168 @@
+
+
+
+
+