function show_coord_form($id = 0) { global $msg; global $charset; global $coord_form, $coord_form_biblio, $coord_form_suite; global $ptab, $script; $ptab[1] = $ptab[1] . $ptab[10] . $ptab[11]; $ptab[1] = str_replace('!!adresse!!', htmlentities($msg[acquisition_adr_fac], ENT_QUOTES, $charset), $ptab[1]); $coord_form = str_replace('!!id!!', $id, $coord_form); $ptab[3] = str_replace('!!id!!', $id, $ptab[3]); if (!$id) { $coord_form = str_replace('!!form_title!!', htmlentities($msg[acquisition_ajout_biblio], ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!raison_suppr!!', '', $coord_form); $coord_form = str_replace('!!raison!!', '', $coord_form); $coord_form = str_replace('!!contact!!', $ptab[1], $coord_form); $coord_form = str_replace('!!max_coord!!', '2', $coord_form); $coord_form = str_replace('!!id1!!', '0', $coord_form); $coord_form = str_replace('!!lib_1!!', '', $coord_form); $coord_form = str_replace('!!cta_1!!', '', $coord_form); $coord_form = str_replace('!!ad1_1!!', '', $coord_form); $coord_form = str_replace('!!ad2_1!!', '', $coord_form); $coord_form = str_replace('!!cpo_1!!', '', $coord_form); $coord_form = str_replace('!!vil_1!!', '', $coord_form); $coord_form = str_replace('!!eta_1!!', '', $coord_form); $coord_form = str_replace('!!pay_1!!', '', $coord_form); $coord_form = str_replace('!!te1_1!!', '', $coord_form); $coord_form = str_replace('!!te2_1!!', '', $coord_form); $coord_form = str_replace('!!fax_1!!', '', $coord_form); $coord_form = str_replace('!!ema_1!!', '', $coord_form); $coord_form = str_replace('!!com_1!!', '', $coord_form); $coord_form = str_replace('!!id2!!', '0', $coord_form); $coord_form = str_replace('!!lib_2!!', '', $coord_form); $coord_form = str_replace('!!cta_2!!', '', $coord_form); $coord_form = str_replace('!!ad1_2!!', '', $coord_form); $coord_form = str_replace('!!ad2_2!!', '', $coord_form); $coord_form = str_replace('!!cpo_2!!', '', $coord_form); $coord_form = str_replace('!!vil_2!!', '', $coord_form); $coord_form = str_replace('!!eta_2!!', '', $coord_form); $coord_form = str_replace('!!pay_2!!', '', $coord_form); $coord_form = str_replace('!!te1_2!!', '', $coord_form); $coord_form = str_replace('!!te2_2!!', '', $coord_form); $coord_form = str_replace('!!fax_2!!', '', $coord_form); $coord_form = str_replace('!!ema_2!!', '', $coord_form); $coord_form = str_replace('!!com_2!!', '', $coord_form); $coord_form = str_replace('!!commentaires!!', '', $coord_form); $coord_form = str_replace('!!siret!!', '', $coord_form); $coord_form = str_replace('!!rcs!!', '', $coord_form); $coord_form = str_replace('!!naf!!', '', $coord_form); $coord_form = str_replace('!!tva!!', '', $coord_form); $coord_form = str_replace('!!site_web!!', '', $coord_form); $coord_form = str_replace('!!logo!!', '', $coord_form); autorisations(); } else { $biblio = new entites($id); $coord_form = str_replace('!!form_title!!', htmlentities($msg[acquisition_modif_biblio], ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!raison!!', htmlentities($biblio->raison_sociale, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!contact!!', $ptab[1], $coord_form); $row = mysql_fetch_object(entites::get_coordonnees($biblio->id_entite, '1')); $coord_form = str_replace('!!id1!!', $row->id_contact, $coord_form); $coord_form = str_replace('!!lib_1!!', htmlentities($row->libelle, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!cta_1!!', htmlentities($row->contact, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!ad1_1!!', htmlentities($row->adr1, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!ad2_1!!', htmlentities($row->adr2, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!cpo_1!!', htmlentities($row->cp, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!vil_1!!', htmlentities($row->ville, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!eta_1!!', htmlentities($row->etat, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!pay_1!!', htmlentities($row->pays, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!te1_1!!', htmlentities($row->tel1, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!te2_1!!', htmlentities($row->tel2, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!fax_1!!', htmlentities($row->fax, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!ema_1!!', htmlentities($row->email, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!com_1!!', htmlentities($row->commentaires, ENT_QUOTES, $charset), $coord_form); $row = mysql_fetch_object(entites::get_coordonnees($biblio->id_entite, '2')); $coord_form = str_replace('!!id2!!', $row->id_contact, $coord_form); $coord_form = str_replace('!!lib_2!!', htmlentities($row->libelle, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!cta_2!!', htmlentities($row->contact, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!ad1_2!!', htmlentities($row->adr1, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!ad2_2!!', htmlentities($row->adr2, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!cpo_2!!', htmlentities($row->cp, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!vil_2!!', htmlentities($row->ville, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!eta_2!!', htmlentities($row->etat, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!pay_2!!', htmlentities($row->pays, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!te1_2!!', htmlentities($row->tel1, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!te2_2!!', htmlentities($row->tel2, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!fax_2!!', htmlentities($row->fax, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!ema_2!!', htmlentities($row->email, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!com_2!!', htmlentities($row->commentaires, ENT_QUOTES, $charset), $coord_form); $liste_coord = entites::get_coordonnees($biblio->id_entite, '0'); $coord_form = str_replace('!!max_coord!!', mysql_num_rows($liste_coord) + 2, $coord_form); $i = 3; while ($row = mysql_fetch_object($liste_coord)) { $coord_form = str_replace('<!--coord_repetables-->', $ptab[2] . '<!--coord_repetables-->', $coord_form); $coord_form = str_replace('!!no_X!!', $i, $coord_form); $i++; $coord_form = str_replace('!!idX!!', $row->id_contact, $coord_form); $coord_form = str_replace('!!lib_X!!', htmlentities($row->libelle, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!cta_X!!', htmlentities($row->contact, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!ad1_X!!', htmlentities($row->adr1, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!ad2_X!!', htmlentities($row->adr2, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!cpo_X!!', htmlentities($row->cp, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!vil_X!!', htmlentities($row->ville, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!eta_X!!', htmlentities($row->etat, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!pay_X!!', htmlentities($row->pays, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!te1_X!!', htmlentities($row->tel1, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!te2_X!!', htmlentities($row->tel2, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!fax_X!!', htmlentities($row->fax, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!ema_X!!', htmlentities($row->email, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!com_X!!', htmlentities($row->commentaires, ENT_QUOTES, $charset), $coord_form); } $coord_form = str_replace('!!commentaires!!', htmlentities($biblio->commentaires, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!siret!!', htmlentities($biblio->siret, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!rcs!!', htmlentities($biblio->rcs, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!naf!!', htmlentities($biblio->naf, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!tva!!', htmlentities($biblio->tva, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!site_web!!', htmlentities($biblio->site_web, ENT_QUOTES, $charset), $coord_form); $coord_form = str_replace('!!logo!!', htmlentities($biblio->logo, ENT_QUOTES, $charset), $coord_form); autorisations($biblio->autorisations); $coord_form = str_replace('<!-- bouton_sup -->', $ptab[3], $coord_form); $coord_form = str_replace('!!raison_suppr!!', addslashes($biblio->raison_sociale), $coord_form); } print confirmation_delete("./admin.php?categ=acquisition&sub=entite&action=del&id="); print $script; print $coord_form; }
function show_rub_form($id_bud, $id_rub = 0, $id_parent = 0) { global $dbh, $msg, $charset; global $rub_form, $bt_add_lig; global $ptab; global $lig_rub, $lig_rub_img; global $mnt_rub_form; //Récuperation du budget if ($id_bud) { $bud = new budgets($id_bud); } else { die; } //Récupération entité $id_bibli = $bud->num_entite; $biblio = new entites($id_bibli); $head_form = "<div class='row'><label class='etiquette'>" . htmlentities($biblio->raison_sociale, ENT_QUOTES, $charset) . "</label></div>"; //Affichage entete formulaire if (!$id_rub) { //création de rubrique $rub_form = str_replace('!!form_title!!', htmlentities($msg[acquisition_ajout_rub], ENT_QUOTES, $charset), $rub_form); //Affichage barre de navigation $nav_form .= "<a href=\"./admin.php?categ=acquisition&sub=budget&action=modif&id_bibli=" . $id_bibli . "&id_bud=" . $id_bud . "\" >" . $bud->libelle . "</a>"; if ($id_parent) { $list_bar = rubriques::listAncetres($id_parent, TRUE); foreach ($list_bar as $value) { $nav_form .= " > <a href=\"./admin.php?categ=acquisition&sub=budget&action=modif_rub&id_bud=" . $id_bud . "&id_rub=" . $value[0] . "&id_parent=" . $value[2] . "\" >" . htmlentities($value[1], ENT_QUOTES, $charset) . "</a>"; } } $rub_form = str_replace('<!-- nav_form -->', $nav_form, $rub_form); $rub_form = str_replace('!!libelle!!', '', $rub_form); if ($bud->type_budget == TYP_BUD_RUB) { $rub_form = str_replace('<!-- lib_mnt -->', $mnt_rub_form[0], $rub_form); $mnt_rub = str_replace('!!mnt_rub!!', '0.00', $mnt_rub_form[1]); $rub_form = str_replace('<!-- montant -->', $mnt_rub, $rub_form); $rub_form = str_replace('!!lib_mnt!!', htmlentities($msg['acquisition_rub_mnt'], ENT_QUOTES, $charset), $rub_form); } else { $rub_form = str_replace('!!lib_mnt!!', ' ', $rub_form); } $label_ncp = "<label class='etiquette' for='ncp'>" . htmlentities($msg[acquisition_num_cp_compta], ENT_QUOTES, $charset) . "</label>"; $rub_form = str_replace('<!-- label_ncp -->', $label_ncp, $rub_form); $ncp = "<input type='text' id='ncp' name='ncp' class='saisie-30em' style='text-align:right' value='' />"; $rub_form = str_replace('!!ncp!!', $ncp, $rub_form); $rub_form = str_replace('!!comment!!', '', $rub_form); //Complément du bouton annuler if (!$id_parent) { $undo = "modif"; } else { $undo = "modif_rub"; } $rub_form = str_replace('!!undo!!', $undo, $rub_form); //complément du formulaire $rub_form = str_replace('!!id_bibli!!', $id_bibli, $rub_form); $rub_form = str_replace('!!id_bud!!', $id_bud, $rub_form); $rub_form = str_replace('!!id_rub!!', 0, $rub_form); $rub_form = str_replace('!!id_parent!!', $id_parent, $rub_form); //Affichage des autorisations autorisations($id_rub, $id_parent, $id_bud); } else { //modification de rubrique $rub_form = str_replace('!!form_title!!', htmlentities($msg[acquisition_modif_rub], ENT_QUOTES, $charset), $rub_form); //Récupération rubrique if ($id_rub) { $rub = new rubriques($id_rub); } //Affichage barre de navigation $nav_form .= "<a href=\"./admin.php?categ=acquisition&sub=budget&action=modif&id_bibli=" . $id_bibli . "&id_bud=" . $id_bud . "\" >" . $bud->libelle . "</a>"; $list_bar = rubriques::listAncetres($id_rub, FALSE); foreach ($list_bar as $value) { $nav_form .= " > <a href=\"./admin.php?categ=acquisition&sub=budget&action=modif_rub&id_bud=" . $id_bud . "&id_rub=" . $value[0] . "&id_parent=" . $value[2] . "\" >" . htmlentities($value[1], ENT_QUOTES, $charset) . "</a>"; } $rub_form = str_replace('<!-- nav_form -->', $nav_form, $rub_form); $rub_form = str_replace('!!libelle!!', htmlentities($rub->libelle, ENT_QUOTES, $charset), $rub_form); if (!$bud->type_budget) { $rub_form = str_replace('!!lib_mnt!!', htmlentities($msg['acquisition_rub_mnt'], ENT_QUOTES, $charset), $rub_form); if (rubriques::countChilds($id_rub)) { $ncp = ' '; $aut = FALSE; } else { $rub_form = str_replace('<!-- lib_mnt -->', $mnt_rub_form[0], $rub_form); $mnt_rub = str_replace('!!mnt_rub!!', $rub->montant, $mnt_rub_form[1]); $rub_form = str_replace('<!-- montant -->', $mnt_rub, $rub_form); $label_ncp = "<label class='etiquette' for='ncp'>" . htmlentities($msg[acquisition_num_cp_compta], ENT_QUOTES, $charset) . "</label>"; $ncp = "<input type='text' id='ncp' name='ncp' class='saisie-30em' style='text-align:right' value='" . $rub->num_cp_compta . "' />"; $aut = TRUE; } } else { $rub_form = str_replace('!!lib_mnt!!', ' ', $rub_form); if (rubriques::countChilds($id_rub)) { $ncp = ' '; $aut = FALSE; } else { $label_ncp = "<label class='etiquette' for='ncp'>" . htmlentities($msg[acquisition_num_cp_compta], ENT_QUOTES, $charset) . "</label>"; $ncp = "<input type='text' id='ncp' name='ncp' class='saisie-30em' style='text-align:right' value='" . $rub->num_cp_compta . "' />"; $aut = TRUE; } } $rub_form = str_replace('<!-- label_ncp -->', $label_ncp, $rub_form); $rub_form = str_replace('!!ncp!!', $ncp, $rub_form); $rub_form = str_replace('!!comment!!', htmlentities($rub->commentaires, ENT_QUOTES, $charset), $rub_form); //complément du formulaire $rub_form = str_replace('!!id_rub!!', $id_rub, $rub_form); $rub_form = str_replace('!!id_parent!!', $id_parent, $rub_form); //affichage du bouton ajout rubrique si budget non clôturé if ($bud->statut != STA_BUD_CLO) { $bt_add_lig = str_replace('!!id_rub!!', '0', $bt_add_lig); $bt_add_lig = str_replace('!!id_parent!!', $id_rub, $bt_add_lig); $rub_form = str_replace('<!-- bouton_lig -->', $bt_add_lig, $rub_form); } //Complément du bouton annuler if (!$id_parent) { $undo = "modif"; } else { $undo = "modif_rub"; } $rub_form = str_replace('!!undo!!', $undo, $rub_form); //Affichage du bouton supprimer $rub_form = str_replace('<!-- bouton_sup -->', $ptab[1], $rub_form); print confirmation_delete("./admin.php?categ=acquisition&sub=budget&action=del_rub&id_bibli=" . $id_bibli . "&id_bud=" . $id_bud . "&id_parent=" . $id_parent . "&id_rub="); $rub_form = str_replace('!!id!!', $id_rub, $rub_form); $rub_form = str_replace('!!libelle_suppr!!', addslashes($rub->libelle), $rub_form); //Affichage rubriques budgetaires $q = budgets::listRubriques($id_bud, $id_rub); $list_n1 = mysql_query($q, $dbh); while ($row = mysql_fetch_object($list_n1)) { $rub_form = str_replace('<!-- rubriques -->', $lig_rub[0] . '<!-- rubriques -->', $rub_form); $rub_form = str_replace('<!-- marge -->', '', $rub_form); if (rubriques::countChilds($row->id_rubrique)) { $rub_form = str_replace('<!-- img_plus -->', $lig_rub_img, $rub_form); } else { $rub_form = str_replace('<!-- img_plus -->', '', $rub_form); } $rub_form = str_replace('!!id_rub!!', $row->id_rubrique, $rub_form); $rub_form = str_replace('!!id_parent!!', $row->num_parent, $rub_form); $rub_form = str_replace('!!lib_rub!!', $row->libelle, $rub_form); if (!$bud->type_budget) { $rub_form = str_replace('!!mnt!!', $row->montant, $rub_form); } else { $rub_form = str_replace('!!mnt!!', ' ', $rub_form); } $rub_form = str_replace('!!ncp!!', $row->num_cp_compta, $rub_form); $rub_form = str_replace('<!-- sous_rub -->', '<!-- sous_rub' . $row->id_rubrique . ' -->', $rub_form); afficheSousRubriques($id_bud, $row->id_rubrique, $rub_form, 1); } //complément du formulaire $rub_form = str_replace('!!id_bibli!!', $id_bibli, $rub_form); $rub_form = str_replace('!!id_bud!!', $id_bud, $rub_form); //Affichage des autorisations if ($aut) { autorisations($id_rub, $id_parent, $id_bud); } } print $head_form . $rub_form; }