v20201120
authorKilian Saffran <ksaffran@dks.lu>
Fri, 20 Nov 2020 07:03:44 +0000 (08:03 +0100)
committerKilian Saffran <ksaffran@dks.lu>
Fri, 20 Nov 2020 07:03:44 +0000 (08:03 +0100)
14 files changed:
website/css/site.css [new file with mode: 0644]
website/css/style.css [deleted file]
website/db.php
website/js/gallery.js
website/js/myapp.js
website/lib/modules/Gallery.php
website/lib/modules/WebArticles.php [new file with mode: 0644]
website/tmpl/blocks/salon.html.mustache [new file with mode: 0644]
website/tmpl/index.html.mustache
website/tmpl/pages/events.html.json
website/tmpl/pages/gallery.html.mustache
website/tmpl/pages/index.html.mustache
website/tmpl/pages/salon.html.mustache [new file with mode: 0644]
website/tmpl/pages/shop.html.mustache

diff --git a/website/css/site.css b/website/css/site.css
new file mode 100644 (file)
index 0000000..5dfa760
--- /dev/null
@@ -0,0 +1,9 @@
+.galleryimg {
+  width: 100%;
+}
+
+.galleryitem {
+  padding-left: 2px;
+  padding-right: 2px;
+}
+
diff --git a/website/css/style.css b/website/css/style.css
deleted file mode 100644 (file)
index 0a029b4..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* body {
-  font-family: sans-serif;
-} */
-
-/* Make content area fill the entire browser window */
-/* html,
-.fullscreen {
-  display: flex;
-  height: 100%;
-  margin: 0;
-  padding: 0;
-  width: 100%;
-} */
-
-/* Center the content in the browser window
-.container {
-  margin: auto;
-  text-align: center;
-}
-
-.title {
-  font-size: 3rem;
-} */
index 8d2fd58..c95c59c 100644 (file)
@@ -2,7 +2,9 @@
    require("lib/config.php");
    require("lib/database.php");
    require("lib/modules/RendezVous.php");
-
+   require("lib/modules/Gallery.php");
+   require("lib/modules/Shop.php");
+   require("lib/modules/WebPage.php");
    $db = new database($cfg["db"]);
    $vars = array();
    $html = array();
         $html["data"] = $rdv->getRDVDayFreeTimes($db->securetext($params->{daydate}));
       }
     } elseif (strpos($params["get"], 'gallery_') === 0){
-
+      $gal = new Gallery($db);
+      if ($params["get"] == 'gallery_gallery'){
+        $html["data"] = $gal->getGallery($params->{name});
+      } elseif ($params["get"] == 'gallery_galleries'){
+        $html["data"] = $gal->getGalleries($params->{names});
+      } elseif ($params["get"] == 'gallery_galleryitems'){
+        $html["data"] = $gal->getGalleryItems($params->{name});
+      }
     } elseif (strpos($params["get"], 'shop_') === 0){
-      
-    }  
+      $shop = new Shop($db);
+    } elseif (strpos($params["get"], 'page_') === 0){
+      $shop = new WebPage($db);
+    } 
 
   } elseif (isset($params["fn"])){
     if (strpos($params["fn"], 'rdv_') === 0) {
 
       }elseif ($params["fn"] == 'rdv_cancel'){
         
+      }
+    } else (strpos($params["fn"], 'shop_') === 0) {
+      $shop = new Shop($db);
+      if ($params["fn"] == 'shop_order'){
+
       }
     }
 
index fb3bd67..8757d1b 100644 (file)
@@ -1,7 +1,22 @@
 function initpage(){
-  
+  gallery.init(myapp.getSearchParams());
 }
 
 let gallery = {
+  init: function(p){
+    if (p["name"]){
+      gallery.getgallery(p["name"]);
+      gallery.getgalleryitems(p["name"]);
+    }
+  },
+  getgallery: function(name){
+    postData({"get":"gallery_data","link":name}).then(gd => {
 
+    });
+  },
+  getgalleryitems: function(name){
+    postData({"get":"gallery_items","link":name}).then(items => {
+
+    });
+  }
 }
