templates/homepage.html.twig line 1

Open in your IDE?
  1. {% extends 'baseSyntherm.html.twig' %}
  2. {% block stylesheets %}
  3.     <link href="{{ asset('dropzone-5.7.0/dist/dropzone.css') }}" rel="stylesheet" type="text/css"/>
  4.     <script src="{{ asset('dropzone-5.7.0/dist/dropzone.js') }}" type="text/javascript"></script>
  5. {% endblock %}
  6. {#{% form_theme affichage 'form_div_layout.html.twig' %}#}
  7. {% block title %}
  8.     SOBRO XML
  9. {% endblock %}
  10. {% block body %}
  11.     <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
  12.     <br>
  13.     <div class="alert alert-warning justify-content-center" role="alert">
  14.                 Bienvenue sur l'application SOBRO XML. Cet outil analyse différents indicateurs à partir des fichiers XML issus du calcul RT2012 et RE2020
  15.     tels que la compacité ou le taux de brassage global et compare avec le reste de la base de donnée. <br>
  16.    
  17.         </div>
  18.     <br>
  19.     <br>
  20.     {#    {{ form(affichage) }}#}
  21.     {{ form_start(affichage) }}
  22.     <div class="form-row align-items-end ">
  23.         <div class="form-group col-3 sm">
  24.             {{ form_label(affichage.usage) }}
  25.             {{ form_widget(affichage.usage) }}
  26.         </div>
  27.         <div class="form-group col-3 sm">
  28.             {{ form_label(affichage.zoneClimatique) }}
  29.             {{ form_widget(affichage.zoneClimatique) }}
  30.         </div>
  31.         <div class="form-group col-3 sm">
  32.             {{ form_label(affichage.abscisse) }}
  33.             {{ form_widget(affichage.abscisse) }}
  34.         </div>
  35.         <div class="form-group col-3 sm">
  36.             {{ form_label(affichage.ordonnee) }}
  37.             {{ form_widget(affichage.ordonnee) }}
  38.         </div>
  39.         {{ form_end (affichage) }}
  40.     </div>
  41.     <!-- Chart Placement[2] -->
  42.     <div id="myChart">
  43.     </div>
  44.     {% if alert is not null %}
  45.         <div class="alert alert-warning justify-content-center" role="alert">
  46.             {{ alert }}
  47.         </div>
  48.     {% endif %}
  49.     {% if alertUtilisateur is not null %}
  50.         <div class="alert alert-warning justify-content-center" role="alert">
  51.             {{ alertUtilisateur }}
  52.         </div>
  53.     {% endif %}
  54.         {#{{ form_start(monForm) }}
  55.     <div class="form-row ">
  56.         <div class="form-group-sm col-md-6">
  57.             {{ form(monForm.fichier) }}
  58.         </div>
  59.         <div class="form-group-sm col-md-4">
  60.             {{ form_end (monForm) }}
  61.         </div>
  62.     </div>#}
  63.         
  64.             <br>
  65.     
  66.     Cliquez sur le nom du projet pour plus de détails :
  67.          <br>
  68.         
  69.     {% if listFicheBatiment is not null %}
  70.         <table class='table table-striped table-hover table-sm'>
  71.             <thead>
  72.             <th>Nom du projet</th>
  73.             <th >Usage</th>
  74.             <th >Ville</th>
  75.             <th >Bbio Chaud Annuel</th>
  76.             <th >Compacité (m2env /m²SHONRT)</th>
  77.             <th >Taux de brassage d'air (vol/h)</th>
  78.             <th >Uw moyen (W/m²/K)</th>
  79.             <th >Part des baies au sud</th>
  80.             <th >Taux de vitrage (m2vitr /m²SHONRT)</th>
  81.         </thead>          
  82.         <tbody>
  83.             {% for ficheAct in listFicheBatiment %}
  84.                 {% if ficheAct is not null %}
  85.                     <tr>
  86.                         <td>
  87.                             <a href="{{ path('fiche_batiment_analyse', {'id': ficheAct.id}) }}">    {{ ficheAct.nomDuProjetCourt }} </a>
  88.                         </td>
  89.                         <td>
  90.                             {{ ficheAct.nomUsageCourt }}
  91.                         </td>
  92.                         <td>
  93.                             {{ ficheAct.ville }}
  94.                         </td>
  95.                         <td>
  96.                             {{ ficheAct.bbiochaudannuel }}
  97.                         </td>
  98.                         <td>
  99.                             {{ ficheAct.compacite }}
  100.                         </td>
  101.                         <td>
  102.                             {{ ficheAct.tauxBrassageBBIO }}
  103.                         </td>
  104.                         <td>
  105.                             {{ ficheAct.uwMoyen }}
  106.                         </td>
  107.                         <td>
  108.                             {{ ficheAct.partBaiesSudBatiment }}%
  109.                         </td>
  110.                         <td>
  111.                             {{ ficheAct.tauxVitrage }}
  112.                         </td>
  113.                     </tr>
  114.                 {% endif %}
  115.             {% endfor %}
  116.         </tbody>
  117.     </table>
  118.     {{ knp_pagination_render(listFicheBatiment) }}
  119.     {% if is_granted('IS_AUTHENTICATED') %}
  120.         <a class="btn btn-primary" href="{{ path('export_xlsx') }}">
  121.             <i class="fas fa-download"></i> Exporter en XLSX
  122.         </a>
  123.         <br/>
  124.     {% endif %}
  125. {% endif %}
  126.     Faites une recherche "*.xml" dans votre dossier de projets et déplacez-les ici :
  127.     <br>
  128.     <form method="POST"
  129.           action="{{ path("upload-dropzone") }}"
  130.       class="dropzone"
  131.       id="my-awesome-dropzone"></form>
  132.         
  133.     <br>
  134.     <div class="row">
  135.         <a class="col-12 btn btn-primary" href="{{ path('homepage') }}">Analyser vos fichiers XML</a>
  136.     </div>
  137. <br>
  138. {% if app.user is null %}
  139.     <div class="alert alert-info">
  140.         Vous pouvez conservez les données de vos fichiers XML, pour ce faire si vous n'avez pas encore de compte utilisateur, vous devez procéder à votre <a href="{{ path('user_security_inscription') }}" title="Inscription">inscription</a> ou bien vous <a href="{{ path('user_security_login') }}" title="Connexion">connecter</a> avec vos identifiants.
  141.     </div>
  142. {% endif %}
  143. <script>
  144.     document.querySelectorAll('form select').forEach(elem => {
  145.         elem.addEventListener('change', function(){ document.querySelector('form').submit(); });
  146.     });
  147.     let myConfig = {
  148.         type: 'scatter',
  149.         plot: {
  150.             tooltip: {
  151.                 text:
  152.                     'BBIO = %v <BR> Uw moyen =  %data-uwmoyen W/m².K <BR> Q4 = %data-qpasurf m3/h/m² <BR> taux de vitrage = %data-tauxdevitrage m²v/m²shon',
  153.                     'html-mode': true
  154.                 }
  155.             },
  156.             scaleX: {
  157.                 label: {
  158.                     text: '{{ abscisse }}',
  159.                     fontSize: 14,
  160.                 },
  161.             },
  162.             scaleY: {
  163.                 label: {
  164.                     text: '{{ ordonnee }}',
  165.                     fontSize: 14,
  166.                 }
  167.             },
  168.             series: [
  169.                 {
  170.                     values: {{ graphiqueJsonAll['data'] }},
  171.                     dataTauxdevitrage: {{ graphiqueJsonAll['taux_de_vitrage'] }},
  172.                     dataUwmoyen: {{ graphiqueJsonAll['uw_moyen'] }},
  173.                     dataQpasurf: {{ graphiqueJsonAll['q_4_pasurf'] }},
  174.                     dataIdFiche: {{ graphiqueJsonAll['ids'] }},
  175.                     dataType:"other"
  176.                 }
  177.                 {% if listFicheBatiment is not null %}
  178.                     {% if alertUtilisateur is null %}
  179.                         ,
  180.                         {
  181.                             values:{{ graphiqueJsonUser['data'] }},
  182.                             text:"Projets utilisateur",
  183.                             dataTauxdevitrage: {{ graphiqueJsonUser['taux_de_vitrage'] }},
  184.                             dataUwmoyen: {{ graphiqueJsonUser['uw_moyen'] }},
  185.                             dataQpasurf: {{ graphiqueJsonUser['q_4_pasurf'] }},
  186.                             dataIdFiche: {{ graphiqueJsonUser['ids'] }},
  187.                             dataType:"user"
  188.                         }
  189.                     {% endif %}
  190.                 {% endif %}
  191.                 ]
  192.             };
  193.         {#zingchart.bind('myChart', 'node_click', function(e) {
  194.             console.log(e);
  195.             console.log(e["data-type"]);
  196.             if (e["data-type"] == "user") {
  197.                 window.location.href = Routing.generate('fiche_batiment_analyse', {'id' : e["data-id-fiche"]});
  198.             }
  199.         });
  200.         zingchart.bind('myChart', 'plot_click', function(e) {
  201.             console.log(e);
  202.             console.log(e["data-type"]);
  203.             if (e["data-type"] == "user") {
  204.                 window.location.href = Routing.generate('fiche_batiment_analyse', {'id' : e["data-id-fiche"]});
  205.             }
  206.         });#}
  207.         // Render Method[3]
  208.         zingchart.render({
  209.         id: 'myChart',
  210.             data: myConfig,
  211.             height: 550,
  212.             width: '100%',
  213.         });
  214.         
  215.         zingchart.node_click = function(p) {
  216.             {% if is_granted('ROLE_ADMIN') %}
  217.                 window.location.href = Routing.generate('fiche_batiment_analyse', {'id' : p["data-id-fiche"]});
  218.             {% else %}
  219.                 if (p["data-type"] == "user") {
  220.                     window.location.href = Routing.generate('fiche_batiment_analyse', {'id' : p["data-id-fiche"]});
  221.                 }
  222.             {% endif %}
  223.         };
  224.     
  225.          // Gère la dropzone
  226.          Dropzone.options.myAwesomeDropzone = {
  227.             paramName: "fichier", // The name that will be used to transfer the file
  228.             maxFilesize: 20, // MB
  229. {#            acceptedFiles: ".xml",".zip"#}
  230.          };
  231.          // var nodesAll = zingchart.exec('myChart', 'getseriesvalues', { plotindex: 0 });
  232.          // nodesAll.forEach(element => console.log(element));
  233.          zingchart.exec(1, 'removenode');
  234.     </script>  
  235. {% endblock %}