*/ //Liste des types de modèle $bloc = "<{$html_table}>"; $message = "?"; $url = "index.php"; $req = "SELECT `annexe_emballage_groupe`.*, `annexe_emballage_groupe_type`.*, `annexe_emballage_groupe_type`.`id_annexe_emballage_groupe_type` " . "FROM `annexe_emballage_groupe_type`, `annexe_emballage_groupe` " . "WHERE ( `annexe_emballage_groupe_type`.`id_annexe_emballage_groupe_type` = `annexe_emballage_groupe`.`id_annexe_emballage_groupe_configuration` ) " . "ORDER BY `annexe_emballage_groupe_type`.`id_annexe_emballage_groupe_type` ASC "; $result = DatabaseOperation::query($req); while ($rows = mysql_fetch_array($result)) { $bloc .= "<tr><td>" . $rows["nom_annexe_emballage_groupe"] . "</td><td>" . $rows["nom_annexe_emballage_groupe_type"] . "</td><td>" . "<a href=liste_type_post.php?action=supprimer&id_annexe_emballage_groupe=" . $rows["id_annexe_emballage_groupe"] . " />" . "<img src=\"../lib/images/supprimer.png\" width=\"24\" height=\"24\" border=\"0\" alt=\"\" />" . "</a>" . "</td></tr>"; } $bloc .= "</table>"; //Ajout d'un nouveau type $ajout = ""; $ajout = mysql_field_desc("annexe_emballage_groupe", "nom_annexe_emballage_groupe") . "<input type=text name=nom_annexe_emballage_groupe size=20 />"; $req_liste_type = "SELECT id_annexe_emballage_groupe_type, nom_annexe_emballage_groupe_type " . "FROM annexe_emballage_groupe_type " . "ORDER BY ordre_emballage_groupe_type "; $ajout .= afficher_requete_en_liste_deroulante($req_liste_type, $id_defaut, "id_annexe_emballage_groupe_type"); /* Sélection du mode d'affichage */ switch ($output) { /************* Début Code PDF *************/ case "pdf": //Constructeur $pdf = new XFPDF(); //Déclaration des variables de formatages $police_standard = "Arial"; $t1_police = $police_standard; $t1_style = "B"; $t1_size = "12";
$result = DatabaseOperation::query($req); $id_geo = mysql_result($result, 0, "id_geo"); $id_defaut = $id_geo; } else { $id_defaut = $site_production_fta_nomenclature; } $bloc .= afficher_requete_en_liste_deroulante($req_liste_site_assemblage, $id_defaut, $nom_liste); $bloc .= "</td></tr>"; //Codification Agrologic $nom_liste = "id_annexe_agrologic_article_codification"; $bloc .= "<tr class=contenu><td>" . mysql_field_desc("annexe_agrologic_article_codification", "id_annexe_agrologic_article_codification") . "</td><td>"; /* if($prefixe_annexe_agrologic_article_codification<>"02") { */ $req_liste = "SELECT id_annexe_agrologic_article_codification" . ", CONCAT_WS(' - ', prefixe_annexe_agrologic_article_codification, nom_annexe_agrologic_article_codification) " . "FROM annexe_agrologic_article_codification " . "WHERE prefixe_annexe_agrologic_article_codification<>'00' " . "ORDER BY prefixe_annexe_agrologic_article_codification "; $id_defaut = ${$nom_liste}; $bloc .= afficher_requete_en_liste_deroulante($req_liste, $id_defaut, $nom_liste); /* }else $bloc .= $prefixe_annexe_agrologic_article_codification." - ".$nom_annexe_agrologic_article_codification; */ $bloc .= "</td></tr>"; //Désignation Nomenclature $champ = "nom_fta_nomenclature"; $bloc .= "<tr class=contenu><td>" . mysql_field_desc("fta_composant", $champ) . "</td><td>"; $bloc .= "<input type=text name=" . $champ . " value=`" . ${$champ} . "` size=50/>"; $bloc .= "</td></tr>"; //Raccourcis de classification $champ = "suffixe_agrologic_fta_nomenclature"; $bloc .= "<tr class=contenu><td>" . mysql_field_desc("fta_composant", $champ) . "</td><td>"; if (!${$champ}) { ${$champ} = "Générique";
break; case "etape1": //L'étape 1 a été validé $action = "etape2"; //L'action sera d'enregistrer l'emballage //L'utilisateur peut sélectionner l'emballage exact //Groupe d'emballage mysql_table_load("annexe_emballage_groupe"); $champ = "nom_annexe_emballage_groupe"; $liste_emballage_groupe .= "<tr><td>{${'NOM_' . $champ}}:</td><td>" . "{${$champ}}</td></tr>"; $bloc .= $liste_emballage_groupe; //Liste des Emballages en fonction du groupe préalablement sélectionné $requete = "SELECT id_annexe_emballage, reference_fournisseur_annexe_emballage " . "FROM annexe_emballage " . "WHERE id_annexe_emballage_groupe={$id_annexe_emballage_groupe} " . "ORDER BY reference_fournisseur_annexe_emballage "; $id_defaut = ""; $nom_defaut = ""; $liste_emballage = "<tr><td>" . mysql_field_desc("annexe_emballage", "reference_fournisseur_annexe_emballage") . "</td><td>" . afficher_requete_en_liste_deroulante($requete, $id_defaut, $nom_defaut) . "</td></tr>"; $bloc .= $liste_emballage; //Nombre de couche dans l'emballage ascendant $champ = "nombre_couche_fta_conditionnement"; if (!${$champ}) { //Valeur par défaut ${$champ} = 1; } $label = mysql_field_desc("fta_conditionnement", $champ); $bloc .= "<tr><td>{$label}</td><td><input type=text name={$champ} value=`" . ${$champ} . "` size=20/></td></tr>"; //Quantité par couche dans l'emballage ascendant $champ = "quantite_par_couche_fta_conditionnement"; if (!${$champ}) { //Valeur par défaut ${$champ} = 1; }
//Enseigne $name_case = "all_client"; if ($all_client) { $checked = "checked"; $liste_client = "<input type=checkbox name={$name_case} value=1 {$checked}/> Tous"; } else { $checked = ""; $req_liste_client = "SELECT id_classification_arborescence_article_categorie_contenu, nom_classification_arborescence_article_categorie_contenu " . "FROM classification_arborescence_article_categorie_contenu " . "WHERE id_classification_arborescence_article_categorie = 1 " . "ORDER BY nom_classification_arborescence_article_categorie_contenu "; if (!$id_classification_arborescence_article_categorie_contenu) { $id_defaut = "0"; //Tarif général par défaut } else { $id_defaut = $id_classification_arborescence_article_categorie_contenu; } $nom_defaut = "id_classification_arborescence_article_categorie_contenu"; $liste_client = afficher_requete_en_liste_deroulante($req_liste_client, $id_defaut, $nom_defaut) . " - <input type=checkbox name={$name_case} value=1 {$checked}/> Tous"; } $HTML_entete .= "<tr><td>Liste des clients</td><td>{$liste_client}</td></tr>"; //Création du tableau de résultat $HTML_result = ""; $HTML_result .= "<tr class=titre><td>" . DatabaseDescription::getFieldDocLabel("fta", "LIBELLE", 1) . "</td><td>" . DatabaseDescription::getFieldDocLabel("fta", "Poids_ELEM", 1) . "</td><td>" . DatabaseDescription::getFieldDocLabel("fta", "CODE_ARTICLE", 1) . "</td><td>" . DatabaseDescription::getFieldDocLabel("fta", "Site_de_production", 1) . "</td><td>" . DatabaseDescription::getFieldDocLabel("fta", "EAN_UVC", 1) . "</td><td>" . DatabaseDescription::getFieldDocLabel("fta", "NB_UNIT_ELEM", 1) . "</td><td>" . DatabaseDescription::getFieldDocLabel("fta_tarif", "prix_fta_tarif", 1) . "</td><td>Périodes" . "</td></tr>"; //Requête principale $req = "SELECT LIBELLE, Poids_ELEM, CODE_ARTICLE, Site_de_production, EAN_UVC,NB_UNIT_ELEM, prix_fta_tarif, date_debut_fta_tarif, date_fin_fta_tarif " . "FROM fta, fta_etat, fta_tarif, geo " . "WHERE fta.id_fta_etat=fta_etat.id_fta_etat " . "AND fta_tarif.id_fta=fta.id_fta " . "AND geo.id_site=fta.Site_de_production " . "AND ( ( ( date_debut_fta_tarif < '{$periode_debut}' ) AND ( date_fin_fta_tarif > '{$periode_debut}' ) ) " . "OR ( ( date_debut_fta_tarif < '{$periode_fin}' ) AND ( date_fin_fta_tarif > '{$periode_fin}' ) ) " . "OR ( ( date_debut_fta_tarif > '{$periode_debut}' ) AND ( date_fin_fta_tarif < '{$periode_fin}' ) ) " . " ) " . "AND date_debut_fta_tarif<>'0000-00-00' " . "AND date_fin_fta_tarif<>'0000-00-00' "; //Critères additionnels if ($suffixe_agrologic_fta) { //Un raccourcis de classification a été sélectionné $req .= "AND fta.suffixe_agrologic_fta='" . $suffixe_agrologic_fta . "' "; } if ($id_classification_arborescence_article_categorie_contenu) { //Un client a été sélectionné $req .= "AND fta_tarif.id_classification_arborescence_article_categorie_contenu='" . $id_classification_arborescence_article_categorie_contenu . "' ";
. ", `access_arti2`.`actif` " . ", `fta_composition`.`id_fta_nomenclature` " . ", `access_arti2`.`id_fta` " . "HAVING ( `access_arti2`.`CODE_ARTICLE` IS NOT NULL " . "AND `access_arti2`.`actif` = - 1 " . "AND `fta_composition`.`id_fta_nomenclature` = 0 )" ; */ //Etat en cours de parcours if (!$id_fta_etat) { $id_fta_etat = 3; //FTA Validée } $nom_liste = "id_fta_etat"; $req_etat = "SELECT id_fta_etat, nom_fta_etat " . "FROM fta_etat " . "ORDER BY nom_fta_etat "; $id_defaut = $id_fta_etat; $liste_etat = afficher_requete_en_liste_deroulante($req_etat, $id_defaut, $nom_liste); //Parcours des Articles Validés ayant une composition /* $req_valide = "SELECT DISTINCT `access_arti2`.`CODE_ARTICLE` " . ", `access_arti2`.`LIBELLE` " . ", `access_arti2`.`actif` " . ", `access_arti2`.`id_fta` " . "FROM `fta_nomenclature`, `access_arti2`, fta_composition " . "WHERE `fta_nomenclature`.`id_fta` = `access_arti2`.`id_fta` " //. "AND `fta`.`id_fta` = `access_arti2`.`id_fta` " //. "AND `fta`.`id_access_arti2` = `access_arti2`.`id_access_arti2` ) " . "AND fta_composition.id_fta=access_arti2.id_fta " . "GROUP BY `access_arti2`.`CODE_ARTICLE` " . ", `access_arti2`.`LIBELLE` " . ", `access_arti2`.`actif` " //. ", `fta_nomenclature`.`id_fta_nomenclature` " . ", `access_arti2`.`id_fta` "
$page_action = $page_default . "_post.php"; $page_pdf = $page_default . "_pdf.php"; $action = 'valider'; //Action proposée à la page _post.php $method = 'POST'; //Pour une url > 2000 caractères, ne pas utiliser utiliser GET $html_table = "table " . "border=1 " . "width=100% " . "class=contenu "; /* Récupération des données MySQL */ //Enseigne $req_liste_client = "SELECT id_classification_arborescence_article_categorie_contenu, nom_classification_arborescence_article_categorie_contenu " . "FROM classification_arborescence_article_categorie_contenu " . "WHERE id_classification_arborescence_article_categorie = 1 " . "ORDER BY nom_classification_arborescence_article_categorie_contenu "; $id_defaut = "0"; //Tarif général par défaut $nom_defaut = ""; $liste_client = afficher_requete_en_liste_deroulante($req_liste_client, $id_defaut, $nom_defaut); // Exemple: mysql_table_load('nom_de_ma_table'); //Conditions Commerciale /* Création des objets HTML (listes déroulante, cases à cocher ...etc.) */ //Début de la période du tarif $champ = "date_debut_fta_tarif"; $bloc .= "<tr class=contenu><td width=\"40%\">" . mysql_field_desc("fta_tarif", "date_debut_fta_tarif") . "</td><td>"; $bloc .= selection_date_pour_mysql($champ, ${$champ}) . " <i>Laissez vide pour que le tarif soit appliqué immédiatement</i>"; $bloc .= "</td></tr>"; //Fin de la période du tarif $champ = "date_fin_fta_tarif"; $bloc .= "<tr class=contenu><td width=\"40%\">" . mysql_field_desc("fta_tarif", "date_fin_fta_tarif") . "</td><td>"; $bloc .= selection_date_pour_mysql($champ, ${$champ}) . " <i>Laissez vide pour que le tarif soit appliqué jusqu'à la fin de l'année</i>"; $bloc .= "</td></tr>";