\ No newline at end of file
index 4eb5749..08c96e8 100644 (file)
@@ -76,6 +76,11 @@ let myapp={
     document.getElementById('dlgmessage_text').innerHTML=message;
     document.getElementById('dlgmessage').style.display='block';
     return false;
+  },
+  getSearchParams:function(k){
+    var p={};
+    location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(s,k,v){p[k]=v});
+    return k?p[k]:p;
   }
 }
 
index f602ed7..9e50806 100644 (file)
@@ -5,12 +5,22 @@
       $this->dbh = $dblink;
     }
 
-    public function getGallery($gid){
-      
+    public function getGalleries($glinks){
+      $gsearch = null;
+      $cdate = $startdate = date("Y-m-d");
+      $sql = "select gallery, description, link, picture from galleries where (publishdate is null or date('".$cdate."') between publishdate and unpublishdate )";
+      if (($glinks !== null) && count($glinks) > 0){
+        $sql .= " and link in (".join("'".$glinks."'",',').")";
+      }
+      return $this->dbh->queryarray($sql);
     }
 
-    public function getGalleryItems($idg){
+    public function getGallery($gallerylink){
+      return $this->dbh->query("select gallery, description, link, picture from galleries where link='".$gallerylink."'");
+    }
 
+    public function getGalleryItems($gallerylink){
+      return $this->dbh->querryarray("select gg.link as gallerylink,gi.filename, gi.filetype, gi.link, gi.linktype, gi.description from galleryitems gi join galleries gg on (gi.id_galleries=gg.id) where gg.link='".$gallerylink."'");
     }
 
     public function __destruct(){
diff --git a/website/lib/modules/WebArticles.php b/website/lib/modules/WebArticles.php
new file mode 100644 (file)
index 0000000..e80e3ce
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+  class WebArticles {
+    private $dbh;
+    public function __construct($dblink){
+      $this->dbh = $dblink;
+    }
+
+    public function getSection($idsection){
+      
+    }
+
+    public function getSections($idsections){
+      
+    }
+
+    public function getSectionArticles($idsection){
+
+    }
+
+    public function getArticle($idsection,$idarticle){
+
+    }
+
+    public function __destruct(){
+      $this->dbh = null;
+    }
+  }
+?>
\ No newline at end of file
diff --git a/website/tmpl/blocks/salon.html.mustache b/website/tmpl/blocks/salon.html.mustache
new file mode 100644 (file)
index 0000000..da38431
--- /dev/null
@@ -0,0 +1,20 @@
+<div class="container margin">
+<h2>Adresse</h2>
+<p>
+34, rue du Fossé<br/>
+L-4123 Esch-sur-Alzette<br/><br/>
+Phone: <a href="tel:0035226532264">+352 2653 2264</a><br/>
+E-mail: <a href="mailto:info@oldbell.lu">info@oldbell.lu</a></p>
+</div>
+<div class="container margin">
+<h2>Heure d'ouverture</h2>
+<p>Mardi 8h00 - 18h00<br/>
+Mercredi 8h00 - 18h00<br/>
+Jeudi 8h00 - 18h00<br/>
+Vendredi 8h00 - 20h30<br/>
+Samedi 8h00 - 15h00<br/>
+Fermé le dimanche</p>
+</div>
+<div class="container margin">
+<div style="overflow:hidden;width: 400px;position: relative;"><iframe width="400" height="200" src="https://maps.google.com/maps?width=200&amp;height=200&amp;hl=fr&amp;q=34,rue%20du%20fosse+4132+Esch-sur-Alzette&amp;ie=UTF8&amp;t=&amp;z=13&amp;iwloc=B&amp;output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe><style>#gmap_canvas img{max-width:none!important;background:none!important}</style></div>
+</div>
\ No newline at end of file
index 1621808..2bfc726 100644 (file)
 <meta name="theme-color" content="#c42027">
 <link rel="stylesheet" href="js/vendor/tabulator/css/tabulator_site.css?v=1" />
 <link rel="stylesheet" href="js/vendor/photoswipe/photoswipe.css?v=1" />
+<link rel="stylesheet" href="js/vendor/photoswipe/default-skin.css?v=1">
 <link  rel="stylesheet" href="css/icons.css?v=1">
 <link  rel="stylesheet" href="css/theme.css?v=1">
+<link  rel="stylesheet" href="css/site.css?v=1">
+
   </head>
   <body class="fullscreen">
     <div class="display-container" style="width: 100vw; overflow-y: hidden;">
@@ -41,6 +44,7 @@
   <script src="js/vendor/tabulator/js/tabulator.js" type="text/javascript"></script>
   <script src="js/vendor/moment/moment-with-locales.min.js" type="text/javascript"></script>
   <script src="js/vendor/photoswipe/photoswipe.min.js" type="text/javascript"></script>
+  <script src="js/vendor/photoswipe/photoswipe-ui-default.min.js"></script>
   <script src="js/myapp.js" type="text/javascript"></script>
   <script src="js/request.js" type="text/javascript"></script>
 </body>
index 3e1694b..138400a 100644 (file)
@@ -1,4 +1,4 @@
 {
   "dayscol1":{"sqltype":"queryarray","sql":"SELECT id, to_char(daydate,'DD.MM.YYYY') as daydate, calendar, calgroup, calpublisstart, calpublishend, to_char(calstartime,'HH24:MI') as calstarttime, to_char(calendtime,'HH24:MI') as calendtime, caltitle, caldescription, callocation, callocationaddress FROM calendar WHERE calendar=(select prefvalue from config where pref='season') and calgroup='aller' order by daydate asc;"},
-  "dayscol2":{"sqltype":"queryarray","sql":"SELECT id, to_char(daydate,'DD.MM.YYYY') as daydate, calendar, calgroup, calpublisstart, calpublishend, to_char(calstartime,'HH24:MI') as calstarttime, to_char(calendtime,'HH24:MI') as calendtime, caltitle, caldescription, callocation, callocationaddress FROM calendar WHERE calendar=(select prefvalue from config where pref='season') and calgroup='retoour' order by daydate asc;"}
+  "dayscol2":{"sqltype":"queryarray","sql":"SELECT id, to_char(daydate,'DD.MM.YYYY') as daydate, calendar, calgroup, calpublisstart, calpublishend, to_char(calstartime,'HH24:MI') as calstarttime, to_char(calendtime,'HH24:MI') as calendtime, caltitle, caldescription, callocation, callocationaddress FROM calendar WHERE calendar=(select prefvalue from config where pref='season') and calgroup='retour' order by daydate asc;"}
 }
index 1ee9acb..2aa3933 100644 (file)
@@ -1,73 +1,96 @@
 <div class="top">
-      <div class="bar red-gold">
-        <a class="bar-item button red-gold" href="index.html"><span class="icon-arrow-left2" style="font-size: 30px;"></span><br/>retour</a>
+      <div class="bar red-white">
+        <a class="bar-item button red-white" href="index.html"><span class="icon-arrow-left2" style="font-size: 30px;"></span><br/>retour</a>
         <div class="bar-item">
-          <span class="large text-white">Gname{{ galleriename }}</span><br/>
+          <span class="large text-white" id="gallery_name">{{ gallery_name }}</span><br/>
           <span>Gallerie</span>
           
         </div>
       </div>
     </div>
-    <div class="main" style="margin-top: 70px; margin-bottom: 70px;">
+    <div class="main" style="margin-top: 66px; background-color: #000; height: calc(100vh - 68px); overflow-y: scroll;">
 
-    
-<div class="row">
-  <div class="col s4 padding">
-    <a href="#"><img src="img/thumb.jpg" style="width: 100%; border: 4px solid black; border-radius: 5px;"/>
-    <label class="label">Gallery</label></a>
+<div class="row" style="background-color: #000;padding-top: 5px;">
+  <div class="text-white col s12" id="gallery_description" style="padding-bottom: 10px;" >
+    {{ gallery_description }}
   </div>
-  <div class="col s4 padding">
-    <a href="#"><img src="img/thumb.jpg" style="width: 100%; border: 4px solid black; border-radius: 5px;"/>
-    <label class="label">Gallery</label></a>
-  </div>
-  <div class="col s4 padding">
-    <a href="#"><img src="img/thumb.jpg" style="width: 100%; border: 4px solid black; border-radius: 5px;"/>
-    <label class="label">Gallery</label></a>
-  </div>
-  <div class="col s4 padding">
-    <a href="#"><img src="img/thumb.jpg" style="width: 100%; border: 4px solid black; border-radius: 5px;"/>
-    <label class="label">Gallery</label></a>
-  </div>
-  <div class="col s4 padding">
-    <a href="#"><img src="img/thumb.jpg" style="width: 100%; border: 4px solid black; border-radius: 5px;"/>
-    <label class="label">Gallery</label></a>
-  </div>
-  <div class="col s4 padding">
-    <a href="#"><img src="img/thumb.jpg" style="width: 100%; border: 4px solid black; border-radius: 5px;"/>
-    <label class="label">Gallery</label></a>
-  </div>
-  <div class="col s4 padding">
-    <a href="#"><img src="img/thumb.jpg" style="width: 100%; border: 4px solid black; border-radius: 5px;"/>
-    <label class="label">Gallery</label></a>
-  </div>
-  <div class="col s4 padding">
-    <a href="#"><img src="img/thumb.jpg" style="width: 100%; border: 4px solid black; border-radius: 5px;"/>
-    <label class="label">Gallery</label></a>
-  </div>
-  <div class="col s4 padding">
-    <a href="#"><img src="img/thumb.jpg" style="width: 100%; border: 4px solid black; border-radius: 5px;"/>
-    <label class="label">Gallery</label></a>
-  </div>
-  <div class="col s4 padding">
-    <a href="#"><img src="img/thumb.jpg" style="width: 100%; border: 4px solid black; border-radius: 5px;"/>
-    <label class="label">Gallery</label></a>
-  </div>
-  <div class="col s4 padding">
-    <a href="#"><img src="img/thumb.jpg" style="width: 100%; border: 4px solid black; border-radius: 5px;"/>
-    <label class="label">Gallery</label></a>
-  </div>
-  <div class="col s4 padding">
-    <a href="#"><img src="img/thumb.jpg" style="width: 100%; border: 4px solid black; border-radius: 5px;"/>
-    <label class="label">Gallery</label></a>
-  </div>
-  <div class="col s4 padding">
-    <a href="#"><img src="img/thumb.jpg" style="width: 100%; border: 4px solid black; border-radius: 5px;"/>
-    <label class="label">Gallery</label></a>
-  </div>
-  <div class="col s4 padding">
-    <a href="#"><img src="img/thumb.jpg" style="width: 100%; border: 4px solid black; border-radius: 5px;"/>
-    <label class="label">Gallery</label></a>
+</div>    
+<div class="row" id="gallery_items" style="background-color: #000;padding-top: 5px;">
+  
+  {{#gallery_items }}
+  <div class="galleryitem col s4">
+    <a href="#"><img class="galleryimg" src="img/thumb.jpg"/>
+    </a>
   </div>
+  {{/gallery_items }}
+
+</div>
 </div>
+<!-- Root element of PhotoSwipe. Must have class pswp. -->
+<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
+
+    <!-- Background of PhotoSwipe. 
+         It's a separate element as animating opacity is faster than rgba(). -->
+    <div class="pswp__bg"></div>
+
+    <!-- Slides wrapper with overflow:hidden. -->
+    <div class="pswp__scroll-wrap">
+
+        <!-- Container that holds slides. 
+            PhotoSwipe keeps only 3 of them in the DOM to save memory.
+            Don't modify these 3 pswp__item elements, data is added later on. -->
+        <div class="pswp__container">
+            <div class="pswp__item"></div>
+            <div class="pswp__item"></div>
+            <div class="pswp__item"></div>
+        </div>
+
+        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
+        <div class="pswp__ui pswp__ui--hidden">
+
+            <div class="pswp__top-bar">
+
+                <!--  Controls are self-explanatory. Order can be changed. -->
+
+                <div class="pswp__counter"></div>
+
+                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
+
+                <button class="pswp__button pswp__button--share" title="Share"></button>
+
+                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
+
+                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
+
+                <!-- Preloader demo https://codepen.io/dimsemenov/pen/yyBWoR -->
+                <!-- element will get class pswp__preloader--active when preloader is running -->
+                <div class="pswp__preloader">
+                    <div class="pswp__preloader__icn">
+                      <div class="pswp__preloader__cut">
+                        <div class="pswp__preloader__donut"></div>
+                      </div>
+                    </div>
+                </div>
+            </div>
+
+            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
+                <div class="pswp__share-tooltip"></div> 
+            </div>
+
+            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
+            </button>
+
+            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
+            </button>
+
+            <div class="pswp__caption">
+                <div class="pswp__caption__center"></div>
+            </div>
+
+        </div>
+
+    </div>
+
 </div>
+<!-- Photoswipe -->
 <script src="js/gallery.js" type="text/javascript"></script>
\ No newline at end of file
index 73fd40d..38b8f50 100644 (file)
@@ -77,9 +77,9 @@
       <div class="bottom">
       <div class="bar red-white">
         <a class="bar-item add-button">installer App</button>
-        <a class="bar-item button"><span class="icon-map2" style="font-size: 40px;"></span><br/>Salon</a>
-        <a class="bar-item button right"><span class="icon-facebook2" style="font-size: 45px;"></span></a>
-        <a class="bar-item button right"><span class="icon-instagram" style="font-size: 45px;"></span></a>
+        <a class="bar-item button" href="salon.html"><span class="icon-map2" style="font-size: 40px;"></span><br/>Salon</a>
+        <a class="bar-item button right"><span class="icon-facebook2" style="font-size: 40px;"></span><br/>instagram</a>
+        <a class="bar-item button right"><span class="icon-instagram" style="font-size: 40px;"></span><br/>facebook</a>
       </div>
     </div>
 
diff --git a/website/tmpl/pages/salon.html.mustache b/website/tmpl/pages/salon.html.mustache
new file mode 100644 (file)
index 0000000..19b7280
--- /dev/null
@@ -0,0 +1,11 @@
+<div class="top">
+      <div class="bar red-gold">
+        <a class="bar-item button red-white" href="index.html"><span class="icon-arrow-left2" style="font-size: 30px;"></span><br/>retour</a>
+        <div class="bar-item">
+          <span class="large text-white">Salon</span><br/>        
+        </div>
+      </div>
+    </div>
+<div class="display-container" style="margin-top: 70px; overflow-y: scroll;">
+{{> salon.html.mustache }}
+</div>
\ No newline at end of file
index 798c3ab..131e51b 100644 (file)
@@ -1,6 +1,16 @@
-<div class="bar red-gold">
-  <div class="bar-item PageHeadTitle">SHOP</div>
-</div>
+<div class="top">
+      <div class="bar red-gold">
+        <a class="bar-item button red-gold" href="index.html"><span class="icon-arrow-left2" style="font-size: 30px;"></span><br/>retour</a>
+        <div class="bar-item">
+          <span class="large text-white">Shop</span><br/>
+        </div>
+      </div>
+    </div>
+    <div class="main" style="margin-top: 70px; margin-bottom: 70px;">
+
+    
 <div class="row">
   
-</div>
\ No newline at end of file
+</div>
+</div>
+<script src="js/shop.js" type="text/javascript"></script>
\ No newline at end of file