Added dialog for delete
这个提交包含在:
父节点
126d781baa
当前提交
bf858f31de
共有 2 个文件被更改,包括 41 次插入 和 3 次删除
|
|
@ -47,7 +47,7 @@
|
|||
<tbody>
|
||||
<?php
|
||||
foreach($papertypes as $paper) { ?>
|
||||
<tr class='label_<?php echo $paper->paper_id ?>'>
|
||||
<tr class='paper_<?php echo $paper->paper_id ?>'>
|
||||
<td><?php echo $paper->paper_name; ?></td>
|
||||
<td><?php echo $paper->metric; ?></td>
|
||||
<td><?php echo $paper->width; ?></td>
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
<td><?php echo $paper->lbl_cnt ?? '0' ?></td>
|
||||
<td><?php echo $paper->orientation == 'P' ? 'Portrait': 'Landscape'; ?></td>
|
||||
<td><a href="<?php echo site_url('labels/editpaper/' . $paper->paper_id); ?>" class="btn btn-outline-primary btn-sm"><i class="fas fa-edit"></i></a></td>
|
||||
<td><a href="<?php echo site_url('labels/deletepaper/' . $paper->paper_id); ?>" class="btn btn-outline-danger btn-sm"><i class="fas fa-trash-alt"></i></a></td>
|
||||
<td><a href="javascript:deletepaper(<?php echo $paper->paper_id; ?>);" class="btn btn-outline-danger btn-sm"><i class="fas fa-trash-alt"></i></a></td>
|
||||
</tr>
|
||||
|
||||
<?php }
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
<td><input type="checkbox" <?php if ($label->useforprint == 1) {echo 'checked';}?>></td>
|
||||
<?php } ?>
|
||||
<td><a href="<?php echo site_url('labels/edit/' . $label->id); ?>" class="btn btn-outline-primary btn-sm"><i class="fas fa-edit"></i></a></td>
|
||||
<td><a href="<?php echo site_url('labels/delete/' . $label->id); ?>" class="btn btn-outline-danger btn-sm"><i class="fas fa-trash-alt"></i></a></td>
|
||||
<td><a href="javascript:deletelabel(<?php echo $label->id; ?>);" class="btn btn-outline-danger btn-sm"><i class="fas fa-trash-alt"></i></a></td>
|
||||
</tr>
|
||||
|
||||
<?php }
|
||||
|
|
|
|||
|
|
@ -39,3 +39,41 @@ function printat(stationid) {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
function deletelabel(id) {
|
||||
BootstrapDialog.confirm({
|
||||
title: 'DANGER',
|
||||
message: 'Warning! Are you sure you want this label?',
|
||||
type: BootstrapDialog.TYPE_DANGER,
|
||||
closable: true,
|
||||
draggable: true,
|
||||
btnOKClass: 'btn-danger',
|
||||
callback: function(result) {
|
||||
if (result) {
|
||||
window.location.replace(base_url + 'index.php/labels/delete/'+id);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function deletepaper(id) {
|
||||
var message = 'Warning! Are you sure you want delete this paper type?';
|
||||
var currentRow = $(".paper_"+id).first().closest('tr');
|
||||
var inuse = currentRow.find("td:eq(4)").text();
|
||||
if (inuse > 0) {
|
||||
message = 'Warning! This paper type is in use. Are you really sure you want delete this paper type?';
|
||||
}
|
||||
BootstrapDialog.confirm({
|
||||
title: 'DANGER',
|
||||
message: message,
|
||||
type: BootstrapDialog.TYPE_DANGER,
|
||||
closable: true,
|
||||
draggable: true,
|
||||
btnOKClass: 'btn-danger',
|
||||
callback: function(result) {
|
||||
if (result) {
|
||||
window.location.replace(base_url + 'index.php/labels/deletePaper/'+id);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
正在加载…
在新工单中引用