| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <header class="d-flex flex-column flex-md-row align-items-md-center p-3 bg-light ">
- <h2 class="bd-title" id="content">
- <span>Administration : Comptes Bancaires</span>
- </h2>
- </header>
- <?php
- echo core::filAriane(array(
- "current" => "Comptes Bancaires",
- "arbo" => array(
- "Administration" => NULL,
- "Comptes Bancaires" => "/parametres-comptes.html"
- )
- ));
- $allBank = banque::getAll();
- $onglets = $form = [];
- foreach($allBank as $value){
- $onglets[$value["id"]] = $value["label"];
- $form[$value["id"]] = $value;
- }
- $onglets["add"] = "Nouveau compte";
- $form["add"] = NULL;
- ?>
- <ul class="nav nav-tabs" id="tab-parametres-compte" role="tablist" style="margin-bottom:20px;">
- <?php
- $first = true;
- foreach ($onglets as $id => $label) {
- $activeClass = $first ? 'active' : '';
- echo '<li class="nav-item">';
- echo '<a class="nav-link ' . $activeClass . '" data-bs-toggle="tab" href="#parametres-compte-' . $id . '">' . $label . '</a>';
- echo '</li>';
- $first = false;
- }
- ?>
- </ul>
- <div class="tab-content">
- <?php
- $first = true;
- foreach ($onglets as $id => $label) {
- $activeClass = $first ? 'show active' : '';
- echo '<div id="parametres-compte-' . $id . '" class="tab-pane fade ' . $activeClass . '">';
- banque::printFormCompte($form[$id]);
- echo '</div>';
- $first = false;
- }
- ?>
- </div>
- <script>
- $(document).ready(function() {
- var fragment = window.location.hash;
- var tmpOnglet = fragment ? fragment.substring(1) : '';
- var onglet = "#" + tmpOnglet;
- if (tmpOnglet !== "" && $(onglet).length) {
- $('#tab-parametres-compte a[href="' + onglet + '"]').tab('show');
- }
- $("#tab-parametres-compte a").click(function(e){
- e.preventDefault();
- $(this).tab('show');
- history.replaceState(null, null, $(this).attr('href'));
- });
- $('#tab-parametres-compte a').on('shown.bs.tab', function(event){
- var x = $(event.target).text();
- var y = $(event.relatedTarget).text();
- });
- });
- </script>
|