Browse Source

* Pick 2 light first ui implementation

Giancarlo Voci 8 years ago
parent
commit
e2f74775a8
7 changed files with 48 additions and 19 deletions
  1. 0 0
      bundle.css
  2. 3 0
      config.ini
  3. 9 1
      index.php
  4. 10 5
      src/Modules/Pages.php
  5. 12 10
      ui/custom.css
  6. 1 1
      ui/homemenu.tpl
  7. 13 2
      ui/pick2light.tpl

File diff suppressed because it is too large
+ 0 - 0
bundle.css


+ 3 - 0
config.ini

@@ -1,4 +1,7 @@
 [globals]
+DB="mysql:host=localhost;port=3306;dbname=omlink_lamborghini"
+dbuser=root
+dbpass=giancarlo
 AUTOLOAD="src/"
 BASEURL = /lamborghini
 ;CACHE = "folder=cache/"

+ 9 - 1
index.php

@@ -13,10 +13,18 @@ $f3 = \Base::instance();
 
 $f3->config('config.ini', true);
 
+$f3->set('DB',
+  new \DB\SQL(
+    $f3->get('DB'),
+    $f3->get('dbuser'),
+    $f3->get('dbpass'),
+    array(\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_PERSISTENT => TRUE))
+);
+
 // Pages
 $f3->route('GET /', "Modules\Pages->Login", $f3->get('CACHE_TTL'));
 $f3->route('GET /homemenu', "Modules\Pages->HomeMenu", $f3->get('CACHE_TTL'));
-$f3->route('GET|POST /pick2light', "Modules\Pages->Pick2Light", $f3->get('CACHE_TTL'));
+$f3->route('GET|POST /pick2light/@step', "Modules\Pages->Pick2Light", $f3->get('CACHE_TTL'));
 $f3->route("GET|POST /bind/@step", 'Modules\Pages->Bind', $f3->get('CACHE_TTL'));
 $f3->route('GET /elencodistinta', "Modules\Pages->ElencoDistinta", $f3->get('CACHE_TTL'));
 

+ 10 - 5
src/Modules/Pages.php

@@ -25,12 +25,17 @@ class Pages extends BaseController
         echo \Template::instance()->render('masterpage.tpl');
     }
 
-    public function Pick2Light($f3)
+    public function Pick2Light(object $f3, array $args)
     {
-        if($f3->get('POST.pickedcode'))
-            $f3->set("INFOTEXT", "Step non ancora implementato");
-
-        $f3->set('CONTENT', 'pick2light.tpl');
+      switch ($args['step']) {
+        case 3:
+          $f3->set("INFOTEXT", "Aggancia l'etichetta elettronica al carrello e scannerizza il barcode");
+          break;
+      }
+
+      $f3->set('DISTINTE', $f3->Get('DB')->exec('SELECT DISTINCT commessa FROM distinte'));
+      $f3->set('STEP', $args['step']);
+      $f3->set('CONTENT', 'pick2light.tpl');
         echo \Template::instance()->render('masterpage.tpl');
     }
 

+ 12 - 10
ui/custom.css

@@ -1,34 +1,36 @@
 html,body {
     height: 100%;
 }
+
 body {
     background-color: #1c1c1c !important;
-    color: #ffd242;
+    color: #ffd242 !important;
 }
 
 input[type="text"], input[type="password"] {
     background-color: #484848 !important;
-    border-color: #C5AC0F;
+    border-color: #C5AC0F !important;
 }
 
 input[type="text"]:focus, input[type="password"]:focus {
-    border-color: #C5AC0F;
-    color: #ffd242;
-
+    border-color: #C5AC0F !important;
+    color: #ffd242 !important;
 }
+
 .form-control {
-    color: #ffd242;
+    background-color: #484848 !important;
+    color: #ffd242 !important;
 }
 
 .form-control:focus {
-    border-color: #c5ac0f;
-    box-shadow: 0 0 0 0.2rem rgba(197, 172, 15, 0.25);
+    border-color: #c5ac0f !important;
+    box-shadow: 0 0 0 0.2rem rgba(197, 172, 15, 0.25) !important;
 }
 
 .debugborder {
-    border: 1px solid red;
+    border: 1px solid red !important;
 }
 
 .bg-dark {
     background-color: #686f75 !important;
-}
+}

+ 1 - 1
ui/homemenu.tpl

@@ -11,7 +11,7 @@
                     <a href="{{@BASEURL}}/elencodistinta"><img class="img-fluid" src="ui/images/elenco_distinta.png"/></a>
                 </div>
                 <div class="col-md-2 m-3">
-                    <a href="{{@BASEURL}}/pick2light"><img class="img-fluid" src="ui/images/pick2light.png"/></a>
+                    <a href="{{@BASEURL}}/pick2light/1"><img class="img-fluid" src="ui/images/pick2light.png"/></a>
                 </div>
             </div>
             <div class="row justify-content-center">

+ 13 - 2
ui/pick2light.tpl

@@ -2,8 +2,19 @@
 
 <div class="row h-100 justify-content-center">
     <div class="col-md-5 align-self-center">
-        <form class="form" method="post" action="{{@BASEURL}}/pick2light">
-            <input type="text" name="pickedcode" class="form-control form-control-lg" placeholder="Pick to code" required autofocus autocomplete="false"/>
+        <form class="form" method="post" action="{{@BASEURL}}/pick2light/{{@STEP+1}}">
+            <input type="submit" hidden id="submitform"/>
+
+            <select class="form-control form-control-lg bg-secondary mb-3" onchange="javascript:{$('#submitform').click()}">
+                <option selected>Seleziona una distinta</option>
+                <repeat group="{{ @DISTINTE }}" value="{{ @DISTINTA }}">
+                    <option>{{@@DISTINTA.commessa}}</option>
+                </repeat>
+            </select>
+
+            <check if="{{ @STEP > 1}}">
+                <input type="text" name="pickedcode" class="form-control form-control-lg" placeholder="Pick to code" required autofocus autocomplete="false"/>
+            </check>
         </form>
         <check if="{{@INFOTEXT}}">
             <div class="alert alert-danger mt-5" role="alert">

Some files were not shown because too many files changed in this diff