Exemplo n.º 1
0
<?php

// $this->renderPartial('//Config/SetLanguage');
?>

<?php 
$barcodeConfig = BarcodeConfig::model()->find();
$barcode_width = 0.5;
$barcode_height = 1.0;
$columns = 10;
$rows = 10;
$font_size = 9;
$text_alignment = 'center';
$paper = 'A4';
$a4_oriendtation = '';
$a5_oriendtation = '';
$paper_width = '';
$paper_height = '';
$show_product_name = 'no';
$show_product_price = 'no';
$show_product_price_send = 'no';
$paper_landscape = 'no';
$barcode_rotate = 'horizontal';
if (!empty($barcodeConfig)) {
    $barcode_width = $barcodeConfig->barcode_width;
    $barcode_height = $barcodeConfig->barcode_height;
    $columns = $barcodeConfig->cols;
    $rows = $barcodeConfig->rows;
    $text_alignment = $barcodeConfig->alignment;
    $paper = $barcodeConfig->paper;
    $a4_oriendtation = $barcodeConfig->a4_oriendtation;
Exemplo n.º 2
0
 public function actionSaveGenBarcode()
 {
     $this->checkLogin();
     if (!empty($_POST)) {
         $barcodeConfig = BarcodeConfig::model()->find();
         if (empty($barcodeConfig)) {
             $barcodeConfig = new BarcodeConfig();
         }
         $barcodeConfig->barcode_width = Util::input($_POST['barcode_width']);
         $barcodeConfig->barcode_height = Util::input($_POST['barcode_height']);
         $barcodeConfig->cols = Util::input($_POST['columns']);
         $barcodeConfig->rows = Util::input($_POST['rows']);
         $barcodeConfig->font_size = Util::input($_POST['font_size']);
         $barcodeConfig->alignment = Util::input($_POST['text_alignment']);
         $barcodeConfig->paper = @Util::input($_POST['paper']);
         $barcodeConfig->a4_oriendtation = @Util::input($_POST['a4-oriendtation']);
         $barcodeConfig->a5_oriendtation = @Util::input($_POST['a5-oriendtation']);
         $barcodeConfig->paper_width = @Util::input($_POST['paper-width']);
         $barcodeConfig->paper_height = @Util::input($_POST['paper-height']);
         $barcodeConfig->paper_landscape = @Util::input($_POST['paper_landscape']);
         $barcodeConfig->barcode_rotate = @Util::input($_POST['barcode_rotate']);
         // show, hide
         $show_product_name = @Util::input($_POST['show_product_name']);
         $show_product_price = @Util::input($_POST['show_product_price']);
         $show_product_price_send = @Util::input($_POST['show_product_price_send']);
         if ($show_product_name == 'show') {
             $show_product_name = 'yes';
         } else {
             $show_product_name = 'no';
         }
         if ($show_product_price == 'show') {
             $show_product_price = 'yes';
         } else {
             $show_product_price = 'no';
         }
         if ($show_product_price_send == 'show') {
             $show_product_price_send = 'yes';
         }
         $barcodeConfig->show_product_name = $show_product_name;
         $barcodeConfig->show_product_price = $show_product_price;
         $barcodeConfig->show_product_price_send = $show_product_price_send;
         if ($barcodeConfig->save()) {
             echo 'success';
         }
     }
 }