Browse Source

Start adding online store order management tools

master
Skylar Ittner 7 months ago
parent
commit
285e6ed196
5 changed files with 110 additions and 1 deletions
  1. BIN
      database.mwb
  2. 2
    1
      lang/en_us.php
  3. 13
    0
      pages.php
  4. 57
    0
      pages/onlinesales.php
  5. 38
    0
      static/js/onlinesales.js

BIN
database.mwb View File


+ 2
- 1
lang/en_us.php View File

@@ -139,5 +139,6 @@ define("STRINGS", [
139 139
     "open drawer" => "Open Drawer",
140 140
     "no items" => "No items in transaction.",
141 141
     "delete transaction" => "Delete transaction",
142
-    "transaction discount" => "Transaction discount"
142
+    "transaction discount" => "Transaction discount",
143
+    "Online Sales" => "Online Sales",
143 144
 ]);

+ 13
- 0
pages.php View File

@@ -35,6 +35,19 @@ define("PAGES", [
35 35
             "static/js/pos.js",
36 36
         ]
37 37
     ],
38
+    "onlinesales" => [
39
+        "title" => "Online Sales",
40
+        "navbar" => true,
41
+        "icon" => "fas fa-box",
42
+        "styles" => [
43
+            "static/css/datatables.min.css",
44
+            "static/css/tables.css"
45
+        ],
46
+        "scripts" => [
47
+            "static/js/datatables.min.js",
48
+            "static/js/onlinesales.js"
49
+        ],
50
+    ],
38 51
     "customers" => [
39 52
         "title" => "customers",
40 53
         "navbar" => true,

+ 57
- 0
pages/onlinesales.php View File

@@ -0,0 +1,57 @@
1
+<?php
2
+/*
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
7
+
8
+require_once __DIR__ . "/../required.php";
9
+
10
+redirectIfNotLoggedIn();
11
+
12
+$unshipped = $database->select('transactions', ['[>]customers' => 'customerid'], ['txid (id)', 'txdate', 'shipped', 'trackingnumber', 'customers.customerid', 'customers.name', 'customers.email', 'customers.phone', 'customers.address', 'customers.notes'], ['AND' => ['type' => 3, 'shipped' => null]]);
13
+?>
14
+
15
+<table id="ordertable" class="table table-bordered table-hover table-sm">
16
+    <thead>
17
+        <tr>
18
+            <th data-priority="0"></th>
19
+            <th data-priority="1"><?php lang('actions'); ?></th>
20
+            <th data-priority="1"><i class="fas fa-fw fa-user d-none d-md-inline"></i> <?php lang('name'); ?></th>
21
+            <th data-priority="2"><i class="fas fa-fw fa-phone d-none d-md-inline"></i> <?php lang('phone'); ?></th>
22
+            <th data-priority="3"><i class="fas fa-fw fa-at d-none d-md-inline"></i> <?php lang('email'); ?></th>
23
+            <th data-priority="4"><i class="fas fa-fw fa-map-marker d-none d-md-inline"></i> <?php lang('address'); ?></th>
24
+            <th data-priority="5"><i class="fas fa-fw fa-sticky-note d-none d-md-inline"></i> <?php lang('notes'); ?></th>
25
+        </tr>
26
+    </thead>
27
+    <tbody>
28
+        <?php
29
+        foreach ($unshipped as $o) {
30
+            ?>
31
+            <tr>
32
+                <td></td>
33
+                <td>
34
+                    <a class="btn btn-primary btn-sm" href="app.php?page=editcustomer&id=<?php echo $c['id']; ?>"><i class="fas fa-edit"></i> <?php lang("edit"); ?></a>
35
+                </td>
36
+                <td><?php echo $o['name']; ?></td>
37
+                <td><?php echo $o['phone']; ?></td>
38
+                <td><?php echo $o['email']; ?></td>
39
+                <td><?php echo $o['address']; ?></td>
40
+                <td><?php echo $o['notes']; ?></td>
41
+            </tr>
42
+            <?php
43
+        }
44
+        ?>
45
+    </tbody>
46
+    <tfoot>
47
+        <tr>
48
+            <th data-priority="0"></th>
49
+            <th data-priority="1"><?php lang('actions'); ?></th>
50
+            <th data-priority="1"><i class="fas fa-fw fa-user d-none d-md-inline"></i> <?php lang('name'); ?></th>
51
+            <th data-priority="2"><i class="fas fa-fw fa-phone d-none d-md-inline"></i> <?php lang('phone'); ?></th>
52
+            <th data-priority="3"><i class="fas fa-fw fa-at d-none d-md-inline"></i> <?php lang('email'); ?></th>
53
+            <th data-priority="4"><i class="fas fa-fw fa-map-marker d-none d-md-inline"></i> <?php lang('address'); ?></th>
54
+            <th data-priority="5"><i class="fas fa-fw fa-sticky-note d-none d-md-inline"></i> <?php lang('notes'); ?></th>
55
+        </tr>
56
+    </tfoot>
57
+</table>

+ 38
- 0
static/js/onlinesales.js View File

@@ -0,0 +1,38 @@
1
+/* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
5
+var ordertable = $('#ordertable').DataTable({
6
+    responsive: {
7
+        details: {
8
+            display: $.fn.dataTable.Responsive.display.modal({
9
+                header: function (row) {
10
+                    var data = row.data();
11
+                    return "<i class=\"fas fa-box fa-fw\"></i> " + data[2];
12
+                }
13
+            }),
14
+            renderer: $.fn.dataTable.Responsive.renderer.tableAll({
15
+                tableClass: 'table'
16
+            }),
17
+            type: "column"
18
+        }
19
+    },
20
+    columnDefs: [
21
+        {
22
+            targets: 0,
23
+            className: 'control',
24
+            orderable: false
25
+        },
26
+        {
27
+            targets: 1,
28
+            orderable: false
29
+        },
30
+        {
31
+            targets: 6,
32
+            orderable: false
33
+        }
34
+    ],
35
+    order: [
36
+        [2, 'asc']
37
+    ]
38
+});

Loading…
Cancel
Save