Advertisement
KBOE2

AAO-Generator

Oct 30th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var Fz = {
  2.     0: {
  3.         0: "LFTLF",
  4.         1: "LF/TLF",
  5.     },
  6.     1: {
  7.         0: "LF",
  8.         1: "LF",
  9.     },
  10.     2: {
  11.         0: "TLF",
  12.         1: "TLF",
  13.     },
  14.     3: {
  15.         0: "ELW1",
  16.         1: "ELW 1",
  17.     },
  18.     4: {
  19.         0: "ELW2",
  20.         1: "ELW 2",
  21.     },
  22.     5: {
  23.         0: "DLK",
  24.         1: "DLK",
  25.     },
  26.     6: {
  27.         0: "HLF",
  28.         1: "HLF",
  29.     },
  30.     7: {
  31.         0: "RWHLF",
  32.         1: "RW/HLF",
  33.     },
  34.     8: {
  35.         0: "RW",
  36.         1: "RW",
  37.     },
  38.     9: {
  39.         0: "ABR",
  40.         1: "AB-Rüst",
  41.     },
  42.     10: {
  43.         0: "ABRRWHLF",
  44.         1: "AB-Rüst/RW/HLF",
  45.     },
  46.     11: {
  47.         0: "GWAABA",
  48.         1: "GW-Atem/AB-Atem",
  49.     },
  50.     12: {
  51.         0: "ABA",
  52.         1: "AB-Atem",
  53.     },
  54.     13: {
  55.         0: "GWA",
  56.         1: "GW-Atem",
  57.     },
  58.     14: {
  59.         0: "GWOELABOEL",
  60.         1: "GW-Öl/AB-Öl",
  61.     },
  62.     15: {
  63.         0: "ABOEL",
  64.         1: "AB-Öl",
  65.     },
  66.     16: {
  67.         0: "GWOEL",
  68.         1: "GW-Öl",
  69.     },
  70.     17: {
  71.         0: "SCHABSCH",
  72.         1: "Schlauchwagen/Ab-Schlauch",
  73.     },
  74.     18: {
  75.         0: "SCH",
  76.         1: "Schlauchwagen",
  77.     },
  78.     19: {
  79.         0: "ABSCH",
  80.         1: "AB-Schlauch",
  81.     },
  82.     20: {
  83.         0: "GWMESS",
  84.         1: "GW-Messtechnik",
  85.     },
  86.     21: {
  87.         0: "GWG",
  88.         1: "GW-Gefahrgut",
  89.     },
  90.     22: {
  91.         0: "GWH",
  92.         1: "GW-Höhenrettung",
  93.     },
  94.     23: {
  95.         0: "DEKONABDEKON",
  96.         1: "Dekon-P/AB-Dekon-P",
  97.     },
  98.     24: {
  99.         0: "DEKON",
  100.         1: "Dekon-P",
  101.     },
  102.     25: {
  103.         0: "ABDEKON",
  104.         1: "AB-Dekn-P",
  105.     },
  106.     26: {
  107.         0: "MTW",
  108.         1: "MTW",
  109.     },
  110.     27: {
  111.         0: "FWK",
  112.         1: "Feuerwehrkran",
  113.     },
  114.     28: {
  115.         0: "FUSTW",
  116.         1: "Funkstreifenwagen",
  117.     }
  118. }
  119. var aaos = {
  120.     feuerwehr: {
  121.         LFTLF1: 1,
  122.         LFTLF2: 2,
  123.         LFTLF4: 4,
  124.         LFTLF8: 8,
  125.         LFTLF16: 16,
  126.         LF1: 1,
  127.         LF2: 2,
  128.         LF4: 4,
  129.         LF8: 8,
  130.         LF16: 16,
  131.         TLF1: 1,
  132.         TLF2: 2,
  133.         TLF4: 4,
  134.         TLF8: 8,
  135.         TLF16: 16,
  136.     },
  137.     polizei: {
  138.         FUSTW1: 1,
  139.         FUSTW2: 2,
  140.         FUSTW4: 4,
  141.         FUSTW8: 8,
  142.         FUSTW16: 16,
  143.     }
  144. };
  145. $("label.string.required").append(`
  146. <!DOCTYPE html>
  147. <html>
  148. <head>
  149. <style>
  150.     .modal{
  151.         display: none;
  152.         position: fixed;
  153.         z-index: 1;
  154.         padding-top: 50px;
  155.         left: 0;
  156.         top: 0;
  157.         width: 100%;
  158.         height: 100%;
  159.         overflow: scroll;
  160.         background-color: rgb(0,0,0);
  161.         background-color: rgba(0,0,0,0.4);
  162.     }
  163.     .in_modal{
  164.         text-align: left;
  165.     }
  166.     .modal-content{
  167.         background-color: #fefefe;
  168.         margin: auto;
  169.         padding: 20px;
  170.         border: 1px solid #888;
  171.         width: 80%;
  172.     }
  173.     .close{
  174.         color: #aaaaaa;
  175.         float: right;
  176.         font-size: 28px;
  177.         font-weight: bold;
  178.     }
  179.     .close:hover,.close:focus{
  180.         color: #000;
  181.         text-decoration: none;
  182.         cursor: pointer;
  183.     }
  184.     option.feuerwehr{
  185.         background-color: rgb(255,0,0);
  186.     }
  187.     option.polizei{
  188.         background-color: rgb(0,255,0);
  189.     }
  190.     option.thw{
  191.         background-color: rgb(0,0,255);
  192.     }
  193. </style>
  194. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  195. </head>
  196. <body>
  197. <input class="btn btn btn-success" name="fill" value="Vorgefertigte Wählen" id="fill">
  198. <div id="myModal" class="modal">
  199.     <div class="modal-content">
  200.         <span class="close">&times;</span>
  201.         <p class="in_modal">Bitte gewünschte AAO wählen</p>
  202.         <p class="in_modal">
  203.             <select id="selection">
  204.                 <option class="feuerwehr" value="LFTLF1" id="LFTLF1">LF/TLF (1)</option>
  205.                 <option class="feuerwehr" value="LFTLF2" id="LFTLF2">LF/TLF (2)</option>
  206.                 <option class="feuerwehr" value="LFTLF4" id="LFTLF4">LF/TLF (4)</option>
  207.                 <option class="feuerwehr" value="LFTLF8" id="LFTLF8">LF/TLF (8)</option>
  208.                 <option class="feuerwehr" value="LFTLF16" id="LFTLF16">LF/TLF (16)</option>
  209.                 <option class="feuerwehr" value="LF1" id="LF1">LF (1)</option>
  210.                 <option class="feuerwehr" value="LF2" id="LF2">LF (2)</option>
  211.                 <option class="feuerwehr" value="LF4" id="LF4">LF (4)</option>
  212.                 <option class="feuerwehr" value="LF8" id="LF8">LF (8)</option>
  213.                 <option class="feuerwehr" value="LF16" id="LF16">LF (16)</option>
  214.                 <option class="feuerwehr" value="TLF1" id="TLF1">TLF (1)</option>
  215.                 <option class="feuerwehr" value="TLF2" id="TLF2">TLF (2)</option>
  216.                 <option class="feuerwehr" value="TLF4" id="TLF4">TLF (4)</option>
  217.                 <option class="feuerwehr" value="TLF8" id="TLF8">TLF (8)</option>
  218.                 <option class="feuerwehr" value="TLF16" id="TLF16">TLF (16)</option>
  219.                 <option class="polizei" value="Funkstreifenwagen1" id="Funkstreifenwagen1">Funkstreifenwagen (1)</option>
  220.                 <option class="polizei" value="Funkstreifenwagen2" id="Funkstreifenwagen2">Funkstreifenwagen (2)</option>
  221.                 <option class="polizei" value="Funkstreifenwagen4" id="Funkstreifenwagen4">Funkstreifenwagen (4)</option>
  222.                 <option class="polizei" value="Funkstreifenwagen8" id="Funkstreifenwagen8">Funkstreifenwagen (8)</option>
  223.                 <option class="polizei" value="Funkstreifenwagen16" id="Funkstreifenwagen16">Funkstreifenwagen (16)</option>
  224.             </select>
  225.             <input class="btn btn btn-success" name="show_selection" value="gewählte Fz anschauen" id="show_selection">
  226.         </p>
  227.         <div id="Ansicht"></div>
  228.         <p class="in_modal">
  229.             <input class="btn btn btn-success" name="fuellen" value="Eintragen" id="fuellen" style="visibility: hidden;">
  230.         </p>
  231.     </div>
  232. </div>
  233. <script>
  234.     try{
  235.         var modal = document.getElementById('myModal');
  236.         var btn_fill = document.getElementById("fill");
  237.         var span = document.getElementsByClassName("close")[0];
  238.         btn_fill.onclick = function(){
  239.             modal.style.display = "block";
  240.         };
  241.         span.onclick = function(){
  242.             modal.style.display = "none";
  243.         };
  244.         window.onclick = function(event){
  245.             if (event.target == modal){
  246.                 modal.style.display = "none";
  247.             }
  248.         };
  249.         var btn_show = document.getElementById("show_selection");
  250.         btn_show.onclick = function(){
  251.             var aao = document.getElementById("selection").value;
  252.             var hiorg = document.getElementById(aao).className;
  253.             var Fzs = "";
  254.             if (hiorg!="sonstige"){
  255.                 for (var i=0; i<countInObject(Fz); i++){
  256.                     if (aao.substr(0,Fz[i][0].length)==Fz[i][0]){
  257.                         Fzs+=Fz[i][1]+": "+aaos[hiorg][aao]+"<br>";
  258.                     }
  259.                 }
  260.             };
  261.             document.getElementById("Ansicht").innerHTML = Fzs;
  262.             document.getElementById("fuellen").style="visibility: visible;";
  263.         };
  264.         function countInObject(obj){
  265.             var count = 0;
  266.             for(var key in obj) if(obj.hasOwnProperty(key)) count++;return count;
  267.         };
  268.     }
  269.     catch(error){
  270.         console.log(error);
  271.     }
  272. </script>
  273. </body>
  274. </html>
  275. `);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement