[QSL Labels] Added messages
这个提交包含在:
父节点
946159b5d2
当前提交
e7d359f047
共有 2 个文件被更改,包括 43 次插入 和 20 次删除
|
|
@ -103,6 +103,7 @@ class Labels extends CI_Controller {
|
||||||
// Example of custom format
|
// Example of custom format
|
||||||
// $pdf = new PDF_Label(array('paper-size'=>'A4', 'metric'=>'mm', 'marginLeft'=>1, 'marginTop'=>1, 'NX'=>2, 'NY'=>7, 'SpaceX'=>0, 'SpaceY'=>0, 'width'=>99, 'height'=>38, 'font-size'=>14));
|
// $pdf = new PDF_Label(array('paper-size'=>'A4', 'metric'=>'mm', 'marginLeft'=>1, 'marginTop'=>1, 'NX'=>2, 'NY'=>7, 'SpaceX'=>0, 'SpaceY'=>0, 'width'=>99, 'height'=>38, 'font-size'=>14));
|
||||||
|
|
||||||
|
try {
|
||||||
if ($label) {
|
if ($label) {
|
||||||
$pdf = new PDF_Label(array(
|
$pdf = new PDF_Label(array(
|
||||||
'paper-size' => $label->paper_type,
|
'paper-size' => $label->paper_type,
|
||||||
|
|
@ -122,6 +123,10 @@ class Labels extends CI_Controller {
|
||||||
// Standard format
|
// Standard format
|
||||||
$pdf = new PDF_Label('3422');
|
$pdf = new PDF_Label('3422');
|
||||||
}
|
}
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
$this->session->set_flashdata('error', 'Something went wrong! The label could not be generated. Check label size and font size.');
|
||||||
|
redirect('labels');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
|
|
@ -142,7 +147,9 @@ class Labels extends CI_Controller {
|
||||||
} else {
|
} else {
|
||||||
echo "0 results";
|
echo "0 results";
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->Output();
|
$pdf->Output();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit($id) {
|
public function edit($id) {
|
||||||
|
|
@ -162,12 +169,14 @@ class Labels extends CI_Controller {
|
||||||
public function updateLabel($id) {
|
public function updateLabel($id) {
|
||||||
$this->load->model('labels_model');
|
$this->load->model('labels_model');
|
||||||
$this->labels_model->updateLabel($id);
|
$this->labels_model->updateLabel($id);
|
||||||
|
$this->session->set_flashdata('message', 'Label was saved.');
|
||||||
redirect('labels');
|
redirect('labels');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete($id) {
|
public function delete($id) {
|
||||||
$this->load->model('labels_model');
|
$this->load->model('labels_model');
|
||||||
$this->labels_model->deleteLabel($id);
|
$this->labels_model->deleteLabel($id);
|
||||||
|
$this->session->set_flashdata('warning', 'Label was deleted.');
|
||||||
redirect('labels');
|
redirect('labels');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,22 @@
|
||||||
<br>
|
<br>
|
||||||
<?php if($this->session->flashdata('message')) { ?>
|
<?php if($this->session->flashdata('message')) { ?>
|
||||||
<!-- Display Message -->
|
<!-- Display Message -->
|
||||||
<div class="alert-message error">
|
<div class="alert alert-success" role="alert">
|
||||||
<p><?php echo $this->session->flashdata('message'); ?></p>
|
<?php echo $this->session->flashdata('message'); ?>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<?php if($this->session->flashdata('error')) { ?>
|
||||||
|
<!-- Display Message -->
|
||||||
|
<div class="alert alert-danger" role="alert">
|
||||||
|
<?php echo $this->session->flashdata('error'); ?>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<?php if($this->session->flashdata('warning')) { ?>
|
||||||
|
<!-- Display Message -->
|
||||||
|
<div class="alert alert-warning" role="alert">
|
||||||
|
<?php echo $this->session->flashdata('warning'); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用