<!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
	<meta charset="utf-8" />
    <title>MobiParc</title>
    <link rel="manifest" href="manifest.json">
    <meta name="viewport" content="width=device-width">
    <meta name="theme-color" content="#587b8c">
    <!--<link rel="icon" href="favicon.ico">--> 
    <!--<link rel="shortcut icon" href="favicon.ico">--> 
    <!--<link rel="apple-touch-icon" href="img/iphone-icon.png">-->
	<!--<style type="text/css">
        body.hidden{
        visibility:hidden;
        background-color:#E3EAED;
        background-repeat:no-repeat;
        background-position-x:50%;
        background-position-y:50%;
        background-image:url(img/loading.svg)
        }
    </style>-->
    <link rel="stylesheet" href="css/mobiparc.css" type="text/css" media="all">
    <noscript>
        <style type="text/css">body.nojs{visibility:visible;}</style>
    </noscript>
    <script src="js/jquery-3.2.1.min.js" defer></script>
    <script src="js/jquery-ui.min.js" defer></script>
    <!--https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.11/handlebars.min.js-->
    <script src="js/handlebars.min.js" defer></script>
    <script src="js/mobiparc.js" defer></script>
   
</head>
<body class="nojs">
    <header>
        <section>
            <ul>
                <li><span class="modal-open btn">&#8651;</span></li>
            </ul>
        </section>
           
        <section>
            <nav>
                <div>
                    <button aria-label="Ouvrir menu" class="bt-menu">
                        <svg viewBox="0 0 459 459" enable-background="new 0 0 459 459">
                            <path d="M0 382.5h459v-51h-459v51zm0-127.5h459v-51h-459v51zm0-178.5v51h459v-51h-459z"></path>
                        </svg>
                    </button>
                </div>
                <div>
                    <button aria-label="Fermer menu" class="bt-menu-close">
                        <svg viewBox="0 0 371.23 371.23" enable-background="new 0 0 371.23 371.23">
                            <path d="M371.23 21.213l-21.212-21.213-164.403 164.402-164.402-164.402-21.213 21.213 164.402 164.402-164.402 164.403 21.213 21.212 164.402-164.402 164.403 164.402 21.212-21.212-164.402-164.403z"></path>
                        </svg>
                    </button>
                </div>

                <div>
                    <a href="#activite">Activité</a>
                </div>
                <div>
                    <a href="#contacts">Contacts</a>
                </div>
                <div>
                    <a href="#parametres">Paramètres</a>
                </div>

            </nav>
        </section>
    </header>

    <section class="main">
        <noscript>
            <h1>Suivi mobile d'Activités</h1>
            Pour accéder à toutes les fonctionnalités de ce site, vous devez activer JavaScript. Voici les 
            <a href="//www.enable-javascript.com/fr/" target="js"> instructions pour activer JavaScript dans votre navigateur Web</a>
        </noscript>
    </section>

    <section class="footer-top">
        <pre class="results__display-wrapper"><code class="results-display"></code></pre>       
    </section>
        
    <footer>
        <!--<nav class="obs">
            <div><span class="modal-open">Alerte</span></div>
            <div></div>
        </nav>-->
        <span id="cRetour" class="cInvisible"></span>
    </footer>
    
    <section class="modal-background"></section>

    <section class="modal-content">
        <button class="data-sync" disabled>Sync</button>
        <div class="sync-result"></div>
        <br>
        <span class="modal-close">X</span>
    </section>

    <script id="activite" type="x-tmpl-mustache">
        <h1>Activité</h1>
        <h2>Nouvelle saisie</h2>

        <form class="data-form niveau" enctype="multipart/form-data">

            <h3>Activité</h3>

            <div class="input-group">
                <label class="label" for="dateint">Date: </label>
                <input class="input-text" id="dateint" name="date-int" type="date" title="Date de l'intervention'" required />
            </div>

            <div class="input-group">
                <label class="label" for="datefin">Date de fin: </label>
                <input class="input-text" id="datefin" name="date-fin" type="date" title="Date de fin de l'intervention'" />
            </div>

            <div class="input-group">
                <label class="label" for="localisation">Localisation: </label>
                <select class="input-select" id="localisation" name="localisation">
                    <option value="6703400">BERSTETT</option>
                    <option value="6711200">DUTTLENHEIM</option>
                </select>
            </div>

            <div class="input-group">
                <label class="label" for="engin">Engin: </label>
                <select class="input-select" id="engin" name="engin">
                    <option value="01P037">MINI PELLE CASE P037</option>
                    <option value="01P038">PELLE LIEBHERR P038 R313/2013</option>
                </select>
            </div>

            <div class="input-group">
                <label class="label" for="realisation">Réalisation: </label>
                <select class="input-select" id="realisation" name="realisation">
                    <option value="13">Pose d'enrochements</option>
                    <option value="16">Terrassement:déblais,remblais,tranchées</option>
                </select>
            </div>

            <div class="input-group">
                <label class="label" for="commentaire">Commentaire: </label>
                <input class="input-text" id="commentaire" name="commentaire" type="text" title="Commentaire" />
            </div>

            <h3>Heures supplémentaires</h3>

            <div class="input-group">
                <label class="label" for="hsjour">Jour (7h-7h30, 16h30-22h): </label>
                <input class="input-text" id="hsjour" name="hsjour" type="number" title="Heures sup. (jour)" />
            </div>

            <div class="input-group">
                <label class="label" for="hsnuit">Nuit: </label>
                <input class="input-text" id="hsnuit" name="hsnuit" type="number" title="Heures sup. (nuit)" />
            </div>

            <div class="input-group">
                <label class="label" for="hsdim">Dimanche et jours fériés: </label>
                <input class="input-text" id="hsdim" name="hsdim" type="number" title="Heures sup. (dimanche et jours feriés)" />
            </div>

            <h3>Frais</h3>

            <div class="input-group">
                <label class="label" for="nbrepas">Nombre de repas: </label>
                <input class="input-text" id="nbrepas" name="nbrepas" type="number" title="Nombre de repas" />
            </div>

            <div class="input-group">
                <label class="label" for="depart">Départ: </label>
                <select class="input-select" id="depart" name="depart">
                    <option value="6703400">BERSTETT</option>
                    <option value="6711200">DUTTLENHEIM</option>
                </select>
            </div>

            <div class="input-group">
                <label class="label" for="kmstt">Kilomètres sur temps de travail (7h30 - 16h30): </label>
                <input class="input-text" id="kmstt" name="kmstt" type="number" title="Kilomètres sur temps de travail" />
            </div>

            <div class="input-group">
                <label class="label" for="vpstt">Avec véhicule personnel</label>
                <input class="input-text" id="vpstt" name="vpstt" type="checkbox" title="Avec véhicule personnel" />
            </div>

            <div class="input-group">
                <label class="label" for="kmhtt">Kilomètres hors temps de travail : </label>
                <input class="input-text" id="kmhtt" name="kmhtt" type="number" title="Kilomètres hors temps de travail" />
            </div>

            <div class="input-group">
                <label class="label" for="vphtt">Avec véhicule personnel</label>
                <input class="input-text" id="vphtt" name="vphtt" type="checkbox" title="Avec véhicule personnel" />
            </div>

            <button class="button-submit btn btn-save" type="submit">Enregistrer</button>
        </form>


        {{#if data}}
        <button class="del btn btn-delete" disabled>Supprimer</button>

        <h2>Les données</h2>
        <table class="selectable">
            <thead>
                <tr><td>Camp</td><td>date</td><td>niv</td><td>pt</td></tr>
            </thead>
            <tbody>
                {{#data}}
                <tr data-id="{{tstamp}}" data-type="niveaux"><td>{{campaign}}</td><td>{{#todate}}{{tstamp}}{{/todate}}</td><td>{{level}}</td><td>{{point}}</td></tr>
                {{/data}}
            </tbody>
        </table>
        {{/if}}

    </script>

    <section class="modal-content-1" style="display:none">
        <form class="contact" enctype="multipart/form-data">
            <h2>Contact</h2>
            <aside>
                <input name="title" required placeholder="titre du message" type="text"><br>
                <input name="email" required placeholder="votre email message" type="email"><br>
                <textarea name="message" placeholder="votre message"></textarea><br>
                <input type="file" required id="imgfile" name="img" accept="image/*"><br>
                <input name="lat" id="input-lat" type="hidden"><input id="input-lng" name="lng" type="hidden">
                <button type="button" class="send-message">Envoyer</button>
            </aside>
            <span class="send-result"></span>
            <br>
            <span class="modal-close">X</span>
        </form>
    </section>
    
    <script id="parametres" type="x-tmpl-mustache">
        <h1>Paramètres</h1>
        <form class="data-form param" enctype="multipart/form-data">
            <div class="input-group">
                <label class="label" for="year_week">Campagne</label>
                <input class="input-text" id="year_week" name="year_week" type="text" />
            </div>

            <div class="input-group">
                <label class="label" for="user">Utilisateur</label>
                <select class="input-select" id="user" name="user">
                    <option value="2">Clément VIX</option>
                    <option value="4">Luc TIRARD</option>
                    <option value="6">Freddy SITTLER</option>
                </select>
            </div>

            <div class="input-group">
                <label class="label" for="start">Heure de début d'astreinte</label>
                <input class="input-text" id="start" name="start" type="text" pattern="^(1?[0-9]|2[0-3]):[0-5][0-9]$" title="HH:MM" required/>
            </div>

            <div class="input-group">
                <label class="label" for="end">Heure de fin d'astreinte</label>
                <input class="input-text" id="end" name="end" type="text" pattern="^(1?[0-9]|2[0-3]):[0-5][0-9]$" title="HH:MM" required/>
            </div>
            <button class="button-submit btn btn-save" type="submit">Sauvegarder</button>
        </form>
    </script>

    <script id="anomalies" type="x-tmpl-mustache">
        <h1>Anomalie</h1>
        <h2>Créer un enregistrement</h2>

        <form class="data-form anomalie" enctype="multipart/form-data">
            <div class="input-group">
                <label class="label" for="type">Type</label>
                <select id="type" name="type">
                    <option value="1">Obstacle à l'écoulement</option>,
                    <option value="2">Obstacle au passage sur le domaine</option>,
                    <option value="3">Dégradation ouvrage</option>,
                    <option value="4">Dégradation hors ouvrage</option>,
                    <option value="5">Occupation illicite du Domaine</option>,
                    <option value="6">Autre</option>
                </select>
            </div>
            <div class="input-group">
                <label class="label" for="desc">Description</label>
                <textarea id="desc" name="desc" rows="6" required></textarea>
                <input type="hidden" id="coordinates" name="coordinates" required>
            </div>
            <div class="input-group-img">
            <div class="input-group img-group" id="img-group">
                <label class="label" for="imgfile">Photo</label>
                <input class="input-file input-file-img btn" type="file" name="img" accept="image/*" capture><br>
                <input type="hidden" name="imgdata" class="hidden-file-img" value="">
                <img src="#" class="img-preview" width="128" />
                <button class="file-del btn btn-delete">Supprimer</button>
            </div>
          
           </div>
            <div>
                <button class="btn btn-duplicate btn-img">Ajouter une image</button>
            </div>

            <button class="button-submit btn btn-save" type="submit">Sauvegarder</button>
        </form>

        <h2>Les données</h2>
        {{#if data}}
        <button class="del btn btn-delete" disabled>Supprimer</button>

        <table class="selectable">
            <thead>
                <tr><td>date</td><td>type</td><td>desc</td></tr>
            </thead>
            <tbody>
                {{#data}}
                <tr data-id="{{tstamp}}" data-type="anomalies"><td>{{#todate}}{{tstamp}}{{/todate}}</td><td>{{type}}</td><td>{{desc}}</td></tr>
                {{/data}}
            </tbody>
        </table>
        {{/if}}

    </script>

    <script id="index" type="x-tmpl-mustache">
        <h1>Canal de la Bruche</h1>
      
        <div class="home-pp">
            <a href="#anomalies">
                <div>


                    <picture>
                        <source type="image/svg+xml" srcset="img/alert.svg" media="(min-width:240px)">
                        <img src="img/alert.png" width="224" alt="" />
                    </picture><h3>
                        Anomalies
                    </h3>

                </div>
            </a>
            <a href="#vannes">
                <div>


                    <picture>
                        <source type="image/svg+xml" srcset="img/valve.svg" media="(min-width:240px)">
                        <img src="img/valve.png" width="224" alt="" />
                    </picture><h3>
                        Vannes
                    </h3>

                </div>
            </a>
            <a href="#niveaux">
                <div>


                    <picture>
                        <source type="image/svg+xml" srcset="img/levels.svg" media="(min-width:240px)">
                        <img src="img/levels.png" width="224" alt="" />
                    </picture><h3>
                        Niveaux
                    </h3>

                </div>
            </a>

        </div>
        <div class="home-pp">
            <a href="#contacts">
                <div>

                    <picture>
                        <source type="image/svg+xml" srcset="img/add-contact.svg" media="(min-width:240px)">
                        <img src="img/add-contact.png" width="224" alt="" />
                    </picture>
                    <h3>
                        Contacts
                    </h3>



                </div>
            </a>

            <a href="#interventions">
                <div>

                    <picture>
                        <source type="image/svg+xml" srcset="img/intervention.svg" media="(min-width:240px)">
                        <img src="img/intervention.png" width="224" alt="" />
                    </picture>
                    <h3>
                        Interventions
                    </h3>



                </div>
            </a>

            <a href="#parametres">
                <div>

                    <picture>
                        <source type="image/svg+xml" srcset="img/high-voltage.svg" media="(min-width:240px)">
                        <img src="img/high-voltage.png" width="224" alt="" />
                    </picture>
                    <h3>
                        Paramètres
                    </h3>



                </div>
            </a>


        </div>
    </script>

    <script id="interventions" type="x-tmpl-mustache">
        <h1>Interventions</h1>
       
        {{#if contact}}
        <select class="select-contact">
            <option>Sélection du contact à avertir</option>
            {{#contact}}
            {{#if mobile}}
            {{#if_eq mobile}}
            <option value="{{phone}}" selected>{{name}} {{firstname}}</option>
            {{else}}
            <option value="{{phone}}">{{name}} {{firstname}}</option>
            {{/if_eq}}
            {{/if}}
            {{/contact}}

        </select>
        {{/if}}
       
        {{#if intervention}}
        <div>
           
                <a href="sms:{{intervention}}?body=début d'intervention" data-ng-message="début d'intervention" class="intervention-start btn" data-type="start">Début</>
                <a href="sms:{{intervention}}?body=fin d'intervention" data-ng-message="fin d'intervention" class="intervention-end btn" data-type="end">Fin</a>
        </div>
        {{/if}}
    </script>

    <script id="contacts" type="x-tmpl-mustache">
        <h1>Contacts</h1>
        {{#if contact}}
        <ul class="list-contact">
            {{#contact}}
            <li>
                {{#if email}}
                <a href="mailto:{{email}}?subject=De canalplus" class="btn">&#9993;</a>
                {{/if}}
                <a href="tel:{{phone}}" class="btn">&#x260E;</a>
                {{#if mobile}}
                <a href="sms:{{phone}}?body=De canalplus" class="btn">&#128489;</a>
                {{/if}}
                {{name}} {{firstname}}
            </li>
            {{/contact}}
        </ul>
        {{/if}}
       
    </script>

        <script id="vannes" type="x-tmpl-mustache">
            <h1>Vannes</h1>
            <h2>Créer un enregistrement</h2>
            <form class="data-form vanne" enctype="multipart/form-data">
                <div class="input-group">

                    <label class="label" for="point">Ouvrage</label>
                    <select class="input-select" id="point" name="point">
                        <option value="PA1">PA1</option>
                        <option value="AD">AD</option>
                    </select>
                </div>
                <div class="input-group">

                    <label class="label" for="valve">Ouvrage</label>
                    <select class="input-select" id="valve" name="valve">
                        <option value="Ouverture vanne alimentation">Ouverture vanne alimentation</option>
                        <option value="Ouverture vanne 1">Ouverture vanne 1</option>
                        <option value="Ouverture vanne 2">Ouverture vanne 2</option>
                        <option value="Ouverture vanne 3">Ouverture vanne 3</option>
                    </select>
                </div>

                <div class="input-group">
                    <label class="label" for="level">Niveau</label>
                    <input class="input-text" id="level" name="level" type="number" title="doit être un numérique" required />
                </div>
                <button class="button-submit btn btn-save" type="submit">Sauvegarder</button>
            </form>
            <h2>Les données</h2>
            {{#if data}}
            <button class="del btn btn-delete" disabled>Supprimer</button>
            <table class="selectable">
                <thead>
                    <tr><td>camp</td><td>date</td><td>niv</td><td>pt</td><td>vanne</td></tr>
                </thead>
                <tbody>
                    {{#data}}
                    <tr data-id="{{tstamp}}" data-type="vannes"><td>{{campaign}}</td><td>{{#todate}}{{tstamp}}{{/todate}}</td><td>{{level}}</td><td>{{point}}</td><td>{{valve}}</td></tr>
                    {{/data}}
                </tbody>
            </tableclass="selectable">
            {{/if}}


        </script>
</body>
</html>