Add mobile barcode scan buttons
This commit is contained in:
parent
1864a54d24
commit
9e8cffa394
@ -24,32 +24,32 @@ $editing = false;
|
||||
|
||||
if (!is_empty($VARS['id'])) {
|
||||
if ($database->has('items', ['itemid' => $VARS['id']])) {
|
||||
$editing = true;
|
||||
$itemdata = $database->select(
|
||||
'items', [
|
||||
'[>]categories' => [
|
||||
'catid' => 'catid'
|
||||
],
|
||||
'[>]locations' => [
|
||||
'locid' => 'locid'
|
||||
]
|
||||
], [
|
||||
'name',
|
||||
'code1',
|
||||
'code2',
|
||||
'text1',
|
||||
'text2',
|
||||
'text3',
|
||||
'items.catid',
|
||||
'catname',
|
||||
'items.locid',
|
||||
'locname',
|
||||
'loccode',
|
||||
'qty',
|
||||
'userid'
|
||||
], [
|
||||
'itemid' => $VARS['id']
|
||||
])[0];
|
||||
$editing = true;
|
||||
$itemdata = $database->select(
|
||||
'items', [
|
||||
'[>]categories' => [
|
||||
'catid' => 'catid'
|
||||
],
|
||||
'[>]locations' => [
|
||||
'locid' => 'locid'
|
||||
]
|
||||
], [
|
||||
'name',
|
||||
'code1',
|
||||
'code2',
|
||||
'text1',
|
||||
'text2',
|
||||
'text3',
|
||||
'items.catid',
|
||||
'catname',
|
||||
'items.locid',
|
||||
'locname',
|
||||
'loccode',
|
||||
'qty',
|
||||
'userid'
|
||||
], [
|
||||
'itemid' => $VARS['id']
|
||||
])[0];
|
||||
} else {
|
||||
// item id is invalid, redirect to a page that won't cause an error when pressing Save
|
||||
header('Location: app.php?page=edititem');
|
||||
@ -101,13 +101,23 @@ if (!is_empty($VARS['id'])) {
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="code1"><i class="fa fa-barcode"></i> <?php lang("code 1"); ?></label>
|
||||
<input type="text" class="form-control" id="code1" name="code1" placeholder="123456789" value="<?php echo htmlspecialchars($itemdata['code1']); ?>" />
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="code1" name="code1" placeholder="123456789" value="<?php echo htmlspecialchars($itemdata['code1']); ?>" />
|
||||
<span class="input-group-btn mobile-app-show">
|
||||
<button type="button" class="btn btn-default" onclick="scancode('#code1'); return false;"><i class="fa fa-fw fa-barcode"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="code2"><i class="fa fa-qrcode"></i> <?php lang("code 2"); ?></label>
|
||||
<input type="text" class="form-control" id="code2" name="code2" placeholder="qwerty123" value="<?php echo htmlspecialchars($itemdata['code2']); ?>" />
|
||||
<div class="input-group">
|
||||
<input type="text" style="width: available;" class="form-control" id="code2" name="code2" placeholder="qwerty123" value="<?php echo htmlspecialchars($itemdata['code2']); ?>" />
|
||||
<span class="input-group-btn mobile-app-show">
|
||||
<button type="button" class="btn btn-default" onclick="scancode('#code2'); return false;"><i class="fa fa-fw fa-barcode"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -70,4 +70,12 @@ to replace the rgba()s.
|
||||
.navbar-header .navbar-brand img {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-app-show {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.mobile-app-display {
|
||||
display: none;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
$('#itemtable').DataTable({
|
||||
var itemtable = $('#itemtable').DataTable({
|
||||
responsive: {
|
||||
details: {
|
||||
display: $.fn.dataTable.Responsive.display.modal({
|
||||
@ -53,4 +53,6 @@ $('#itemtable').DataTable({
|
||||
return JSON.stringify(json);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#itemtable_filter').append("<span class=\"btn btn-default btn-sm mobile-app-show mobile-app-display\" onclick=\"scancode('#itemtable_filter label input');\"><i class=\"fa fa-barcode fa-fw\"></i></span>");
|
Loading…
x
Reference in New Issue
Block a user