1st version with orientation
这个提交包含在:
父节点
04c7db1920
当前提交
f2272e9fb5
共有 4 个文件被更改,包括 18 次插入 和 22 次删除
|
|
@ -196,7 +196,7 @@ class Labels extends CI_Controller {
|
||||||
}
|
}
|
||||||
define('FPDF_FONTPATH', './src/Label/font/');
|
define('FPDF_FONTPATH', './src/Label/font/');
|
||||||
|
|
||||||
$pdf->AddPage();
|
$pdf->AddPage($ptype->orientation);
|
||||||
|
|
||||||
if ($label->font == 'DejaVuSans') { // leave this here, for future Use
|
if ($label->font == 'DejaVuSans') { // leave this here, for future Use
|
||||||
$pdf->AddFont($label->font,'','DejaVuSansMono.ttf',true);
|
$pdf->AddFont($label->font,'','DejaVuSansMono.ttf',true);
|
||||||
|
|
@ -208,9 +208,9 @@ class Labels extends CI_Controller {
|
||||||
|
|
||||||
if ($qsos->num_rows() > 0) {
|
if ($qsos->num_rows() > 0) {
|
||||||
if ($label->qsos == 1) {
|
if ($label->qsos == 1) {
|
||||||
$this->makeMultiQsoLabel($qsos->result(), $pdf, 1, $offset);
|
$this->makeMultiQsoLabel($qsos->result(), $pdf, 1, $offset, $ptype->orientation);
|
||||||
} else {
|
} else {
|
||||||
$this->makeMultiQsoLabel($qsos->result(), $pdf, $label->qsos, $offset);
|
$this->makeMultiQsoLabel($qsos->result(), $pdf, $label->qsos, $offset, $ptype->orientation);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->session->set_flashdata('message', '0 QSOs found for print!');
|
$this->session->set_flashdata('message', '0 QSOs found for print!');
|
||||||
|
|
@ -219,7 +219,7 @@ class Labels extends CI_Controller {
|
||||||
$pdf->Output();
|
$pdf->Output();
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeMultiQsoLabel($qsos, $pdf, $numberofqsos, $offset) {
|
function makeMultiQsoLabel($qsos, $pdf, $numberofqsos, $offset, $orientation) {
|
||||||
$text = '';
|
$text = '';
|
||||||
$current_callsign = '';
|
$current_callsign = '';
|
||||||
$current_sat = '';
|
$current_sat = '';
|
||||||
|
|
@ -228,7 +228,7 @@ class Labels extends CI_Controller {
|
||||||
$qso_data = [];
|
$qso_data = [];
|
||||||
if ($offset !== 1) {
|
if ($offset !== 1) {
|
||||||
for ($i = 1; $i < $offset; $i++) {
|
for ($i = 1; $i < $offset; $i++) {
|
||||||
$pdf->Add_Label('');
|
$pdf->Add_Label('',$orientation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach($qsos as $qso) {
|
foreach($qsos as $qso) {
|
||||||
|
|
@ -236,7 +236,7 @@ class Labels extends CI_Controller {
|
||||||
( ($qso->COL_BAND_RX !== $current_sat_bandrx) && ($this->pretty_sat_mode($qso->COL_SAT_MODE) !== '')) ) {
|
( ($qso->COL_BAND_RX !== $current_sat_bandrx) && ($this->pretty_sat_mode($qso->COL_SAT_MODE) !== '')) ) {
|
||||||
// ((($qso->COL_SAT_NAME ?? '' !== $current_sat) || ($qso->COL_CALL !== $current_callsign)) && ($qso->COL_SAT_NAME ?? '' !== '') && ($col->COL_BAND_RX ?? '' !== $current_sat_bandrx))) {
|
// ((($qso->COL_SAT_NAME ?? '' !== $current_sat) || ($qso->COL_CALL !== $current_callsign)) && ($qso->COL_SAT_NAME ?? '' !== '') && ($col->COL_BAND_RX ?? '' !== $current_sat_bandrx))) {
|
||||||
if (!empty($qso_data)) {
|
if (!empty($qso_data)) {
|
||||||
$this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos);
|
$this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos, $orientation);
|
||||||
$qso_data = [];
|
$qso_data = [];
|
||||||
}
|
}
|
||||||
$current_callsign = $qso->COL_CALL;
|
$current_callsign = $qso->COL_CALL;
|
||||||
|
|
@ -258,7 +258,7 @@ class Labels extends CI_Controller {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (!empty($qso_data)) {
|
if (!empty($qso_data)) {
|
||||||
$this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos);
|
$this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos, $orientation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// New begin
|
// New begin
|
||||||
|
|
@ -266,7 +266,7 @@ class Labels extends CI_Controller {
|
||||||
return(strlen($sat_mode ?? '') == 2 ? (strtoupper($sat_mode[0]).'/'.strtoupper($sat_mode[1])) : strtoupper($sat_mode ?? ''));
|
return(strlen($sat_mode ?? '') == 2 ? (strtoupper($sat_mode[0]).'/'.strtoupper($sat_mode[1])) : strtoupper($sat_mode ?? ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
function finalizeData($pdf, $current_callsign, &$preliminaryData, $qso_per_label) {
|
function finalizeData($pdf, $current_callsign, &$preliminaryData, $qso_per_label,$orientation) {
|
||||||
|
|
||||||
$tableData = [];
|
$tableData = [];
|
||||||
$count_qso = 0;
|
$count_qso = 0;
|
||||||
|
|
@ -286,7 +286,7 @@ class Labels extends CI_Controller {
|
||||||
|
|
||||||
|
|
||||||
if($count_qso == $qso_per_label){
|
if($count_qso == $qso_per_label){
|
||||||
$this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso);
|
$this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso,$orientation);
|
||||||
$tableData = []; // reset the data
|
$tableData = []; // reset the data
|
||||||
$count_qso = 0; // reset the counter
|
$count_qso = 0; // reset the counter
|
||||||
}
|
}
|
||||||
|
|
@ -294,12 +294,12 @@ class Labels extends CI_Controller {
|
||||||
}
|
}
|
||||||
// generate label for remaining QSOs
|
// generate label for remaining QSOs
|
||||||
if($count_qso > 0){
|
if($count_qso > 0){
|
||||||
$this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso);
|
$this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso,$orientation);
|
||||||
$preliminaryData = []; // reset the data
|
$preliminaryData = []; // reset the data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateLabel($pdf, $current_callsign, $tableData,$numofqsos,$qso){
|
function generateLabel($pdf, $current_callsign, $tableData,$numofqsos,$qso,$orientation){
|
||||||
$builder = new \AsciiTable\Builder();
|
$builder = new \AsciiTable\Builder();
|
||||||
$builder->addRows($tableData);
|
$builder->addRows($tableData);
|
||||||
$text = "Confirming QSO".($numofqsos>1 ? 's' : '')." with ";
|
$text = "Confirming QSO".($numofqsos>1 ? 's' : '')." with ";
|
||||||
|
|
@ -317,7 +317,7 @@ class Labels extends CI_Controller {
|
||||||
}
|
}
|
||||||
$text .= "\nThanks for the QSO".($numofqsos>1 ? 's' : '');
|
$text .= "\nThanks for the QSO".($numofqsos>1 ? 's' : '');
|
||||||
$text .= " | ".($qso['qsl_recvd'] == 'Y' ? 'TNX' : 'PSE')." QSL";
|
$text .= " | ".($qso['qsl_recvd'] == 'Y' ? 'TNX' : 'PSE')." QSL";
|
||||||
$pdf->Add_Label($text);
|
$pdf->Add_Label($text,$orientation);
|
||||||
}
|
}
|
||||||
|
|
||||||
// New End
|
// New End
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,12 @@ class Migration_create_label_paper_types_table extends CI_Migration {
|
||||||
'null' => TRUE,
|
'null' => TRUE,
|
||||||
),
|
),
|
||||||
|
|
||||||
|
'orientation' => array(
|
||||||
|
'type' => 'VARCHAR',
|
||||||
|
'constraint' => '1',
|
||||||
|
'null' => TRUE,
|
||||||
|
),
|
||||||
|
|
||||||
'height' => array(
|
'height' => array(
|
||||||
'type' => 'DECIMAL',
|
'type' => 'DECIMAL',
|
||||||
'constraint' => '6,3',
|
'constraint' => '6,3',
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,6 @@
|
||||||
<label class="col-sm-2 col-form-label" for="paperType">Paper Type</label>
|
<label class="col-sm-2 col-form-label" for="paperType">Paper Type</label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<select name="paper_type" class="form-control" id="paperType">
|
<select name="paper_type" class="form-control" id="paperType">
|
||||||
<option value="a3">A3</option>
|
|
||||||
<option value="a5">A5</option>
|
|
||||||
<option value="a4">A4</option>
|
|
||||||
<option value="letter">Letter</option>
|
|
||||||
<option value="legal">Legal</option>
|
|
||||||
<?php
|
<?php
|
||||||
foreach($papertypes as $paper){
|
foreach($papertypes as $paper){
|
||||||
echo '<option value=' . $paper->paper_name . '>' . ucwords(strtolower(($paper->paper_name))) . '</option>';
|
echo '<option value=' . $paper->paper_name . '>' . ucwords(strtolower(($paper->paper_name))) . '</option>';
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,6 @@
|
||||||
<label class="col-sm-2 col-form-label" for="paperType">Paper Type</label>
|
<label class="col-sm-2 col-form-label" for="paperType">Paper Type</label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<select name="paper_type" class="form-control" id="paperType">
|
<select name="paper_type" class="form-control" id="paperType">
|
||||||
<option value="a3" <?php if($label->paper_type == "a3") { echo "selected=\"selected\""; } ?>>A3</option>
|
|
||||||
<option value="a4" <?php if($label->paper_type == "a4") { echo "selected=\"selected\""; } ?>>A4</option>
|
|
||||||
<option value="a5" <?php if($label->paper_type == "a5") { echo "selected=\"selected\""; } ?>>A5</option>
|
|
||||||
<option value="letter" <?php if($label->paper_type == "letter") { echo "selected=\"selected\""; } ?>>Letter</option>
|
|
||||||
<option value="legal" <?php if($label->paper_type == "legal") { echo "selected=\"selected\""; } ?>>Legal</option>
|
|
||||||
<?php
|
<?php
|
||||||
foreach($papertypes as $paper){
|
foreach($papertypes as $paper){
|
||||||
echo '<option value="' . $paper->paper_name . '"';
|
echo '<option value="' . $paper->paper_name . '"';
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用