Преглед на файлове

Start adding online store order management tools

master
Skylar Ittner преди 1 година
родител
ревизия
285e6ed196
променени са 5 файла, в които са добавени 110 реда и са изтрити 1 реда
  1. Двоични данни
      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

Двоични данни
database.mwb Целия файл


+ 2
- 1
lang/en_us.php Целия файл

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

+ 13
- 0
pages.php Целия файл

@@ -35,6 +35,19 @@ define("PAGES", [
"static/js/pos.js",
]
],
"onlinesales" => [
"title" => "Online Sales",
"navbar" => true,
"icon" => "fas fa-box",
"styles" => [
"static/css/datatables.min.css",
"static/css/tables.css"
],
"scripts" => [
"static/js/datatables.min.js",
"static/js/onlinesales.js"
],
],
"customers" => [
"title" => "customers",
"navbar" => true,

+ 57
- 0
pages/onlinesales.php Целия файл

@@ -0,0 +1,57 @@
<?php
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

require_once __DIR__ . "/../required.php";

redirectIfNotLoggedIn();

$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]]);
?>

<table id="ordertable" class="table table-bordered table-hover table-sm">
<thead>
<tr>
<th data-priority="0"></th>
<th data-priority="1"><?php lang('actions'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-user d-none d-md-inline"></i> <?php lang('name'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-phone d-none d-md-inline"></i> <?php lang('phone'); ?></th>
<th data-priority="3"><i class="fas fa-fw fa-at d-none d-md-inline"></i> <?php lang('email'); ?></th>
<th data-priority="4"><i class="fas fa-fw fa-map-marker d-none d-md-inline"></i> <?php lang('address'); ?></th>
<th data-priority="5"><i class="fas fa-fw fa-sticky-note d-none d-md-inline"></i> <?php lang('notes'); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($unshipped as $o) {
?>
<tr>
<td></td>
<td>
<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>
</td>
<td><?php echo $o['name']; ?></td>
<td><?php echo $o['phone']; ?></td>
<td><?php echo $o['email']; ?></td>
<td><?php echo $o['address']; ?></td>
<td><?php echo $o['notes']; ?></td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<th data-priority="0"></th>
<th data-priority="1"><?php lang('actions'); ?></th>
<th data-priority="1"><i class="fas fa-fw fa-user d-none d-md-inline"></i> <?php lang('name'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-phone d-none d-md-inline"></i> <?php lang('phone'); ?></th>
<th data-priority="3"><i class="fas fa-fw fa-at d-none d-md-inline"></i> <?php lang('email'); ?></th>
<th data-priority="4"><i class="fas fa-fw fa-map-marker d-none d-md-inline"></i> <?php lang('address'); ?></th>
<th data-priority="5"><i class="fas fa-fw fa-sticky-note d-none d-md-inline"></i> <?php lang('notes'); ?></th>
</tr>
</tfoot>
</table>

+ 38
- 0
static/js/onlinesales.js Целия файл

@@ -0,0 +1,38 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

var ordertable = $('#ordertable').DataTable({
responsive: {
details: {
display: $.fn.dataTable.Responsive.display.modal({
header: function (row) {
var data = row.data();
return "<i class=\"fas fa-box fa-fw\"></i> " + data[2];
}
}),
renderer: $.fn.dataTable.Responsive.renderer.tableAll({
tableClass: 'table'
}),
type: "column"
}
},
columnDefs: [
{
targets: 0,
className: 'control',
orderable: false
},
{
targets: 1,
orderable: false
},
{
targets: 6,
orderable: false
}
],
order: [
[2, 'asc']
]
});

Loading…
Отказ
Запис