Version Notes
Versions:
I've tested the modul with the versions 1.4. Older versions maybe run correct but without guarantee.
Versionen:
Ich konnte das Modul mit der Version 1.4 testen. Andere Versionen sind möglich, aber nicht garantiert.
Download this release
Release Info
| Developer | Magento Core Team |
| Extension | QR_Mage |
| Version | 0.1.2 |
| Comparing to | |
| See all releases | |
Code changes from version 0.1.1 to 0.1.2
- app/code/local/Eisbehr/QrMage/Block/Qrcode.php +5 -3
- app/code/local/Eisbehr/QrMage/Helper/Config.php +56 -8
- app/code/local/Eisbehr/QrMage/Helper/Data.php +34 -8
- app/code/local/Eisbehr/QrMage/Helper/Swetake.php +1175 -0
- app/code/local/Eisbehr/QrMage/Model/{Encoding.php → Config/Encoding.php} +1 -1
- app/code/local/Eisbehr/QrMage/Model/Config/Engine.php +11 -0
- app/code/local/Eisbehr/QrMage/Model/Config/Image.php +11 -0
- app/code/local/Eisbehr/QrMage/Model/{Level.php → Config/Level.php} +1 -1
- app/code/local/Eisbehr/QrMage/Model/Config/Size.php +19 -0
- app/code/local/Eisbehr/QrMage/Model/Db.php +66 -0
- app/code/local/Eisbehr/QrMage/controllers/CodeController.php +38 -0
- app/code/local/Eisbehr/QrMage/controllers/IndexController.php +5 -3
- app/code/local/Eisbehr/QrMage/etc/config.xml +9 -1
- app/code/local/Eisbehr/QrMage/etc/system.xml +71 -18
- app/code/local/Eisbehr/QrMage/sql/eisbehr_qrmage_setup/mysql4-install-0.1.0.php +11 -0
- media/qrmage/qrv10_0.dat +0 -0
- media/qrmage/qrv10_1.dat +0 -0
- media/qrmage/qrv10_2.dat +0 -0
- media/qrmage/qrv10_3.dat +0 -0
- media/qrmage/qrv11_0.dat +0 -0
- media/qrmage/qrv11_1.dat +0 -0
- media/qrmage/qrv11_2.dat +0 -0
- media/qrmage/qrv11_3.dat +0 -0
- media/qrmage/qrv12_0.dat +0 -0
- media/qrmage/qrv12_1.dat +0 -0
- media/qrmage/qrv12_2.dat +0 -0
- media/qrmage/qrv12_3.dat +0 -0
- media/qrmage/qrv13_0.dat +0 -0
- media/qrmage/qrv13_1.dat +0 -0
- media/qrmage/qrv13_2.dat +0 -0
- media/qrmage/qrv13_3.dat +0 -0
- media/qrmage/qrv14_0.dat +0 -0
- media/qrmage/qrv14_1.dat +0 -0
- media/qrmage/qrv14_2.dat +0 -0
- media/qrmage/qrv14_3.dat +0 -0
- media/qrmage/qrv15_0.dat +0 -0
- media/qrmage/qrv15_1.dat +0 -0
- media/qrmage/qrv15_2.dat +0 -0
- media/qrmage/qrv15_3.dat +0 -0
- media/qrmage/qrv16_0.dat +0 -0
- media/qrmage/qrv16_1.dat +0 -0
- media/qrmage/qrv16_2.dat +0 -0
- media/qrmage/qrv16_3.dat +0 -0
- media/qrmage/qrv17_0.dat +0 -0
- media/qrmage/qrv17_1.dat +0 -0
- media/qrmage/qrv17_2.dat +0 -0
- media/qrmage/qrv17_3.dat +0 -0
- media/qrmage/qrv18_0.dat +0 -0
- media/qrmage/qrv18_1.dat +0 -0
- media/qrmage/qrv18_2.dat +0 -0
- media/qrmage/qrv18_3.dat +0 -0
- media/qrmage/qrv19_0.dat +0 -0
- media/qrmage/qrv19_1.dat +0 -0
- media/qrmage/qrv19_2.dat +0 -0
- media/qrmage/qrv19_3.dat +0 -0
- media/qrmage/qrv1_0.dat +0 -0
- media/qrmage/qrv1_1.dat +0 -0
- media/qrmage/qrv1_2.dat +0 -0
- media/qrmage/qrv1_3.dat +0 -0
- media/qrmage/qrv20_0.dat +0 -0
- media/qrmage/qrv20_1.dat +0 -0
- media/qrmage/qrv20_2.dat +0 -0
- media/qrmage/qrv20_3.dat +0 -0
- media/qrmage/qrv21_0.dat +0 -0
- media/qrmage/qrv21_1.dat +0 -0
- media/qrmage/qrv21_2.dat +0 -0
- media/qrmage/qrv21_3.dat +0 -0
- media/qrmage/qrv22_0.dat +0 -0
- media/qrmage/qrv22_1.dat +209 -0
- media/qrmage/qrv22_2.dat +0 -0
- media/qrmage/qrv22_3.dat +0 -0
- media/qrmage/qrv23_0.dat +0 -0
- media/qrmage/qrv23_1.dat +217 -0
- media/qrmage/qrv23_2.dat +0 -0
- media/qrmage/qrv23_3.dat +0 -0
- media/qrmage/qrv24_0.dat +0 -0
- media/qrmage/qrv24_1.dat +225 -0
- media/qrmage/qrv24_2.dat +0 -0
- media/qrmage/qrv24_3.dat +0 -0
- media/qrmage/qrv25_0.dat +233 -0
- media/qrmage/qrv25_1.dat +233 -0
- media/qrmage/qrv25_2.dat +0 -0
- media/qrmage/qrv25_3.dat +0 -0
- media/qrmage/qrv26_0.dat +241 -0
- media/qrmage/qrv26_1.dat +241 -0
- media/qrmage/qrv26_2.dat +0 -0
- media/qrmage/qrv26_3.dat +241 -0
- media/qrmage/qrv27_0.dat +249 -0
- media/qrmage/qrv27_1.dat +249 -0
- media/qrmage/qrv27_2.dat +249 -0
- media/qrmage/qrv27_3.dat +249 -0
- media/qrmage/qrv28_0.dat +257 -0
- media/qrmage/qrv28_1.dat +257 -0
- media/qrmage/qrv28_2.dat +257 -1
- media/qrmage/qrv28_3.dat +257 -0
- media/qrmage/qrv29_0.dat +265 -0
- media/qrmage/qrv29_1.dat +265 -0
- media/qrmage/qrv29_2.dat +265 -0
- media/qrmage/qrv29_3.dat +265 -0
- media/qrmage/qrv2_0.dat +0 -0
- media/qrmage/qrv2_1.dat +0 -0
- media/qrmage/qrv2_2.dat +0 -0
- media/qrmage/qrv2_3.dat +0 -0
- media/qrmage/qrv30_0.dat +273 -0
- media/qrmage/qrv30_1.dat +273 -5
- media/qrmage/qrv30_2.dat +273 -0
app/code/local/Eisbehr/QrMage/Block/Qrcode.php
CHANGED
|
@@ -18,14 +18,16 @@ class Eisbehr_QrMage_Block_Qrcode extends Mage_Core_Block_Template
|
|
| 18 |
$config = Mage::helper('qrmage/config');
|
| 19 |
|
| 20 |
$url = Mage::helper('core/url')->getCurrentUrl();
|
| 21 |
-
$
|
|
|
|
| 22 |
$level = $config->getLevel();
|
| 23 |
-
$margin = $config->
|
| 24 |
-
$encoding = $config->
|
| 25 |
$label = $config->getLabel();
|
| 26 |
|
| 27 |
$helper = Mage::helper('qrmage');
|
| 28 |
$html = $helper->setUrl($url)
|
|
|
|
| 29 |
->setSize($size)
|
| 30 |
->setLevel($level)
|
| 31 |
->setMargin($margin)
|
| 18 |
$config = Mage::helper('qrmage/config');
|
| 19 |
|
| 20 |
$url = Mage::helper('core/url')->getCurrentUrl();
|
| 21 |
+
$engine = $config->getEngine();
|
| 22 |
+
$size = $config->getGoogleSize();
|
| 23 |
$level = $config->getLevel();
|
| 24 |
+
$margin = $config->getGoogleMargin();
|
| 25 |
+
$encoding = $config->getGoogleEncoding();
|
| 26 |
$label = $config->getLabel();
|
| 27 |
|
| 28 |
$helper = Mage::helper('qrmage');
|
| 29 |
$html = $helper->setUrl($url)
|
| 30 |
+
->setEngine($engine)
|
| 31 |
->setSize($size)
|
| 32 |
->setLevel($level)
|
| 33 |
->setMargin($margin)
|
app/code/local/Eisbehr/QrMage/Helper/Config.php
CHANGED
|
@@ -36,39 +36,87 @@ class Eisbehr_QrMage_Helper_Config extends Mage_Core_Helper_Abstract
|
|
| 36 |
return Mage::getStoreConfig( $basePath . $name );
|
| 37 |
}
|
| 38 |
|
|
|
|
|
|
|
| 39 |
public function getActive()
|
| 40 |
{
|
| 41 |
$value = $this->configValue('qrmage', 'active');
|
| 42 |
return ( $value ) ? true : false ;
|
| 43 |
}
|
| 44 |
|
| 45 |
-
public function
|
| 46 |
{
|
| 47 |
-
$value = $this->configValue('qrmage', '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
return $value;
|
| 49 |
}
|
| 50 |
|
| 51 |
public function getLevel()
|
| 52 |
{
|
| 53 |
$value = $this->configValue('qrmage', 'level');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
return $value;
|
| 55 |
}
|
| 56 |
|
| 57 |
-
public function
|
| 58 |
{
|
| 59 |
-
$value = $this->configValue('qrmage', '
|
| 60 |
return $value;
|
| 61 |
}
|
| 62 |
|
| 63 |
-
|
|
|
|
|
|
|
| 64 |
{
|
| 65 |
-
$value = $this->configValue('
|
| 66 |
return $value;
|
| 67 |
}
|
| 68 |
|
| 69 |
-
public function
|
| 70 |
{
|
| 71 |
-
$value = $this->configValue('
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
return $value;
|
| 73 |
}
|
| 74 |
}
|
| 36 |
return Mage::getStoreConfig( $basePath . $name );
|
| 37 |
}
|
| 38 |
|
| 39 |
+
/* general */
|
| 40 |
+
|
| 41 |
public function getActive()
|
| 42 |
{
|
| 43 |
$value = $this->configValue('qrmage', 'active');
|
| 44 |
return ( $value ) ? true : false ;
|
| 45 |
}
|
| 46 |
|
| 47 |
+
public function getEngine()
|
| 48 |
{
|
| 49 |
+
$value = $this->configValue('qrmage', 'engine');
|
| 50 |
+
|
| 51 |
+
if( empty($value) )
|
| 52 |
+
{
|
| 53 |
+
$value = "google";
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
return $value;
|
| 57 |
}
|
| 58 |
|
| 59 |
public function getLevel()
|
| 60 |
{
|
| 61 |
$value = $this->configValue('qrmage', 'level');
|
| 62 |
+
|
| 63 |
+
if( empty($value) )
|
| 64 |
+
{
|
| 65 |
+
$value = "L";
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
return $value;
|
| 69 |
}
|
| 70 |
|
| 71 |
+
public function getLabel()
|
| 72 |
{
|
| 73 |
+
$value = $this->configValue('qrmage', 'label');
|
| 74 |
return $value;
|
| 75 |
}
|
| 76 |
|
| 77 |
+
/* google */
|
| 78 |
+
|
| 79 |
+
public function getGoogleSize()
|
| 80 |
{
|
| 81 |
+
$value = $this->configValue('google', 'size');
|
| 82 |
return $value;
|
| 83 |
}
|
| 84 |
|
| 85 |
+
public function getGoogleMargin()
|
| 86 |
{
|
| 87 |
+
$value = $this->configValue('google', 'margin');
|
| 88 |
+
return $value;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
public function getGoogleEncoding()
|
| 92 |
+
{
|
| 93 |
+
$value = $this->configValue('google', 'encoding');
|
| 94 |
+
return $value;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
/* swetake */
|
| 98 |
+
|
| 99 |
+
public function getSwetakeSize()
|
| 100 |
+
{
|
| 101 |
+
$value = $this->configValue('swetake', 'size');
|
| 102 |
+
|
| 103 |
+
if( empty($value) )
|
| 104 |
+
{
|
| 105 |
+
$value = 4;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
return $value;
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
public function getSwetakeImage()
|
| 112 |
+
{
|
| 113 |
+
$value = $this->configValue('swetake', 'image');
|
| 114 |
+
|
| 115 |
+
if( empty($value) )
|
| 116 |
+
{
|
| 117 |
+
$value = "p";
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
return $value;
|
| 121 |
}
|
| 122 |
}
|
app/code/local/Eisbehr/QrMage/Helper/Data.php
CHANGED
|
@@ -5,7 +5,9 @@
|
|
| 5 |
class Eisbehr_QrMage_Helper_Data extends Mage_Core_Helper_Abstract
|
| 6 |
{
|
| 7 |
/* vars */
|
|
|
|
| 8 |
private $_url = NULL;
|
|
|
|
| 9 |
private $_size = 150;
|
| 10 |
private $_level = "L";
|
| 11 |
private $_margin = 4;
|
|
@@ -20,6 +22,12 @@ class Eisbehr_QrMage_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 20 |
return $this;
|
| 21 |
}
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
public function setSize($size)
|
| 24 |
{
|
| 25 |
if( is_numeric($size) && $size <= 500 )
|
|
@@ -81,12 +89,25 @@ class Eisbehr_QrMage_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 81 |
$this->setUrl($url);
|
| 82 |
}
|
| 83 |
|
| 84 |
-
$
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
$html = NULL;
|
| 92 |
|
|
@@ -100,8 +121,13 @@ class Eisbehr_QrMage_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 100 |
$html .= " title=\"" . $this->_label . "\"";
|
| 101 |
}
|
| 102 |
|
| 103 |
-
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
|
| 106 |
return $html;
|
| 107 |
}
|
| 5 |
class Eisbehr_QrMage_Helper_Data extends Mage_Core_Helper_Abstract
|
| 6 |
{
|
| 7 |
/* vars */
|
| 8 |
+
|
| 9 |
private $_url = NULL;
|
| 10 |
+
private $_engine = "google";
|
| 11 |
private $_size = 150;
|
| 12 |
private $_level = "L";
|
| 13 |
private $_margin = 4;
|
| 22 |
return $this;
|
| 23 |
}
|
| 24 |
|
| 25 |
+
public function setEngine($engine)
|
| 26 |
+
{
|
| 27 |
+
$this->_engine = urlencode($engine);
|
| 28 |
+
return $this;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
public function setSize($size)
|
| 32 |
{
|
| 33 |
if( is_numeric($size) && $size <= 500 )
|
| 89 |
$this->setUrl($url);
|
| 90 |
}
|
| 91 |
|
| 92 |
+
$src = NULL;
|
| 93 |
+
|
| 94 |
+
if( $this->_engine == "google" )
|
| 95 |
+
{
|
| 96 |
+
$model = Mage::getModel('qrmage/qr');
|
| 97 |
+
$src = $model->getQrImageSrc($this->_url,
|
| 98 |
+
$this->_size,
|
| 99 |
+
$this->_level,
|
| 100 |
+
$this->_margin,
|
| 101 |
+
$this->_encoding);
|
| 102 |
+
}
|
| 103 |
+
else
|
| 104 |
+
{
|
| 105 |
+
$model = Mage::getModel('qrmage/db');
|
| 106 |
+
$hash = $model->insertEntry($this->_url);
|
| 107 |
+
|
| 108 |
+
$src = Mage::getUrl('qrmage/code');
|
| 109 |
+
$src .= "?hash=" . $hash;
|
| 110 |
+
}
|
| 111 |
|
| 112 |
$html = NULL;
|
| 113 |
|
| 121 |
$html .= " title=\"" . $this->_label . "\"";
|
| 122 |
}
|
| 123 |
|
| 124 |
+
if( $this->_engine == "google" )
|
| 125 |
+
{
|
| 126 |
+
$html .= " width=\"" . $this->_size . "\"";
|
| 127 |
+
$html .= " height=\"" . $this->_size . "\"";
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
$html .= " />\n";
|
| 131 |
|
| 132 |
return $html;
|
| 133 |
}
|
app/code/local/Eisbehr/QrMage/Helper/Swetake.php
ADDED
|
@@ -0,0 +1,1175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
// Information:
|
| 3 |
+
// Swetake QrCode Engine
|
| 4 |
+
|
| 5 |
+
class Eisbehr_QrMage_Helper_Swetake extends Mage_Core_Helper_Abstract
|
| 6 |
+
{
|
| 7 |
+
/* class config */
|
| 8 |
+
|
| 9 |
+
private $data_path;
|
| 10 |
+
private $image_path;
|
| 11 |
+
private $version_ul;
|
| 12 |
+
|
| 13 |
+
/* user define */
|
| 14 |
+
|
| 15 |
+
private $qrcode_data_string;
|
| 16 |
+
private $qrcode_error_correct;
|
| 17 |
+
private $qrcode_module_size;
|
| 18 |
+
private $qrcode_version;
|
| 19 |
+
private $qrcode_image_type;
|
| 20 |
+
|
| 21 |
+
/* structured append (experimental) */
|
| 22 |
+
|
| 23 |
+
private $qrcode_structureappend_n;
|
| 24 |
+
private $qrcode_structureappend_m;
|
| 25 |
+
private $qrcode_structureappend_parity;
|
| 26 |
+
private $qrcode_structureappend_originaldata;
|
| 27 |
+
|
| 28 |
+
/* internal */
|
| 29 |
+
|
| 30 |
+
private $data_length;
|
| 31 |
+
private $data_counter;
|
| 32 |
+
private $data_value;
|
| 33 |
+
private $data_bits;
|
| 34 |
+
private $total_data_bits;
|
| 35 |
+
private $max_data_bits;
|
| 36 |
+
private $max_data_codewords;
|
| 37 |
+
private $codewords;
|
| 38 |
+
private $codewords_counter;
|
| 39 |
+
private $max_codewords;
|
| 40 |
+
private $codeword_num_plus;
|
| 41 |
+
private $codeword_num_counter_value;
|
| 42 |
+
private $error_correct_mode;
|
| 43 |
+
private $rs_block_order;
|
| 44 |
+
private $rs_ecc_codewords;
|
| 45 |
+
private $rs_cal_table_array;
|
| 46 |
+
private $max_modules_1side;
|
| 47 |
+
private $matrix_content;
|
| 48 |
+
private $matrix_x_array;
|
| 49 |
+
private $matrix_y_array;
|
| 50 |
+
private $mask_array;
|
| 51 |
+
private $mask_number;
|
| 52 |
+
private $mask_content;
|
| 53 |
+
private $byte_num;
|
| 54 |
+
private $format_information_x2;
|
| 55 |
+
private $format_information_y2;
|
| 56 |
+
private $frame_data;
|
| 57 |
+
|
| 58 |
+
/* data arrays */
|
| 59 |
+
|
| 60 |
+
private $alphanumeric_character_hash;
|
| 61 |
+
private $ecc_character_hash;
|
| 62 |
+
private $max_data_bits_array;
|
| 63 |
+
private $max_codewords_array;
|
| 64 |
+
private $matrix_remain_bit;
|
| 65 |
+
private $format_information_x1;
|
| 66 |
+
private $format_information_y1;
|
| 67 |
+
private $format_information_array;
|
| 68 |
+
|
| 69 |
+
/* image */
|
| 70 |
+
|
| 71 |
+
private $image_data;
|
| 72 |
+
private $output_image;
|
| 73 |
+
private $base_image;
|
| 74 |
+
private $qrcode_image_size;
|
| 75 |
+
private $mib;
|
| 76 |
+
|
| 77 |
+
/* construct */
|
| 78 |
+
|
| 79 |
+
function __construct()
|
| 80 |
+
{
|
| 81 |
+
return $this->cleanup();
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
/* destruct */
|
| 85 |
+
|
| 86 |
+
function __destruct()
|
| 87 |
+
{
|
| 88 |
+
return $this->cleanup();
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
/* create */
|
| 92 |
+
|
| 93 |
+
public function createQrCode()
|
| 94 |
+
{
|
| 95 |
+
if( !$this->checkQrCodeConfig() )
|
| 96 |
+
{
|
| 97 |
+
return false;
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
/* cleanup */
|
| 101 |
+
|
| 102 |
+
$this->cleanup();
|
| 103 |
+
|
| 104 |
+
/* data arrays */
|
| 105 |
+
|
| 106 |
+
$this->createDataArrays();
|
| 107 |
+
|
| 108 |
+
/* check */
|
| 109 |
+
|
| 110 |
+
$this->checkQrCodeImageType();
|
| 111 |
+
$this->checkQrCodeModuleSize();
|
| 112 |
+
$this->checkQrCodeDataString();
|
| 113 |
+
$this->checkQrCodeStructureAppend();
|
| 114 |
+
|
| 115 |
+
/* determine */
|
| 116 |
+
|
| 117 |
+
$this->determineEncodeMode();
|
| 118 |
+
$this->determineEccMode();
|
| 119 |
+
$this->determineQrCodeVersion();
|
| 120 |
+
$this->determineTerminator();
|
| 121 |
+
|
| 122 |
+
/* method */
|
| 123 |
+
|
| 124 |
+
$this->divideDataEightBit();
|
| 125 |
+
$this->paddingCharacter();
|
| 126 |
+
$this->errorCorrection();
|
| 127 |
+
$this->flashMatrix();
|
| 128 |
+
$this->attachData();
|
| 129 |
+
$this->maskSelect();
|
| 130 |
+
$this->formatInformation();
|
| 131 |
+
$this->fillDataArray();
|
| 132 |
+
|
| 133 |
+
/* image */
|
| 134 |
+
|
| 135 |
+
$this->drawImage();
|
| 136 |
+
$this->outputImage();
|
| 137 |
+
|
| 138 |
+
/* cleanup */
|
| 139 |
+
|
| 140 |
+
$this->cleanup();
|
| 141 |
+
|
| 142 |
+
return $this;
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
/* setter */
|
| 146 |
+
|
| 147 |
+
public function setConfigDataPath($value)
|
| 148 |
+
{
|
| 149 |
+
$this->data_path = $value;
|
| 150 |
+
return $this;
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
public function setConfigImagePath($value)
|
| 154 |
+
{
|
| 155 |
+
$this->image_path = $value;
|
| 156 |
+
return $this;
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
public function setConfigVersion($value)
|
| 160 |
+
{
|
| 161 |
+
$this->version_ul = $value;
|
| 162 |
+
return $this;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
public function setQrCodeDataString($value)
|
| 166 |
+
{
|
| 167 |
+
$this->qrcode_data_string = @$value;
|
| 168 |
+
return $this;
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
public function setQrCodeErrorCorrect($value)
|
| 172 |
+
{
|
| 173 |
+
$value = strtoupper($value);
|
| 174 |
+
$values = array('L', 'M', 'Q', 'H');
|
| 175 |
+
|
| 176 |
+
if( in_array($value, $values) )
|
| 177 |
+
{
|
| 178 |
+
$this->qrcode_error_correct = @$value;
|
| 179 |
+
return $this;
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
return false;
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
public function setQrCodeModuleSize($value)
|
| 186 |
+
{
|
| 187 |
+
$this->qrcode_module_size = @$value;
|
| 188 |
+
return $this;
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
public function setQrCodeVersion($value)
|
| 192 |
+
{
|
| 193 |
+
$this->qrcode_version = @$value;
|
| 194 |
+
return $this;
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
public function setQrCodeImageType($value)
|
| 198 |
+
{
|
| 199 |
+
$this->qrcode_image_type = @$value;
|
| 200 |
+
return $this;
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
public function setQrCodeStructureAppendN($value)
|
| 204 |
+
{
|
| 205 |
+
$this->qrcode_structureappend_n = @$value;
|
| 206 |
+
return $this;
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
public function setQrCodeStructureAppendM($value)
|
| 210 |
+
{
|
| 211 |
+
$this->qrcode_structureappend_m = @$value;
|
| 212 |
+
return $this;
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
public function setQrCodeStructureAppendParity($value)
|
| 216 |
+
{
|
| 217 |
+
$this->qrcode_structureappend_parity = @$value;
|
| 218 |
+
return $this;
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
public function setQrCodeStructureAppendOriginalData($value)
|
| 222 |
+
{
|
| 223 |
+
$this->qrcode_structureappend_originaldata = @$value;
|
| 224 |
+
return $this;
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
/* getter */
|
| 228 |
+
|
| 229 |
+
public function getConfigDataPath($value)
|
| 230 |
+
{
|
| 231 |
+
return $this->data_path;
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
public function getConfigImagePath($value)
|
| 235 |
+
{
|
| 236 |
+
return $this->image_path;
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
public function getConfigVersion()
|
| 240 |
+
{
|
| 241 |
+
return $this->version_ul;
|
| 242 |
+
}
|
| 243 |
+
|
| 244 |
+
public function getQrCodeDataString()
|
| 245 |
+
{
|
| 246 |
+
return $this->qrcode_data_string;
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
public function getQrCodeErrorCorrect()
|
| 250 |
+
{
|
| 251 |
+
return $this->qrcode_error_correct;
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
public function getQrCodeModuleSize()
|
| 255 |
+
{
|
| 256 |
+
return $this->qrcode_module_size;
|
| 257 |
+
}
|
| 258 |
+
|
| 259 |
+
public function getQrCodeVersion()
|
| 260 |
+
{
|
| 261 |
+
return $this->qrcode_version;
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
public function getQrCodeImageType()
|
| 265 |
+
{
|
| 266 |
+
return $this->qrcode_image_type;
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
public function getQrCodeStructureAppendN()
|
| 270 |
+
{
|
| 271 |
+
return $this->qrcode_structureappend_n;
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
public function getQrCodeStructureAppendM()
|
| 275 |
+
{
|
| 276 |
+
return $this->qrcode_structureappend_m;
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
public function getQrCodeStructureAppendParity()
|
| 280 |
+
{
|
| 281 |
+
return $this->qrcode_structureappend_parity;
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
public function getQrCodeStructureAppendOriginalData()
|
| 285 |
+
{
|
| 286 |
+
return $this->qrcode_structureappend_originaldata;
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
/* data arrays */
|
| 290 |
+
|
| 291 |
+
public function createDataArrays()
|
| 292 |
+
{
|
| 293 |
+
$this->alphanumeric_character_hash = array("0"=>0, "1"=>1, "2"=>2, "3"=>3, "4"=>4, "5"=>5, "6"=>6, "7"=>7,
|
| 294 |
+
"8"=>8, "9"=>9, "A"=>10, "B"=>11, "C"=>12, "D"=>13, "E"=>14, "F"=>15,
|
| 295 |
+
"G"=>16, "H"=>17, "I"=>18, "J"=>19, "K"=>20, "L"=>21, "M"=>22, "N"=>23,
|
| 296 |
+
"O"=>24, "P"=>25, "Q"=>26, "R"=>27, "S"=>28, "T"=>29, "U"=>30, "V"=>31,
|
| 297 |
+
"W"=>32, "X"=>33, "Y"=>34, "Z"=>35, " "=>36, "$"=>37, "%"=>38, "*"=>39,
|
| 298 |
+
"+"=>40, "-"=>41, "."=>42, "/"=>43, ":"=>44);
|
| 299 |
+
|
| 300 |
+
$this->ecc_character_hash = array("L" => "1",
|
| 301 |
+
"M" => "0",
|
| 302 |
+
"Q" => "3",
|
| 303 |
+
"H" => "2");
|
| 304 |
+
|
| 305 |
+
$this->max_data_bits_array = array(0, 128, 224, 352, 512, 688, 864, 992, 1232, 1456, 1728,
|
| 306 |
+
2032, 2320, 2672, 2920, 3320, 3624, 4056, 4504, 5016, 5352,
|
| 307 |
+
5712, 6256, 6880, 7312, 8000, 8496, 9024, 9544, 10136, 10984,
|
| 308 |
+
11640, 12328, 13048, 13800, 14496, 15312, 15936, 16816, 17728, 18672,
|
| 309 |
+
152, 272, 440, 640, 864, 1088, 1248, 1552, 1856, 2192,
|
| 310 |
+
2592, 2960, 3424, 3688, 4184, 4712, 5176, 5768, 6360, 6888,
|
| 311 |
+
7456, 8048, 8752, 9392, 10208, 10960, 11744, 12248, 13048, 13880,
|
| 312 |
+
14744, 15640, 16568, 17528, 18448, 19472, 20528, 21616, 22496, 23648,
|
| 313 |
+
72, 128, 208, 288, 368, 480, 528, 688, 800, 976,
|
| 314 |
+
1120, 1264, 1440, 1576, 1784, 2024, 2264, 2504, 2728, 3080,
|
| 315 |
+
3248, 3536, 3712, 4112, 4304, 4768, 5024, 5288, 5608, 5960,
|
| 316 |
+
6344, 6760, 7208, 7688, 7888, 8432, 8768, 9136, 9776, 10208,
|
| 317 |
+
104, 176, 272, 384, 496, 608, 704, 880, 1056, 1232,
|
| 318 |
+
1440, 1648, 1952, 2088, 2360, 2600, 2936, 3176, 3560, 3880,
|
| 319 |
+
4096, 4544, 4912, 5312, 5744, 6032, 6464, 6968, 7288, 7880,
|
| 320 |
+
8264, 8920, 9368, 9848, 10288, 10832, 11408, 12016, 12656, 13328);
|
| 321 |
+
|
| 322 |
+
$this->max_codewords_array = array(0, 26, 44, 70, 100, 134, 172, 196, 242, 292, 346, 404,
|
| 323 |
+
466, 532, 581, 655, 733, 815, 901, 991, 1085, 1156, 1258, 1364,
|
| 324 |
+
1474, 1588, 1706, 1828, 1921, 2051, 2185, 2323, 2465, 2611, 2761, 2876,
|
| 325 |
+
3034, 3196, 3362, 3532, 3706);
|
| 326 |
+
|
| 327 |
+
$this->matrix_remain_bit = array(0, 0, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3,
|
| 328 |
+
4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0);
|
| 329 |
+
|
| 330 |
+
$this->format_information_x1 = array(0, 1, 2, 3, 4, 5, 7, 8, 8, 8, 8, 8, 8, 8, 8);
|
| 331 |
+
|
| 332 |
+
$this->format_information_y1 = array(8, 8, 8, 8, 8, 8, 8, 8, 7, 5, 4, 3, 2, 1, 0);
|
| 333 |
+
|
| 334 |
+
$this->format_information_array = array("101010000010010", "101000100100101", "101111001111100", "101101101001011",
|
| 335 |
+
"100010111111001", "100000011001110", "100111110010111", "100101010100000",
|
| 336 |
+
"111011111000100", "111001011110011", "111110110101010", "111100010011101",
|
| 337 |
+
"110011000101111", "110001100011000", "110110001000001", "110100101110110",
|
| 338 |
+
"001011010001001", "001001110111110", "001110011100111", "001100111010000",
|
| 339 |
+
"000011101100010", "000001001010101", "000110100001100", "000100000111011",
|
| 340 |
+
"011010101011111", "011000001101000", "011111100110001", "011101000000110",
|
| 341 |
+
"010010010110100", "010000110000011", "010111011011010", "010101111101101");
|
| 342 |
+
|
| 343 |
+
return $this;
|
| 344 |
+
}
|
| 345 |
+
|
| 346 |
+
/* check */
|
| 347 |
+
|
| 348 |
+
private function checkQrCodeConfig()
|
| 349 |
+
{
|
| 350 |
+
/* old */
|
| 351 |
+
/* if( empty($this->data_path) || empty($this->image_path) ) */
|
| 352 |
+
if( empty($this->data_path) )
|
| 353 |
+
{
|
| 354 |
+
return false;
|
| 355 |
+
}
|
| 356 |
+
|
| 357 |
+
if( empty($this->version_ul) )
|
| 358 |
+
{
|
| 359 |
+
$this->setConfigVersion("40");
|
| 360 |
+
}
|
| 361 |
+
|
| 362 |
+
return true;
|
| 363 |
+
}
|
| 364 |
+
|
| 365 |
+
private function checkQrCodeImageType()
|
| 366 |
+
{
|
| 367 |
+
if ( $this->qrcode_image_type == "J" || $this->qrcode_image_type == "j" )
|
| 368 |
+
{
|
| 369 |
+
$this->qrcode_image_type = "jpeg";
|
| 370 |
+
}
|
| 371 |
+
else
|
| 372 |
+
{
|
| 373 |
+
$this->qrcode_image_type = "png";
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
return $this;
|
| 377 |
+
}
|
| 378 |
+
|
| 379 |
+
private function checkQrCodeModuleSize()
|
| 380 |
+
{
|
| 381 |
+
if ( $this->qrcode_module_size <= 0 )
|
| 382 |
+
{
|
| 383 |
+
if ( $this->qrcode_image_type == "jpeg" )
|
| 384 |
+
{
|
| 385 |
+
$this->qrcode_module_size = 8;
|
| 386 |
+
}
|
| 387 |
+
else
|
| 388 |
+
{
|
| 389 |
+
$this->qrcode_module_size = 4;
|
| 390 |
+
}
|
| 391 |
+
}
|
| 392 |
+
|
| 393 |
+
return $this;
|
| 394 |
+
}
|
| 395 |
+
|
| 396 |
+
private function checkQrCodeDataString()
|
| 397 |
+
{
|
| 398 |
+
$this->qrcode_data_string = rawurldecode($this->qrcode_data_string);
|
| 399 |
+
$this->data_length = strlen($this->qrcode_data_string);
|
| 400 |
+
|
| 401 |
+
if ( $this->data_length <= 0 )
|
| 402 |
+
{
|
| 403 |
+
trigger_error("Swetake QR Code: No Data.", E_USER_ERROR);
|
| 404 |
+
exit;
|
| 405 |
+
}
|
| 406 |
+
|
| 407 |
+
$this->data_counter = 0;
|
| 408 |
+
return $this;
|
| 409 |
+
}
|
| 410 |
+
|
| 411 |
+
private function checkQrCodeStructureAppend()
|
| 412 |
+
{
|
| 413 |
+
if ( $this->qrcode_structureappend_n > 1 && $this->qrcode_structureappend_n <= 16
|
| 414 |
+
&& $this->qrcode_structureappend_m > 0 && $this->qrcode_structureqppend_m <= 16 )
|
| 415 |
+
{
|
| 416 |
+
$this->data_value[0] = 3;
|
| 417 |
+
$this->data_bits[0] = 4;
|
| 418 |
+
|
| 419 |
+
$this->data_value[1] = $this->qrcode_structureappend_m - 1;
|
| 420 |
+
$this->data_bits[1] = 4;
|
| 421 |
+
|
| 422 |
+
$this->data_value[2] = $this->qrcode_structureappend_n - 1;
|
| 423 |
+
$this->data_bits[2] = 4;
|
| 424 |
+
|
| 425 |
+
$originaldata_length = strlen($this->qrcode_structureappend_originaldata);
|
| 426 |
+
|
| 427 |
+
if ( $originaldata_length > 1 )
|
| 428 |
+
{
|
| 429 |
+
$this->qrcode_structureappend_parity = 0;
|
| 430 |
+
|
| 431 |
+
for( $i = 0; $i < $originaldata_length; $i++ )
|
| 432 |
+
{
|
| 433 |
+
$this->qrcode_structureappend_parity = ($this->qrcode_structureappend_parity ^ ord(substr($this->qrcode_structureappend_originaldata, $i, 1)));
|
| 434 |
+
}
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
$this->data_value[3] = $this->qrcode_structureappend_parity;
|
| 438 |
+
$this->data_bits[3] = 8;
|
| 439 |
+
|
| 440 |
+
$this->data_counter = 4;
|
| 441 |
+
}
|
| 442 |
+
|
| 443 |
+
$this->data_bits[$this->data_counter] = 4;
|
| 444 |
+
return $this;
|
| 445 |
+
}
|
| 446 |
+
|
| 447 |
+
/* determine */
|
| 448 |
+
|
| 449 |
+
private function determineEncodeMode()
|
| 450 |
+
{
|
| 451 |
+
if ( preg_match("/[^0-9]/", $this->qrcode_data_string) != 0 )
|
| 452 |
+
{
|
| 453 |
+
if ( preg_match("/[^0-9A-Z \$\*\%\+\.\/\:\-]/", $this->qrcode_data_string) != 0 )
|
| 454 |
+
{
|
| 455 |
+
$this->codeword_num_plus = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
| 456 |
+
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
|
| 457 |
+
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8);
|
| 458 |
+
|
| 459 |
+
$this->data_value[$this->data_counter] = 4;
|
| 460 |
+
$this->data_counter++;
|
| 461 |
+
$this->data_value[$this->data_counter] = $this->data_length;
|
| 462 |
+
$this->data_bits[$this->data_counter] = 8;
|
| 463 |
+
$this->codeword_num_counter_value = $this->data_counter;
|
| 464 |
+
$this->data_counter++;
|
| 465 |
+
|
| 466 |
+
for($i = 0; $i < $this->data_length; $i++)
|
| 467 |
+
{
|
| 468 |
+
$this->data_value[$this->data_counter] = ord(substr($this->qrcode_data_string, $i, 1));
|
| 469 |
+
$this->data_bits[$this->data_counter] = 8;
|
| 470 |
+
$this->data_counter++;
|
| 471 |
+
}
|
| 472 |
+
}
|
| 473 |
+
else
|
| 474 |
+
{
|
| 475 |
+
$this->codeword_num_plus = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
| 476 |
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
| 477 |
+
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4);
|
| 478 |
+
|
| 479 |
+
$this->data_value[$this->data_counter] = 2;
|
| 480 |
+
$this->data_counter++;
|
| 481 |
+
$this->data_value[$this->data_counter] = $this->data_length;
|
| 482 |
+
$this->data_bits[$this->data_counter] = 9;
|
| 483 |
+
$this->codeword_num_counter_value = $this->data_counter;
|
| 484 |
+
|
| 485 |
+
$this->data_counter++;
|
| 486 |
+
|
| 487 |
+
for($i = 0; $i < $this->data_length; $i++)
|
| 488 |
+
{
|
| 489 |
+
if ( ($i %2) == 0 )
|
| 490 |
+
{
|
| 491 |
+
$this->data_value[$data_counter] = $alphanumeric_character_hash[substr($this->qrcode_data_string, $i, 1)];
|
| 492 |
+
$this->data_bits[$data_counter] = 6;
|
| 493 |
+
}
|
| 494 |
+
else
|
| 495 |
+
{
|
| 496 |
+
$this->data_value[$this->data_counter] = $this->data_value[$this->data_counter] * 45 + $alphanumeric_character_hash[substr($this->qrcode_data_string, $i, 1)];
|
| 497 |
+
$this->data_bits[$this->data_counter] = 11;
|
| 498 |
+
$this->data_counter++;
|
| 499 |
+
}
|
| 500 |
+
}
|
| 501 |
+
}
|
| 502 |
+
}
|
| 503 |
+
else
|
| 504 |
+
{
|
| 505 |
+
$this->codeword_num_plus = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
| 506 |
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
| 507 |
+
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4);
|
| 508 |
+
|
| 509 |
+
$this->data_value[$this->data_counter] = 1;
|
| 510 |
+
$this->data_counter++;
|
| 511 |
+
$this->data_value[$this->data_counter] = $this->data_length;
|
| 512 |
+
$this->data_bits[$this->data_counter] = 10;
|
| 513 |
+
$this->codeword_num_counter_value = $this->data_counter;
|
| 514 |
+
$this->data_counter++;
|
| 515 |
+
|
| 516 |
+
for($i = 0; $i < $this->data_length; $i++)
|
| 517 |
+
{
|
| 518 |
+
if ( ($i % 3) == 0 )
|
| 519 |
+
{
|
| 520 |
+
$this->data_value[$this->data_counter] = substr($this->qrcode_data_string, $i, 1);
|
| 521 |
+
$this->data_bits[$this->data_counter] = 4;
|
| 522 |
+
}
|
| 523 |
+
else
|
| 524 |
+
{
|
| 525 |
+
$this->data_value[$this->data_counter] = $this->data_value[$this->data_counter] * 10 + substr($this->qrcode_data_string, $i, 1);
|
| 526 |
+
|
| 527 |
+
if ( ($i % 3) == 1 )
|
| 528 |
+
{
|
| 529 |
+
$this->data_bits[$this->data_counter] = 7;
|
| 530 |
+
}
|
| 531 |
+
else
|
| 532 |
+
{
|
| 533 |
+
$this->data_bits[$this->data_counter] = 10;
|
| 534 |
+
$this->data_counter++;
|
| 535 |
+
}
|
| 536 |
+
}
|
| 537 |
+
}
|
| 538 |
+
}
|
| 539 |
+
|
| 540 |
+
if ( @$this->data_bits[$this->data_counter] > 0 )
|
| 541 |
+
{
|
| 542 |
+
$this->data_counter++;
|
| 543 |
+
}
|
| 544 |
+
|
| 545 |
+
$this->total_data_bits = 0;
|
| 546 |
+
|
| 547 |
+
for($i = 0; $i < $this->data_counter; $i++)
|
| 548 |
+
{
|
| 549 |
+
$this->total_data_bits += $this->data_bits[$i];
|
| 550 |
+
}
|
| 551 |
+
|
| 552 |
+
return $this;
|
| 553 |
+
}
|
| 554 |
+
|
| 555 |
+
private function determineEccMode()
|
| 556 |
+
{
|
| 557 |
+
$this->error_correct_mode = @$ecc_character_hash[$this->qrcode_error_correct];
|
| 558 |
+
|
| 559 |
+
if ( !$this->error_correct_mode )
|
| 560 |
+
{
|
| 561 |
+
$this->error_correct_mode = 0;
|
| 562 |
+
}
|
| 563 |
+
|
| 564 |
+
return $this;
|
| 565 |
+
}
|
| 566 |
+
|
| 567 |
+
private function determineQrCodeVersion()
|
| 568 |
+
{
|
| 569 |
+
if ( !is_numeric($this->qrcode_version) )
|
| 570 |
+
{
|
| 571 |
+
$this->qrcode_version = 0;
|
| 572 |
+
}
|
| 573 |
+
|
| 574 |
+
if ( !$this->qrcode_version )
|
| 575 |
+
{
|
| 576 |
+
$i = 1 + 40 * $this->error_correct_mode;
|
| 577 |
+
$j = $i + 39;
|
| 578 |
+
$this->qrcode_version = 1;
|
| 579 |
+
|
| 580 |
+
while ( $i <= $j )
|
| 581 |
+
{
|
| 582 |
+
if ( $this->max_data_bits_array[$i] >= $this->total_data_bits + $this->codeword_num_plus[$this->qrcode_version] )
|
| 583 |
+
{
|
| 584 |
+
$this->max_data_bits = $this->max_data_bits_array[$i];
|
| 585 |
+
break;
|
| 586 |
+
}
|
| 587 |
+
|
| 588 |
+
$i++;
|
| 589 |
+
$this->qrcode_version++;
|
| 590 |
+
}
|
| 591 |
+
|
| 592 |
+
}
|
| 593 |
+
else
|
| 594 |
+
{
|
| 595 |
+
$this->max_data_bits = $this->max_data_bits_array[$this->qrcode_version + 40 * $this->error_correct_mode];
|
| 596 |
+
}
|
| 597 |
+
|
| 598 |
+
if ( $this->qrcode_version > $this->version_ul )
|
| 599 |
+
{
|
| 600 |
+
trigger_error("Swetake QR Code: too large version.", E_USER_ERROR);
|
| 601 |
+
}
|
| 602 |
+
|
| 603 |
+
$this->total_data_bits += $this->codeword_num_plus[$this->qrcode_version];
|
| 604 |
+
$this->data_bits[$this->codeword_num_counter_value] += $this->codeword_num_plus[$this->qrcode_version];
|
| 605 |
+
|
| 606 |
+
$this->max_codewords = $this->max_codewords_array[$this->qrcode_version];
|
| 607 |
+
$this->max_modules_1side = 17 + ($this->qrcode_version <<2);
|
| 608 |
+
|
| 609 |
+
$this->byte_num = $this->matrix_remain_bit[$this->qrcode_version] + ($this->max_codewords << 3);
|
| 610 |
+
$filename = $this->data_path . "/qrv" . $this->qrcode_version . "_" . $this->error_correct_mode . ".dat";
|
| 611 |
+
|
| 612 |
+
$fp1 = fopen ($filename, "rb");
|
| 613 |
+
|
| 614 |
+
$matx = fread($fp1, $this->byte_num);
|
| 615 |
+
$maty = fread($fp1, $this->byte_num);
|
| 616 |
+
$masks = fread($fp1, $this->byte_num);
|
| 617 |
+
|
| 618 |
+
$fi_x = fread($fp1, 15);
|
| 619 |
+
$fi_y = fread($fp1, 15);
|
| 620 |
+
|
| 621 |
+
$this->rs_ecc_codewords = ord(fread($fp1, 1));
|
| 622 |
+
$rso = fread($fp1, 128);
|
| 623 |
+
fclose($fp1);
|
| 624 |
+
|
| 625 |
+
$this->matrix_x_array = unpack("C*", $matx);
|
| 626 |
+
$this->matrix_y_array = unpack("C*", $maty);
|
| 627 |
+
$this->mask_array = unpack("C*", $masks);
|
| 628 |
+
|
| 629 |
+
$this->rs_block_order =unpack("C*", $rso);
|
| 630 |
+
|
| 631 |
+
$this->format_information_x2 = unpack("C*", $fi_x);
|
| 632 |
+
$this->format_information_y2 = unpack("C*", $fi_y);
|
| 633 |
+
|
| 634 |
+
$this->max_data_codewords = ($this->max_data_bits >>3);
|
| 635 |
+
|
| 636 |
+
$filename = $this->data_path . "/rsc" . $this->rs_ecc_codewords . ".dat";
|
| 637 |
+
$fp0 = fopen ($filename, "rb");
|
| 638 |
+
|
| 639 |
+
for($i = 0; $i < 256; $i++)
|
| 640 |
+
{
|
| 641 |
+
$this->rs_cal_table_array[$i] = fread($fp0, $this->rs_ecc_codewords);
|
| 642 |
+
}
|
| 643 |
+
|
| 644 |
+
fclose ($fp0);
|
| 645 |
+
|
| 646 |
+
$filename = $this->data_path . "/qrvfr" . $this->qrcode_version . ".dat";
|
| 647 |
+
$fp0 = fopen ($filename, "rb");
|
| 648 |
+
$this->frame_data = fread ($fp0, filesize ($filename));
|
| 649 |
+
|
| 650 |
+
fclose ($fp0);
|
| 651 |
+
|
| 652 |
+
return $this;
|
| 653 |
+
}
|
| 654 |
+
|
| 655 |
+
private function determineTerminator()
|
| 656 |
+
{
|
| 657 |
+
if ( $this->total_data_bits <= $this->max_data_bits - 4 )
|
| 658 |
+
{
|
| 659 |
+
$this->data_value[$this->data_counter] = 0;
|
| 660 |
+
$this->data_bits[$this->data_counter] = 4;
|
| 661 |
+
}
|
| 662 |
+
else
|
| 663 |
+
{
|
| 664 |
+
if ( $this->total_data_bits < $this->max_data_bits )
|
| 665 |
+
{
|
| 666 |
+
$this->data_value[$this->data_counter] = 0;
|
| 667 |
+
$this->data_bits[$this->data_counter] = $this->max_data_bits - $this->total_data_bits;
|
| 668 |
+
}
|
| 669 |
+
else
|
| 670 |
+
{
|
| 671 |
+
if ( $this->total_data_bits > $this->max_data_bits )
|
| 672 |
+
{
|
| 673 |
+
trigger_error("Swetake QR Code: Overflow error.", E_USER_ERROR);
|
| 674 |
+
exit;
|
| 675 |
+
}
|
| 676 |
+
}
|
| 677 |
+
}
|
| 678 |
+
|
| 679 |
+
return $this;
|
| 680 |
+
}
|
| 681 |
+
|
| 682 |
+
/* method */
|
| 683 |
+
|
| 684 |
+
private function divideDataEightBit()
|
| 685 |
+
{
|
| 686 |
+
$this->codewords_counter = 0;
|
| 687 |
+
$this->codewords[0] = 0;
|
| 688 |
+
$remaining_bits = 8;
|
| 689 |
+
|
| 690 |
+
for($i = 0; $i <= $this->data_counter; $i++)
|
| 691 |
+
{
|
| 692 |
+
$buffer = @$this->data_value[$i];
|
| 693 |
+
$buffer_bits = @$this->data_bits[$i];
|
| 694 |
+
|
| 695 |
+
$flag = true;
|
| 696 |
+
|
| 697 |
+
while( $flag )
|
| 698 |
+
{
|
| 699 |
+
if ( $remaining_bits > $buffer_bits )
|
| 700 |
+
{
|
| 701 |
+
$this->codewords[$this->codewords_counter] = ((@$this->codewords[$this->codewords_counter]<<$buffer_bits) | $buffer);
|
| 702 |
+
$remaining_bits -= $buffer_bits;
|
| 703 |
+
|
| 704 |
+
$flag = false;
|
| 705 |
+
}
|
| 706 |
+
else
|
| 707 |
+
{
|
| 708 |
+
$buffer_bits -= $remaining_bits;
|
| 709 |
+
$this->codewords[$this->codewords_counter] = (($this->codewords[$this->codewords_counter] << $remaining_bits) | ($buffer >> $buffer_bits));
|
| 710 |
+
|
| 711 |
+
if ( $buffer_bits == 0 )
|
| 712 |
+
{
|
| 713 |
+
$flag = false;
|
| 714 |
+
}
|
| 715 |
+
else
|
| 716 |
+
{
|
| 717 |
+
$buffer = ($buffer & ((1 << $buffer_bits)-1) );
|
| 718 |
+
$flag = true;
|
| 719 |
+
}
|
| 720 |
+
|
| 721 |
+
$this->codewords_counter++;
|
| 722 |
+
|
| 723 |
+
if ( $this->codewords_counter < $this->max_data_codewords - 1 )
|
| 724 |
+
{
|
| 725 |
+
$this->codewords[$this->codewords_counter] = 0;
|
| 726 |
+
}
|
| 727 |
+
|
| 728 |
+
$remaining_bits = 8;
|
| 729 |
+
}
|
| 730 |
+
}
|
| 731 |
+
}
|
| 732 |
+
|
| 733 |
+
if ( $remaining_bits != 8 )
|
| 734 |
+
{
|
| 735 |
+
$this->codewords[$this->codewords_counter] = $this->codewords[$this->codewords_counter] << $remaining_bits;
|
| 736 |
+
}
|
| 737 |
+
else
|
| 738 |
+
{
|
| 739 |
+
$this->codewords_counter--;
|
| 740 |
+
}
|
| 741 |
+
|
| 742 |
+
return $this;
|
| 743 |
+
}
|
| 744 |
+
|
| 745 |
+
private function paddingCharacter()
|
| 746 |
+
{
|
| 747 |
+
if ( $this->codewords_counter < $this->max_data_codewords - 1 )
|
| 748 |
+
{
|
| 749 |
+
$flag = 1;
|
| 750 |
+
|
| 751 |
+
while ( $this->codewords_counter < $this->max_data_codewords - 1 )
|
| 752 |
+
{
|
| 753 |
+
$this->codewords_counter++;
|
| 754 |
+
|
| 755 |
+
if ( $flag == true)
|
| 756 |
+
{
|
| 757 |
+
$this->codewords[$this->codewords_counter] = 236;
|
| 758 |
+
}
|
| 759 |
+
else
|
| 760 |
+
{
|
| 761 |
+
$this->codewords[$this->codewords_counter] = 17;
|
| 762 |
+
}
|
| 763 |
+
|
| 764 |
+
$flag = $flag * (-1);
|
| 765 |
+
}
|
| 766 |
+
}
|
| 767 |
+
|
| 768 |
+
return $this;
|
| 769 |
+
}
|
| 770 |
+
|
| 771 |
+
private function errorCorrection()
|
| 772 |
+
{
|
| 773 |
+
$j = 0;
|
| 774 |
+
$rs_block_number = 0;
|
| 775 |
+
$rs_temp[0] = "";
|
| 776 |
+
|
| 777 |
+
for($i = 0; $i < $this->max_data_codewords; $i++)
|
| 778 |
+
{
|
| 779 |
+
$rs_temp[$rs_block_number] .= chr($this->codewords[$i]);
|
| 780 |
+
$j++;
|
| 781 |
+
|
| 782 |
+
if ( $j >= $this->rs_block_order[$rs_block_number + 1] - $this->rs_ecc_codewords )
|
| 783 |
+
{
|
| 784 |
+
$j = 0;
|
| 785 |
+
$rs_block_number++;
|
| 786 |
+
$rs_temp[$rs_block_number] = "";
|
| 787 |
+
}
|
| 788 |
+
}
|
| 789 |
+
|
| 790 |
+
$rs_block_number = 0;
|
| 791 |
+
$rs_block_order_num = count($this->rs_block_order);
|
| 792 |
+
|
| 793 |
+
while ( $rs_block_number < $rs_block_order_num )
|
| 794 |
+
{
|
| 795 |
+
$rs_codewords = $this->rs_block_order[$rs_block_number + 1];
|
| 796 |
+
$rs_data_codewords = $rs_codewords - $this->rs_ecc_codewords;
|
| 797 |
+
|
| 798 |
+
$rstemp = $rs_temp[$rs_block_number] . str_repeat(chr(0), $this->rs_ecc_codewords);
|
| 799 |
+
$padding_data = str_repeat(chr(0), $rs_data_codewords);
|
| 800 |
+
|
| 801 |
+
$j = $rs_data_codewords;
|
| 802 |
+
|
| 803 |
+
while( $j > 0 )
|
| 804 |
+
{
|
| 805 |
+
$first = ord(substr($rstemp, 0, 1));
|
| 806 |
+
|
| 807 |
+
if ( $first )
|
| 808 |
+
{
|
| 809 |
+
$left_chr = substr($rstemp, 1);
|
| 810 |
+
$cal = $this->rs_cal_table_array[$first] . $padding_data;
|
| 811 |
+
$rstemp = $left_chr ^ $cal;
|
| 812 |
+
}
|
| 813 |
+
else
|
| 814 |
+
{
|
| 815 |
+
$rstemp = substr($rstemp, 1);
|
| 816 |
+
}
|
| 817 |
+
|
| 818 |
+
$j--;
|
| 819 |
+
}
|
| 820 |
+
|
| 821 |
+
$this->codewords = array_merge($this->codewords, unpack("C*", $rstemp));
|
| 822 |
+
|
| 823 |
+
$rs_block_number++;
|
| 824 |
+
}
|
| 825 |
+
|
| 826 |
+
return $this;
|
| 827 |
+
}
|
| 828 |
+
|
| 829 |
+
private function flashMatrix()
|
| 830 |
+
{
|
| 831 |
+
for($i = 0; $i < $this->max_modules_1side; $i++)
|
| 832 |
+
{
|
| 833 |
+
for($j = 0; $j < $this->max_modules_1side; $j++)
|
| 834 |
+
{
|
| 835 |
+
$this->matrix_content[$j][$i] = 0;
|
| 836 |
+
}
|
| 837 |
+
}
|
| 838 |
+
|
| 839 |
+
return $this;
|
| 840 |
+
}
|
| 841 |
+
|
| 842 |
+
private function attachData()
|
| 843 |
+
{
|
| 844 |
+
for($i = 0; $i < $this->max_codewords; $i++)
|
| 845 |
+
{
|
| 846 |
+
$codeword_i = $this->codewords[$i];
|
| 847 |
+
$j=8;
|
| 848 |
+
|
| 849 |
+
while ( $j >= 1 )
|
| 850 |
+
{
|
| 851 |
+
$codeword_bits_number = ($i << 3) + $j;
|
| 852 |
+
$this->matrix_content[ $this->matrix_x_array[$codeword_bits_number] ][ $this->matrix_y_array[$codeword_bits_number] ]=((255 * ($codeword_i & 1)) ^ $this->mask_array[$codeword_bits_number] );
|
| 853 |
+
$codeword_i = $codeword_i >> 1;
|
| 854 |
+
$j--;
|
| 855 |
+
}
|
| 856 |
+
}
|
| 857 |
+
|
| 858 |
+
$matrix_remain = $this->matrix_remain_bit[$this->qrcode_version];
|
| 859 |
+
|
| 860 |
+
while ($matrix_remain)
|
| 861 |
+
{
|
| 862 |
+
$remain_bit_temp = $matrix_remain + ( $this->max_codewords <<3);
|
| 863 |
+
$matrix_content[ $this->matrix_x_array[$remain_bit_temp] ][ $this->matrix_y_array[$remain_bit_temp] ] = ( 255 ^ $this->mask_array[$remain_bit_temp] );
|
| 864 |
+
$matrix_remain--;
|
| 865 |
+
}
|
| 866 |
+
|
| 867 |
+
return $this;
|
| 868 |
+
}
|
| 869 |
+
|
| 870 |
+
private function maskSelect()
|
| 871 |
+
{
|
| 872 |
+
$min_demerit_score = 0;
|
| 873 |
+
$hor_master = "";
|
| 874 |
+
$ver_master = "";
|
| 875 |
+
|
| 876 |
+
for($i = 0; $i < $this->max_modules_1side; $i++)
|
| 877 |
+
{
|
| 878 |
+
for($j = 0; $j < $this->max_modules_1side; $j++)
|
| 879 |
+
{
|
| 880 |
+
$hor_master = $hor_master . chr($this->matrix_content[$j][$i]);
|
| 881 |
+
$ver_master = $ver_master . chr($this->matrix_content[$i][$j]);
|
| 882 |
+
}
|
| 883 |
+
}
|
| 884 |
+
|
| 885 |
+
$all_matrix = $this->max_modules_1side * $this->max_modules_1side;
|
| 886 |
+
|
| 887 |
+
for($i = 0; $i < 8; $i++)
|
| 888 |
+
{
|
| 889 |
+
$demerit_n1 = 0;
|
| 890 |
+
$ptn_temp = array();
|
| 891 |
+
$bit = 1<< $i;
|
| 892 |
+
$bit_r = (~$bit)&255;
|
| 893 |
+
$bit_mask = str_repeat(chr($bit), $all_matrix);
|
| 894 |
+
$hor = $hor_master & $bit_mask;
|
| 895 |
+
$ver = $ver_master & $bit_mask;
|
| 896 |
+
|
| 897 |
+
$ver_shift1 = $ver.str_repeat(chr(170), $this->max_modules_1side);
|
| 898 |
+
$ver_shift2 = str_repeat(chr(170), $this->max_modules_1side) . $ver;
|
| 899 |
+
$ver_shift1_0 = $ver.str_repeat(chr(0), $this->max_modules_1side);
|
| 900 |
+
$ver_shift2_0 = str_repeat(chr(0), $this->max_modules_1side) . $ver;
|
| 901 |
+
$ver_or = chunk_split(~($ver_shift1 | $ver_shift2), $this->max_modules_1side, chr(170));
|
| 902 |
+
$ver_and = chunk_split(~($ver_shift1_0 & $ver_shift2_0), $this->max_modules_1side, chr(170));
|
| 903 |
+
|
| 904 |
+
$hor = chunk_split(~$hor ,$this->max_modules_1side, chr(170));
|
| 905 |
+
$ver = chunk_split(~$ver, $this->max_modules_1side, chr(170));
|
| 906 |
+
$hor = $hor . chr(170) . $ver;
|
| 907 |
+
|
| 908 |
+
$n1_search ="/" . str_repeat(chr(255), 5) . "+|" . str_repeat(chr($bit_r), 5) . "+/";
|
| 909 |
+
$n3_search = chr($bit_r) . chr(255) .chr($bit_r) . chr($bit_r) . chr($bit_r) . chr(255) . chr($bit_r);
|
| 910 |
+
|
| 911 |
+
$demerit_n3 = substr_count($hor, $n3_search) * 40;
|
| 912 |
+
$demerit_n4 = floor(abs(( (100 * (substr_count($ver, chr($bit_r)) / ($this->byte_num)) ) - 50) / 5)) * 10;
|
| 913 |
+
|
| 914 |
+
$n2_search1 = "/" . chr($bit_r) . chr($bit_r) . "+/";
|
| 915 |
+
$n2_search2 = "/" . chr(255) . chr(255) . "+/";
|
| 916 |
+
$demerit_n2 = 0;
|
| 917 |
+
preg_match_all($n2_search1, $ver_and, $ptn_temp);
|
| 918 |
+
|
| 919 |
+
foreach($ptn_temp[0] as $str_temp)
|
| 920 |
+
{
|
| 921 |
+
$demerit_n2 += (strlen($str_temp) - 1);
|
| 922 |
+
}
|
| 923 |
+
|
| 924 |
+
$ptn_temp = array();
|
| 925 |
+
preg_match_all($n2_search2, $ver_or, $ptn_temp);
|
| 926 |
+
|
| 927 |
+
foreach($ptn_temp[0] as $str_temp)
|
| 928 |
+
{
|
| 929 |
+
$demerit_n2 += (strlen($str_temp) - 1);
|
| 930 |
+
}
|
| 931 |
+
|
| 932 |
+
$demerit_n2 *= 3;
|
| 933 |
+
$ptn_temp = array();
|
| 934 |
+
preg_match_all($n1_search, $hor, $ptn_temp);
|
| 935 |
+
|
| 936 |
+
foreach($ptn_temp[0] as $str_temp)
|
| 937 |
+
{
|
| 938 |
+
$demerit_n1 += (strlen($str_temp) - 2);
|
| 939 |
+
}
|
| 940 |
+
|
| 941 |
+
$demerit_score = $demerit_n1 + $demerit_n2 + $demerit_n3 + $demerit_n4;
|
| 942 |
+
|
| 943 |
+
if ( $demerit_score <= $min_demerit_score || $i == 0 )
|
| 944 |
+
{
|
| 945 |
+
$this->mask_number = $i;
|
| 946 |
+
$min_demerit_score = $demerit_score;
|
| 947 |
+
}
|
| 948 |
+
|
| 949 |
+
}
|
| 950 |
+
|
| 951 |
+
$this->mask_content = 1 << $this->mask_number;
|
| 952 |
+
return $this;
|
| 953 |
+
}
|
| 954 |
+
|
| 955 |
+
private function formatInformation()
|
| 956 |
+
{
|
| 957 |
+
$format_information_value = (($this->error_correct_mode << 3) | $this->mask_number);
|
| 958 |
+
|
| 959 |
+
for ($i = 0; $i < 15; $i++)
|
| 960 |
+
{
|
| 961 |
+
$content = substr($this->format_information_array[$format_information_value],$i,1);
|
| 962 |
+
|
| 963 |
+
$this->matrix_content[$this->format_information_x1[$i]][$this->format_information_y1[$i]] = $content * 255;
|
| 964 |
+
$this->matrix_content[$this->format_information_x2[$i+1]][$this->format_information_y2[$i+1]] = $content * 255;
|
| 965 |
+
}
|
| 966 |
+
|
| 967 |
+
$this->mib = $this->max_modules_1side + 8;
|
| 968 |
+
$this->qrcode_image_size = $this->mib * $this->qrcode_module_size;
|
| 969 |
+
|
| 970 |
+
if ( $this->qrcode_image_size > 1480 )
|
| 971 |
+
{
|
| 972 |
+
trigger_error("Swetake QR Code: Too large image size.", E_USER_ERROR);
|
| 973 |
+
}
|
| 974 |
+
|
| 975 |
+
/* old */
|
| 976 |
+
/*
|
| 977 |
+
|
| 978 |
+
$this->output_image = imagecreate($this->qrcode_image_size, $this->qrcode_image_size);
|
| 979 |
+
$this->image_path = $this->image_path . "/qrv" . $this->qrcode_version . ".png";
|
| 980 |
+
$this->base_image = imagecreatefrompng($this->image_path);
|
| 981 |
+
|
| 982 |
+
$col[1] = imagecolorallocate($this->base_image, 0, 0, 0);
|
| 983 |
+
$col[0] = imagecolorallocate($this->base_image, 255, 255, 255);
|
| 984 |
+
|
| 985 |
+
$mxe = 4 + $this->max_modules_1side;
|
| 986 |
+
$outer = 0;
|
| 987 |
+
|
| 988 |
+
for($i = 4; $i < $mxe; $i++)
|
| 989 |
+
{
|
| 990 |
+
$inner = 0;
|
| 991 |
+
|
| 992 |
+
for($j = 4; $j < $mxe; $j++)
|
| 993 |
+
{
|
| 994 |
+
if ($this->matrix_content[$outer][$inner] & $this->mask_content)
|
| 995 |
+
{
|
| 996 |
+
imagesetpixel($this->base_image, $i, $j, $col[1]);
|
| 997 |
+
}
|
| 998 |
+
|
| 999 |
+
$inner++;
|
| 1000 |
+
}
|
| 1001 |
+
|
| 1002 |
+
$outer++;
|
| 1003 |
+
}
|
| 1004 |
+
|
| 1005 |
+
imagecopyresized($this->output_image,
|
| 1006 |
+
$this->base_image,
|
| 1007 |
+
0,
|
| 1008 |
+
0,
|
| 1009 |
+
0,
|
| 1010 |
+
0,
|
| 1011 |
+
$this->qrcode_image_size,
|
| 1012 |
+
$this->qrcode_image_size,
|
| 1013 |
+
$this->mib,
|
| 1014 |
+
$this->mib);
|
| 1015 |
+
|
| 1016 |
+
*/
|
| 1017 |
+
/* old */
|
| 1018 |
+
|
| 1019 |
+
return $this;
|
| 1020 |
+
}
|
| 1021 |
+
|
| 1022 |
+
private function fillDataArray()
|
| 1023 |
+
{
|
| 1024 |
+
$buffer = "";
|
| 1025 |
+
$mxe = $this->max_modules_1side;
|
| 1026 |
+
|
| 1027 |
+
for($i = 0; $i < $mxe; $i++)
|
| 1028 |
+
{
|
| 1029 |
+
for($j = 0; $j < $mxe; $j++)
|
| 1030 |
+
{
|
| 1031 |
+
if ( $this->matrix_content[$j][$i] & $this->mask_content )
|
| 1032 |
+
{
|
| 1033 |
+
$buffer .= "1";
|
| 1034 |
+
}
|
| 1035 |
+
else
|
| 1036 |
+
{
|
| 1037 |
+
$buffer .= "0";
|
| 1038 |
+
}
|
| 1039 |
+
}
|
| 1040 |
+
|
| 1041 |
+
$buffer .= "\n";
|
| 1042 |
+
}
|
| 1043 |
+
|
| 1044 |
+
$this->image_data = $buffer | $this->frame_data;
|
| 1045 |
+
return $this;
|
| 1046 |
+
}
|
| 1047 |
+
|
| 1048 |
+
/* image */
|
| 1049 |
+
|
| 1050 |
+
private function drawImage()
|
| 1051 |
+
{
|
| 1052 |
+
$quiet_zone = 4;
|
| 1053 |
+
|
| 1054 |
+
$this->image_data = explode("\n", $this->image_data);
|
| 1055 |
+
$c = count($this->image_data) - 1;
|
| 1056 |
+
$image_size = $c;
|
| 1057 |
+
$output_size = ($c + ($quiet_zone) * 2) * $this->qrcode_module_size;
|
| 1058 |
+
|
| 1059 |
+
$img = imagecreate($image_size, $image_size);
|
| 1060 |
+
$white = imagecolorallocate ($img, 255, 255, 255);
|
| 1061 |
+
$black = imagecolorallocate ($img, 0, 0, 0);
|
| 1062 |
+
|
| 1063 |
+
$im = imagecreate($output_size, $output_size);
|
| 1064 |
+
|
| 1065 |
+
$white2 = imagecolorallocate ($im, 255, 255, 255);
|
| 1066 |
+
imagefill($im, 0, 0, $white2);
|
| 1067 |
+
|
| 1068 |
+
$y=0;
|
| 1069 |
+
foreach($this->image_data as $row)
|
| 1070 |
+
{
|
| 1071 |
+
for($x = 0; $x < $image_size; $x++)
|
| 1072 |
+
{
|
| 1073 |
+
if ( substr($row, $x, 1) == "1" )
|
| 1074 |
+
{
|
| 1075 |
+
imagesetpixel($img, $x, $y, $black);
|
| 1076 |
+
}
|
| 1077 |
+
}
|
| 1078 |
+
|
| 1079 |
+
$y++;
|
| 1080 |
+
}
|
| 1081 |
+
|
| 1082 |
+
$quiet_zone_offset = ($quiet_zone) * ($this->qrcode_module_size);
|
| 1083 |
+
$image_width = $image_size * ($this->qrcode_module_size);
|
| 1084 |
+
|
| 1085 |
+
imagecopyresized($im,
|
| 1086 |
+
$img,
|
| 1087 |
+
$quiet_zone_offset,
|
| 1088 |
+
$quiet_zone_offset,
|
| 1089 |
+
0,
|
| 1090 |
+
0,
|
| 1091 |
+
$image_width,
|
| 1092 |
+
$image_width,
|
| 1093 |
+
$image_size,
|
| 1094 |
+
$image_size);
|
| 1095 |
+
|
| 1096 |
+
$this->output_image = $im;
|
| 1097 |
+
return $this;
|
| 1098 |
+
}
|
| 1099 |
+
|
| 1100 |
+
private function outputImage()
|
| 1101 |
+
{
|
| 1102 |
+
header("Content-type: image/" . $this->qrcode_image_type);
|
| 1103 |
+
|
| 1104 |
+
if ( $this->qrcode_image_type == "jpeg" )
|
| 1105 |
+
{
|
| 1106 |
+
imagejpeg($this->output_image);
|
| 1107 |
+
}
|
| 1108 |
+
else
|
| 1109 |
+
{
|
| 1110 |
+
imagepng($this->output_image);
|
| 1111 |
+
}
|
| 1112 |
+
|
| 1113 |
+
return $this;
|
| 1114 |
+
}
|
| 1115 |
+
|
| 1116 |
+
/* cleanup */
|
| 1117 |
+
|
| 1118 |
+
private function cleanup()
|
| 1119 |
+
{
|
| 1120 |
+
/* images */
|
| 1121 |
+
|
| 1122 |
+
@imagedestroy($this->output_image);
|
| 1123 |
+
@imagedestroy($this->base_image);
|
| 1124 |
+
|
| 1125 |
+
/* internal */
|
| 1126 |
+
|
| 1127 |
+
unset($this->data_length);
|
| 1128 |
+
unset($this->data_counter);
|
| 1129 |
+
unset($this->data_value);
|
| 1130 |
+
unset($this->data_bits);
|
| 1131 |
+
unset($this->total_data_bits);
|
| 1132 |
+
unset($this->max_data_bits);
|
| 1133 |
+
unset($this->max_data_codewords);
|
| 1134 |
+
unset($this->codewords);
|
| 1135 |
+
unset($this->codewords_counter);
|
| 1136 |
+
unset($this->max_codewords);
|
| 1137 |
+
unset($this->codeword_num_plus);
|
| 1138 |
+
unset($this->codeword_num_counter_value);
|
| 1139 |
+
unset($this->error_correct_mode);
|
| 1140 |
+
unset($this->rs_block_order);
|
| 1141 |
+
unset($this->rs_ecc_codewords);
|
| 1142 |
+
unset($this->rs_cal_table_array);
|
| 1143 |
+
unset($this->max_modules_1side);
|
| 1144 |
+
unset($this->matrix_content);
|
| 1145 |
+
unset($this->matrix_x_array);
|
| 1146 |
+
unset($this->matrix_y_array);
|
| 1147 |
+
unset($this->mask_array);
|
| 1148 |
+
unset($this->mask_number);
|
| 1149 |
+
unset($this->byte_num);
|
| 1150 |
+
unset($this->format_information_x2);
|
| 1151 |
+
unset($this->format_information_y2);
|
| 1152 |
+
unset($this->frame_data);
|
| 1153 |
+
|
| 1154 |
+
/* data arrays */
|
| 1155 |
+
|
| 1156 |
+
unset($this->alphanumeric_character_hash);
|
| 1157 |
+
unset($this->ecc_character_hash);
|
| 1158 |
+
unset($this->max_data_bits_array);
|
| 1159 |
+
unset($this->max_codewords_array);
|
| 1160 |
+
unset($this->matrix_remain_bit);
|
| 1161 |
+
unset($this->format_information_x1);
|
| 1162 |
+
unset($this->format_information_y1);
|
| 1163 |
+
unset($this->format_information_array);
|
| 1164 |
+
|
| 1165 |
+
/* image */
|
| 1166 |
+
|
| 1167 |
+
unset($this->image_data);
|
| 1168 |
+
unset($this->output_image);
|
| 1169 |
+
unset($this->base_image);
|
| 1170 |
+
unset($this->mib);
|
| 1171 |
+
unset($this->qrcode_image_size);
|
| 1172 |
+
|
| 1173 |
+
return $this;
|
| 1174 |
+
}
|
| 1175 |
+
}
|
app/code/local/Eisbehr/QrMage/Model/{Encoding.php → Config/Encoding.php}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?PHP
|
| 2 |
-
class
|
| 3 |
{
|
| 4 |
public function toOptionArray()
|
| 5 |
{
|
| 1 |
<?PHP
|
| 2 |
+
class Eisbehr_QrMage_Model_Config_Encoding
|
| 3 |
{
|
| 4 |
public function toOptionArray()
|
| 5 |
{
|
app/code/local/Eisbehr/QrMage/Model/Config/Engine.php
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?PHP
|
| 2 |
+
class Eisbehr_QrMage_Model_Config_Engine
|
| 3 |
+
{
|
| 4 |
+
public function toOptionArray()
|
| 5 |
+
{
|
| 6 |
+
return array(
|
| 7 |
+
array('value' => 'google', 'label' => 'Google (engine cloud based on google)'),
|
| 8 |
+
array('value' => 'swetake', 'label' => 'Swetake (engine local based on server)'),
|
| 9 |
+
);
|
| 10 |
+
}
|
| 11 |
+
}
|
app/code/local/Eisbehr/QrMage/Model/Config/Image.php
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?PHP
|
| 2 |
+
class Eisbehr_QrMage_Model_Config_Image
|
| 3 |
+
{
|
| 4 |
+
public function toOptionArray()
|
| 5 |
+
{
|
| 6 |
+
return array(
|
| 7 |
+
array('value' => 'P', 'label' => 'PNG (default)'),
|
| 8 |
+
array('value' => 'J', 'label' => 'JPG'),
|
| 9 |
+
);
|
| 10 |
+
}
|
| 11 |
+
}
|
app/code/local/Eisbehr/QrMage/Model/{Level.php → Config/Level.php}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?PHP
|
| 2 |
-
class
|
| 3 |
{
|
| 4 |
public function toOptionArray()
|
| 5 |
{
|
| 1 |
<?PHP
|
| 2 |
+
class Eisbehr_QrMage_Model_Config_Level
|
| 3 |
{
|
| 4 |
public function toOptionArray()
|
| 5 |
{
|
app/code/local/Eisbehr/QrMage/Model/Config/Size.php
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?PHP
|
| 2 |
+
class Eisbehr_QrMage_Model_Config_Size
|
| 3 |
+
{
|
| 4 |
+
public function toOptionArray()
|
| 5 |
+
{
|
| 6 |
+
return array(
|
| 7 |
+
array('value' => '1', 'label' => '1'),
|
| 8 |
+
array('value' => '2', 'label' => '2'),
|
| 9 |
+
array('value' => '3', 'label' => '3'),
|
| 10 |
+
array('value' => '4', 'label' => '4 (default)'),
|
| 11 |
+
array('value' => '5', 'label' => '5'),
|
| 12 |
+
array('value' => '6', 'label' => '6'),
|
| 13 |
+
array('value' => '7', 'label' => '7'),
|
| 14 |
+
array('value' => '8', 'label' => '8'),
|
| 15 |
+
array('value' => '9', 'label' => '9'),
|
| 16 |
+
array('value' => '10', 'label' => '10'),
|
| 17 |
+
);
|
| 18 |
+
}
|
| 19 |
+
}
|
app/code/local/Eisbehr/QrMage/Model/Db.php
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?PHP
|
| 2 |
+
class Eisbehr_QrMage_Model_Db extends Varien_Object
|
| 3 |
+
{
|
| 4 |
+
function __construct()
|
| 5 |
+
{
|
| 6 |
+
parent::__construct();
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
public function insertEntry($url)
|
| 10 |
+
{
|
| 11 |
+
$this->cleanDb();
|
| 12 |
+
|
| 13 |
+
$sql = Mage::getSingleton('core/resource')->getConnection('core_write');
|
| 14 |
+
|
| 15 |
+
$time = time();
|
| 16 |
+
$hash = md5($url . $time);
|
| 17 |
+
|
| 18 |
+
$qry = "INSERT INTO
|
| 19 |
+
eisbehr_qrmage_buffer
|
| 20 |
+
(hash, time, url)
|
| 21 |
+
VALUES
|
| 22 |
+
('" . $hash . "', '" . $time . "', '" . $url . "')";
|
| 23 |
+
|
| 24 |
+
$sql->query($qry);
|
| 25 |
+
return $hash;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
public function getEntry($hash)
|
| 29 |
+
{
|
| 30 |
+
if( preg_match("/^[a-f0-9]{32}$/", $hash) )
|
| 31 |
+
{
|
| 32 |
+
$sql = Mage::getSingleton('core/resource')->getConnection('core_read');
|
| 33 |
+
|
| 34 |
+
$qry = "SELECT
|
| 35 |
+
url as url
|
| 36 |
+
FROM
|
| 37 |
+
eisbehr_qrmage_buffer
|
| 38 |
+
WHERE
|
| 39 |
+
hash = '" . $hash . "'
|
| 40 |
+
LIMIT 1";
|
| 41 |
+
|
| 42 |
+
$data = $sql->fetchAll($qry);
|
| 43 |
+
|
| 44 |
+
return $data[0]['url'];
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
return NULL;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
public function cleanDb()
|
| 51 |
+
{
|
| 52 |
+
$sql = Mage::getSingleton('core/resource')->getConnection('core_write');
|
| 53 |
+
|
| 54 |
+
// older then one hour
|
| 55 |
+
$time = time() - 3600;
|
| 56 |
+
|
| 57 |
+
$qry = "DELETE FROM
|
| 58 |
+
eisbehr_qrmage_buffer
|
| 59 |
+
WHERE
|
| 60 |
+
time < '" . $time . "'";
|
| 61 |
+
|
| 62 |
+
$sql->query($qry);
|
| 63 |
+
|
| 64 |
+
return true;
|
| 65 |
+
}
|
| 66 |
+
}
|
app/code/local/Eisbehr/QrMage/controllers/CodeController.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?PHP
|
| 2 |
+
class Eisbehr_QrMage_CodeController extends Mage_Core_Controller_Front_Action
|
| 3 |
+
{
|
| 4 |
+
public function indexAction()
|
| 5 |
+
{
|
| 6 |
+
$config = Mage::helper('qrmage/config');
|
| 7 |
+
|
| 8 |
+
// $url = Mage::helper('core/url')->getCurrentUrl();
|
| 9 |
+
$url = NULL;
|
| 10 |
+
$size = $config->getSwetakeSize();
|
| 11 |
+
$image = $config->getSwetakeImage();
|
| 12 |
+
$level = $config->getLevel();
|
| 13 |
+
|
| 14 |
+
$dataPath = Mage::getBaseDir('media');
|
| 15 |
+
$dataPath .= "/qrmage";
|
| 16 |
+
|
| 17 |
+
$hash = $this->getRequest()->getParam('hash');
|
| 18 |
+
|
| 19 |
+
if( preg_match("/^[a-f0-9]{32}$/", $hash) )
|
| 20 |
+
{
|
| 21 |
+
$model = Mage::getModel('qrmage/db');
|
| 22 |
+
$address = $model->getEntry($hash);
|
| 23 |
+
$url = $address;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
$helper = Mage::helper('qrmage/swetake');
|
| 27 |
+
|
| 28 |
+
$helper->setQrCodeDataString($url)
|
| 29 |
+
->setConfigDataPath($dataPath)
|
| 30 |
+
->setQrCodeErrorCorrect($level)
|
| 31 |
+
->setQrCodeImageType($image)
|
| 32 |
+
->setQrCodeModuleSize($size);
|
| 33 |
+
|
| 34 |
+
$helper->createQrCode();
|
| 35 |
+
|
| 36 |
+
return $this;
|
| 37 |
+
}
|
| 38 |
+
}
|
app/code/local/Eisbehr/QrMage/controllers/IndexController.php
CHANGED
|
@@ -6,14 +6,16 @@ class Eisbehr_QrMage_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 6 |
$config = Mage::helper('qrmage/config');
|
| 7 |
|
| 8 |
$url = Mage::helper('core/url')->getCurrentUrl();
|
| 9 |
-
$
|
|
|
|
| 10 |
$level = $config->getLevel();
|
| 11 |
-
$margin = $config->
|
| 12 |
-
$encoding = $config->
|
| 13 |
$label = $config->getLabel();
|
| 14 |
|
| 15 |
$helper = Mage::helper('qrmage');
|
| 16 |
$html = $helper->setUrl($url)
|
|
|
|
| 17 |
->setSize($size)
|
| 18 |
->setLevel($level)
|
| 19 |
->setMargin($margin)
|
| 6 |
$config = Mage::helper('qrmage/config');
|
| 7 |
|
| 8 |
$url = Mage::helper('core/url')->getCurrentUrl();
|
| 9 |
+
$engine = $config->getEngine();
|
| 10 |
+
$size = $config->getGoogleSize();
|
| 11 |
$level = $config->getLevel();
|
| 12 |
+
$margin = $config->getGoogleMargin();
|
| 13 |
+
$encoding = $config->getGoogleEncoding();
|
| 14 |
$label = $config->getLabel();
|
| 15 |
|
| 16 |
$helper = Mage::helper('qrmage');
|
| 17 |
$html = $helper->setUrl($url)
|
| 18 |
+
->setEngine($engine)
|
| 19 |
->setSize($size)
|
| 20 |
->setLevel($level)
|
| 21 |
->setMargin($margin)
|
app/code/local/Eisbehr/QrMage/etc/config.xml
CHANGED
|
@@ -2,10 +2,18 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Eisbehr_QrMage>
|
| 5 |
-
<version>0.1.
|
| 6 |
</Eisbehr_QrMage>
|
| 7 |
</modules>
|
| 8 |
<global>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
<models>
|
| 10 |
<qrmage>
|
| 11 |
<class>Eisbehr_QrMage_Model</class>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Eisbehr_QrMage>
|
| 5 |
+
<version>0.1.1</version>
|
| 6 |
</Eisbehr_QrMage>
|
| 7 |
</modules>
|
| 8 |
<global>
|
| 9 |
+
<resources>
|
| 10 |
+
<eisbehr_qrmage_setup>
|
| 11 |
+
<setup>
|
| 12 |
+
<module>Eisbehr_QrMage</module>
|
| 13 |
+
<class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
|
| 14 |
+
</setup>
|
| 15 |
+
</eisbehr_qrmage_setup>
|
| 16 |
+
</resources>
|
| 17 |
<models>
|
| 18 |
<qrmage>
|
| 19 |
<class>Eisbehr_QrMage_Model</class>
|
app/code/local/Eisbehr/QrMage/etc/system.xml
CHANGED
|
@@ -29,20 +29,21 @@
|
|
| 29 |
<show_in_store>1</show_in_store>
|
| 30 |
<comment>activate the view on frontend, default: yes</comment>
|
| 31 |
</active>
|
| 32 |
-
<
|
| 33 |
-
<label>
|
| 34 |
-
<frontend_type>
|
|
|
|
| 35 |
<sort_order>5</sort_order>
|
| 36 |
-
<default_value>
|
| 37 |
<show_in_default>1</show_in_default>
|
| 38 |
<show_in_website>1</show_in_website>
|
| 39 |
<show_in_store>1</show_in_store>
|
| 40 |
-
<comment>
|
| 41 |
-
</
|
| 42 |
<level translate="label">
|
| 43 |
<label>Level:</label>
|
| 44 |
<frontend_type>select</frontend_type>
|
| 45 |
-
<source_model>qrmage/
|
| 46 |
<sort_order>10</sort_order>
|
| 47 |
<default_value>L</default_value>
|
| 48 |
<show_in_default>1</show_in_default>
|
|
@@ -50,10 +51,40 @@
|
|
| 50 |
<show_in_store>1</show_in_store>
|
| 51 |
<comment>error loss level, default: L</comment>
|
| 52 |
</level>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
<margin translate="label">
|
| 54 |
<label>Margin:</label>
|
| 55 |
<frontend_type>text</frontend_type>
|
| 56 |
-
<sort_order>
|
| 57 |
<default_value>2</default_value>
|
| 58 |
<show_in_default>1</show_in_default>
|
| 59 |
<show_in_website>1</show_in_website>
|
|
@@ -63,26 +94,48 @@
|
|
| 63 |
<encoding translate="label">
|
| 64 |
<label>Encoding:</label>
|
| 65 |
<frontend_type>select</frontend_type>
|
| 66 |
-
<source_model>qrmage/
|
| 67 |
-
<sort_order>
|
| 68 |
<default_value>UTF-8</default_value>
|
| 69 |
<show_in_default>1</show_in_default>
|
| 70 |
<show_in_website>1</show_in_website>
|
| 71 |
<show_in_store>1</show_in_store>
|
| 72 |
<comment>encoding for url data, default: UTF-8</comment>
|
| 73 |
</encoding>
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
<show_in_default>1</show_in_default>
|
| 80 |
<show_in_website>1</show_in_website>
|
| 81 |
<show_in_store>1</show_in_store>
|
| 82 |
-
<comment>
|
| 83 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
</fields>
|
| 85 |
-
</
|
| 86 |
</groups>
|
| 87 |
</qrmage>
|
| 88 |
</sections>
|
| 29 |
<show_in_store>1</show_in_store>
|
| 30 |
<comment>activate the view on frontend, default: yes</comment>
|
| 31 |
</active>
|
| 32 |
+
<engine translate="label">
|
| 33 |
+
<label>Qr Code Engine:</label>
|
| 34 |
+
<frontend_type>select</frontend_type>
|
| 35 |
+
<source_model>qrmage/config_engine</source_model>
|
| 36 |
<sort_order>5</sort_order>
|
| 37 |
+
<default_value>1</default_value>
|
| 38 |
<show_in_default>1</show_in_default>
|
| 39 |
<show_in_website>1</show_in_website>
|
| 40 |
<show_in_store>1</show_in_store>
|
| 41 |
+
<comment>witch engine to use, default: google</comment>
|
| 42 |
+
</engine>
|
| 43 |
<level translate="label">
|
| 44 |
<label>Level:</label>
|
| 45 |
<frontend_type>select</frontend_type>
|
| 46 |
+
<source_model>qrmage/config_level</source_model>
|
| 47 |
<sort_order>10</sort_order>
|
| 48 |
<default_value>L</default_value>
|
| 49 |
<show_in_default>1</show_in_default>
|
| 51 |
<show_in_store>1</show_in_store>
|
| 52 |
<comment>error loss level, default: L</comment>
|
| 53 |
</level>
|
| 54 |
+
<label translate="label">
|
| 55 |
+
<label>Label:</label>
|
| 56 |
+
<frontend_type>text</frontend_type>
|
| 57 |
+
<sort_order>15</sort_order>
|
| 58 |
+
<default_value>QR Code</default_value>
|
| 59 |
+
<show_in_default>1</show_in_default>
|
| 60 |
+
<show_in_website>1</show_in_website>
|
| 61 |
+
<show_in_store>1</show_in_store>
|
| 62 |
+
<comment>image label, default: QR Code</comment>
|
| 63 |
+
</label>
|
| 64 |
+
</fields>
|
| 65 |
+
</qrmage>
|
| 66 |
+
<google translate="label comment" module="qrmage">
|
| 67 |
+
<label>Google Engine</label>
|
| 68 |
+
<frontend_type>text</frontend_type>
|
| 69 |
+
<sort_order>5</sort_order>
|
| 70 |
+
<show_in_default>1</show_in_default>
|
| 71 |
+
<show_in_website>1</show_in_website>
|
| 72 |
+
<show_in_store>1</show_in_store>
|
| 73 |
+
<fields>
|
| 74 |
+
<size translate="label">
|
| 75 |
+
<label>Size:</label>
|
| 76 |
+
<frontend_type>text</frontend_type>
|
| 77 |
+
<sort_order>0</sort_order>
|
| 78 |
+
<default_value>150</default_value>
|
| 79 |
+
<show_in_default>1</show_in_default>
|
| 80 |
+
<show_in_website>1</show_in_website>
|
| 81 |
+
<show_in_store>1</show_in_store>
|
| 82 |
+
<comment>width and height in pixels, default: 150, max: 500</comment>
|
| 83 |
+
</size>
|
| 84 |
<margin translate="label">
|
| 85 |
<label>Margin:</label>
|
| 86 |
<frontend_type>text</frontend_type>
|
| 87 |
+
<sort_order>5</sort_order>
|
| 88 |
<default_value>2</default_value>
|
| 89 |
<show_in_default>1</show_in_default>
|
| 90 |
<show_in_website>1</show_in_website>
|
| 94 |
<encoding translate="label">
|
| 95 |
<label>Encoding:</label>
|
| 96 |
<frontend_type>select</frontend_type>
|
| 97 |
+
<source_model>qrmage/config_encoding</source_model>
|
| 98 |
+
<sort_order>10</sort_order>
|
| 99 |
<default_value>UTF-8</default_value>
|
| 100 |
<show_in_default>1</show_in_default>
|
| 101 |
<show_in_website>1</show_in_website>
|
| 102 |
<show_in_store>1</show_in_store>
|
| 103 |
<comment>encoding for url data, default: UTF-8</comment>
|
| 104 |
</encoding>
|
| 105 |
+
</fields>
|
| 106 |
+
</google>
|
| 107 |
+
<swetake translate="label comment" module="qrmage">
|
| 108 |
+
<label>Swetake Engine</label>
|
| 109 |
+
<frontend_type>text</frontend_type>
|
| 110 |
+
<sort_order>10</sort_order>
|
| 111 |
+
<show_in_default>1</show_in_default>
|
| 112 |
+
<show_in_website>1</show_in_website>
|
| 113 |
+
<show_in_store>1</show_in_store>
|
| 114 |
+
<fields>
|
| 115 |
+
<size translate="label">
|
| 116 |
+
<label>Size:</label>
|
| 117 |
+
<frontend_type>select</frontend_type>
|
| 118 |
+
<source_model>qrmage/config_size</source_model>
|
| 119 |
+
<sort_order>0</sort_order>
|
| 120 |
+
<default_value>4</default_value>
|
| 121 |
<show_in_default>1</show_in_default>
|
| 122 |
<show_in_website>1</show_in_website>
|
| 123 |
<show_in_store>1</show_in_store>
|
| 124 |
+
<comment>qr code size level, default: 4</comment>
|
| 125 |
+
</size>
|
| 126 |
+
<image translate="label">
|
| 127 |
+
<label>Margin:</label>
|
| 128 |
+
<frontend_type>select</frontend_type>
|
| 129 |
+
<source_model>qrmage/config_image</source_model>
|
| 130 |
+
<sort_order>5</sort_order>
|
| 131 |
+
<default_value>P</default_value>
|
| 132 |
+
<show_in_default>1</show_in_default>
|
| 133 |
+
<show_in_website>1</show_in_website>
|
| 134 |
+
<show_in_store>1</show_in_store>
|
| 135 |
+
<comment>iamge type, default: png</comment>
|
| 136 |
+
</image>
|
| 137 |
</fields>
|
| 138 |
+
</swetake>
|
| 139 |
</groups>
|
| 140 |
</qrmage>
|
| 141 |
</sections>
|
app/code/local/Eisbehr/QrMage/sql/eisbehr_qrmage_setup/mysql4-install-0.1.0.php
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?PHP
|
| 2 |
+
$this->startSetup();
|
| 3 |
+
|
| 4 |
+
$this->run("DROP TABLE IF EXISTS `eisbehr_qrmage_buffer`;
|
| 5 |
+
CREATE TABLE `eisbehr_qrmage_buffer` (
|
| 6 |
+
`hash` VARCHAR( 32 ) NOT NULL ,
|
| 7 |
+
`time` INT( 10 ) NOT NULL ,
|
| 8 |
+
`url` TEXT NOT NULL
|
| 9 |
+
) ENGINE = MYISAM ;");
|
| 10 |
+
|
| 11 |
+
$this->endSetup();
|
media/qrmage/qrv10_0.dat
ADDED
|
Binary file
|
media/qrmage/qrv10_1.dat
ADDED
|
Binary file
|
media/qrmage/qrv10_2.dat
ADDED
|
Binary file
|
media/qrmage/qrv10_3.dat
ADDED
|
Binary file
|
media/qrmage/qrv11_0.dat
ADDED
|
Binary file
|
media/qrmage/qrv11_1.dat
ADDED
|
Binary file
|
media/qrmage/qrv11_2.dat
ADDED
|
Binary file
|
media/qrmage/qrv11_3.dat
ADDED
|
Binary file
|
media/qrmage/qrv12_0.dat
ADDED
|
Binary file
|
media/qrmage/qrv12_1.dat
ADDED
|
Binary file
|
media/qrmage/qrv12_2.dat
ADDED
|
Binary file
|
media/qrmage/qrv12_3.dat
ADDED
|
Binary file
|
media/qrmage/qrv13_0.dat
ADDED
|
Binary file
|
media/qrmage/qrv13_1.dat
ADDED
|
Binary file
|
media/qrmage/qrv13_2.dat
ADDED
|
Binary file
|
media/qrmage/qrv13_3.dat
ADDED
|
Binary file
|
media/qrmage/qrv14_0.dat
ADDED
|
Binary file
|
media/qrmage/qrv14_1.dat
ADDED
|
Binary file
|
media/qrmage/qrv14_2.dat
ADDED
|
Binary file
|
media/qrmage/qrv14_3.dat
ADDED
|
Binary file
|
media/qrmage/qrv15_0.dat
ADDED
|
Binary file
|
media/qrmage/qrv15_1.dat
ADDED
|
Binary file
|
media/qrmage/qrv15_2.dat
ADDED
|
Binary file
|
media/qrmage/qrv15_3.dat
ADDED
|
Binary file
|
media/qrmage/qrv16_0.dat
ADDED
|
Binary file
|
media/qrmage/qrv16_1.dat
ADDED
|
Binary file
|
media/qrmage/qrv16_2.dat
ADDED
|
Binary file
|
media/qrmage/qrv16_3.dat
ADDED
|
Binary file
|
media/qrmage/qrv17_0.dat
ADDED
|
Binary file
|
media/qrmage/qrv17_1.dat
ADDED
|
Binary file
|
media/qrmage/qrv17_2.dat
ADDED
|
Binary file
|
media/qrmage/qrv17_3.dat
ADDED
|
Binary file
|
media/qrmage/qrv18_0.dat
ADDED
|
Binary file
|
media/qrmage/qrv18_1.dat
ADDED
|
Binary file
|
media/qrmage/qrv18_2.dat
ADDED
|
Binary file
|
media/qrmage/qrv18_3.dat
ADDED
|
Binary file
|
media/qrmage/qrv19_0.dat
ADDED
|
Binary file
|
media/qrmage/qrv19_1.dat
ADDED
|
Binary file
|
media/qrmage/qrv19_2.dat
ADDED
|
Binary file
|
media/qrmage/qrv19_3.dat
ADDED
|
Binary file
|
media/qrmage/qrv1_0.dat
ADDED
|
Binary file
|
media/qrmage/qrv1_1.dat
ADDED
|
Binary file
|
media/qrmage/qrv1_2.dat
ADDED
|
Binary file
|
media/qrmage/qrv1_3.dat
ADDED
|
Binary file
|
media/qrmage/qrv20_0.dat
ADDED
|
Binary file
|
media/qrmage/qrv20_1.dat
ADDED
|
Binary file
|
media/qrmage/qrv20_2.dat
ADDED
|
Binary file
|
media/qrmage/qrv20_3.dat
ADDED
|
Binary file
|
media/qrmage/qrv21_0.dat
ADDED
|
Binary file
|
media/qrmage/qrv21_1.dat
ADDED
|
Binary file
|
media/qrmage/qrv21_2.dat
ADDED
|
Binary file
|
media/qrmage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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
hghghghghghghghghghghghgfefefefefefefefefefefefedcdcdcdcdcdcdcdcbabababababababa_`_`_`_`_`_`_`_`]]]]]]^]^]^]^]^]^]^]^]^]\[\[\[\[\[\[\[\[\[\[\[\[ZYZYZYZYZYZYZYZYZYZYZYZYXWXWXWXWXWXWXWXWXWXWXWXWVUVUVUVUVUVUVUVUVUVUVUVUTSTSTSTSTSTSTSTSTSTSTSTSRQRQRQRQRQRQRQRQRQRQRQRQPOPOPOPOPOPOPOPOPONMNMNMNMNMNMNMNMNMNMNMLKLKLKLKLKLKLKLKLKLKLKLKJIJIJIJIJIJIJIJIGHGHGGGGGHGHGHGHFEFEFEFEFEFEFEFEFEFEFEFEDCDCDCDCDCDCDCDCDCDCDCDCBABABABABABABABABABABABA@?@?@?@?@?@?@?@?@?@?@?@?>=>=>=>=>=>=>=>=>=>=>=>=<;<;<;<;<;<;<;<;<;<;<;<;:9:9:9:9:9:9:9:9:9:9:9:987878787878787878765656565656565656565654343434343434343434343432121212121212121/0/0/////0/0/0/0.-.-.-.-.-.-.-.-.-.-.-.-,+,+,+,+,+,+,+,+,+,+,+,+*)*)*)*)*)*)*)*)*)*)*)*)('('('('('('('('('('('('&%&%&%&%&%&%&%&%&%&%&%&%$#$#$#$#$#$#$#$#$#$#$#$#"!"!"!"!"!"!"!"!"!"!"!"! hghghghghghghghghghghghgfefefefefefefefefefefefedcdcdcdcdcdcdcdcbabababababababa_`_`_`_`_`_`_`_`^]^]^]^]^]^]^]^]^]^]^]^]\[\[\[\[\[\[\[\[\[\[\[\[ZYZYZYZYZYZYZYZYZYZYZYZYXWXWXWXWXWXWXWXWXWXWXWXWVUVUVUVUVUVUVUVUVUVUVUVUTSTSTSTSTSTSTSTSTSTSTSTSRQRQRQRQRQRQRQRQRQPOPOPOPOPOPOPOPOPOPOPONMNMNMNMNMNMNMNMNMNMNMNMLKLKLKLKLKLKLKLKLKJIJIJIJIJIJIJIJIJIJIJIGGHGHGHGGHGHGHGHFEFEFEFEFEFEFEFEFEFEFEFEDCDCDCDCDCDCDCDCDCDCDCDCBABABABABABABABABABABABA@?@?@?@?@?@?@?@?@?@?@?@?>=>=>=>=>=>=>=>=>=>=>=>=<;<;<;<;<;<;<;<;<;<;<;<;:9:9:9:9:9:9:9:9:987878787878787878787876565656565656565656565654343434343434343432121212121212121212121//0/0/0//0/0/0/0.-.-.-.-.-.-.-.-.-.-.-.-,+,+,+,+,+,+,+,+,+,+,+,+*)*)*)*)*)*)*)*)*)*)*)*)('('('('('('('('('('('('&%&%&%&%&%&%&%&%&%&%&%&%$#$#$#$#$#$#$#$#$#$#$#$#"!"!"!"!"!"!"!"!"! hghghghghghghghghghghghgfefefefefefefefefefefefedcdcdcdcdcdcdcdcbabababababababa_`_______`_`_`_`^]^]^]^]^]^]^]^]^]^]^]^]\[\[\[\[\[\[\[\[\[\[\[\[ZYZYZYZYZYZYZYZYZYZYZYZYXWXWXWXWXWXWXWXWXWXWXWXWVUVUVUVUVUVUVUVUVUVUVUVUTSTSTSTSTSTSTSTSTSRQRQRQRQRQRQRQRQRQRQRQPOPOPOPOPOPOPOPOPOPOPOPONMNMNMNMNMNMNMNMNMNMNMNMLKLKLKLKLKLKLKLKJIJIJIJIJIJIJIJIJIJIJIJIHGHGHGHGGHGGGGGGFEFEFEFEFEFEFEFEFEFEFEFEDCDCDCDCDCDCDCDCDCDCDCDCBABABABABABABABABABABABA@?@?@?@?@?@?@?@?@?@?@?@?>=>=>=>=>=>=>=>=>=>=>=>=<;<;<;<;<;<;<;<;<;:9:9:9:9:9:9:9:9:9:9:987878787878787878787878765656565656565656565656543434343434343432121212121212121212121210/0/0/0//0//////.-.-.-.-.-.-.-.-.-.-.-.-,+,+,+,+,+,+,+,+,+,+,+,+*)*)*)*)*)*)*)*)*)*)*)*)('('('('('('('('('('('('&%&%&%&%&%&%&%&%&%&%&%&%$#$#$#$#$#$#$#$#$#"!"!"!"!"!"!"!"!"!"!"! hghghghghghghghghghghghgfefefefefefefefedcdcdcdcdcdcdcdcdcdcdcdcbabababababababa`_`_`_`__`_`_`_`^]^]^]^]^]^]^]^]^]^]^]^]\[\[\[\[\[\[\[\[\[\[\[\[ZYZYZYZYZYZYZYZYZYZYZYZYXWXWXWXWXWXWXWXWXWXWXWXWVUVUVUVUVUVUVUVUVUTSTSTSTSTSTSTSTSTSTSTSRQRQRQRQRQRQRQRQRQRQRQRQPOPOPOPOPOPOPOPOPOPOPOPONMNMNMNMNMNMNMNMNMNMNMNMLKLKLKLKLKLKLKLKJIJIJIJIJIJIJIJIJIHGHGHGHGHGHGHGHGHGHGHGFEFEFEFEFEFEFEFEFEFEFEFEDCDCDCDCDCDCDCDCDCDCDCDCBABABABABABABABABABABABA@?@?@?@?@?@?@?@?@?@?@?@?>=>=>=>=>=>=>=>=>=<;<;<;<;<;<;<;<;<;<;<;:9:9:9:9:9:9:9:9:9:9:9:987878787878787878787878765656565656565656565656543434343434343432121212121212121210/0/0/0/0/0/0/0/0/0/0/.-.-.-.-.-.-.-.-.-.-.-.-,+,+,+,+,+,+,+,+,+,+,+,+*)*)*)*)*)*)*)*)*)*)*)*)('('('('('('('('('('('('&%&%&%&%&%&%&%&%&%$#$#$#$#$#$#$#$#$#$#$#"!"!"!"!"!"!"!"!"!"!"!"! hghghghghghghghghghghghgfefefefefefefefedcdcdcdcdcdcdcdcbabababababababababababa`_`_`_`_______`_^]^]^]^]^]^]^]^]^]^]^]^]\[\[\[\[\[\[\[\[\[\[\[\[ZYZYZYZYZYZYZYZYZYZYZYZYXWXWXWXWXWXWXWXWXWVUVUVUVUVUVUVUVUVUVUVUTSTSTSTSTSTSTSTSTSTSTSTSRQRQRQRQRQRQRQRQRQRQRQRQPOPOPOPOPOPOPOPOPOPOPOPONMNMNMNMNMNMNMNMNMNMNMNMLKLKLKLKLKLKLKLKJIJIJIJIJIJIJIJIHGGGGGGHHGHGHGHGHGHGHGHGFEFEFEFEFEFEFEFEFEFEFEFEDCDCDCDCDCDCDCDCDCDCDCDCBABABABABABABABABABABABA@?@?@?@?@?@?@?@?@?>=>=>=>=>=>=>=>=>=>=>=<;<;<;<;<;<;<;<;<;<;<;<;:9:9:9:9:9:9:9:9:9:9:9:9878787878787878787878787656565656565656565656565434343434343434321212121212121210//////00/0/0/0/0/0/0/0/.-.-.-.-.-.-.-.-.-.-.-.-,+,+,+,+,+,+,+,+,+,+,+,+*)*)*)*)*)*)*)*)*)*)*)*)('('('('('('('('('&%&%&%&%&%&%&%&%&%&%&%$#$#$#$#$#$#$#$#$#$#$#$#"!"!"!"!"!"!"!"!"!"!"!"! hghghghghghghghghghghghgfefefefefefefefedcdcdcdcdcdcdcdcbabababababababa`_`_`_`_`_`_`_`_`_`_`_`_^]^]^]^]^]^]^]^]^]^]^]^]\[\[\[\[\[\[\[\[\[\[\[\[ZYZYZYZYZYZYZYZYZYXWXWXWXWXWXWXWXWXWXWXWVUVUVUVUVUVUVUVUVUVUVUVUTSTSTSTSTSTSTSTSTSTSTSTSRQRQRQRQRQRQRQRQRQRQRQRQPOPOPOPOPOPOPOPOPOPOPOPONMNMNMNMNMNMNMNMNMNMNMNMLKLKLKLKLKLKLKLKJIJIJIJIJIJIJIJIGHGHGHGHHGHGHGHGHGHGHGHGFEFEFEFEFEFEFEFEFEFEFEFEDCDCDCDCDCDCDCDCDCDCDCDCBABABABABABABABABA@?@?@?@?@?@?@?@?@?@?@?>=>=>=>=>=>=>=>=>=>=>=>=<;<;<;<;<;<;<;<;<;<;<;<;:9:9:9:9:9:9:9:9:9:9:9:987878787878787878787878765656565656565656565656543434343434343432121212121212121/0/0/0/00/0/0/0/0/0/0/0/.-.-.-.-.-.-.-.-.-.-.-.-,+,+,+,+,+,+,+,+,+,+,+,+*)*)*)*)*)*)*)*)*)('('('('('('('('('('('&%&%&%&%&%&%&%&%&%&%&%&%$#$#$#$#$#$#$#$#$#$#$#$#"!"!"!"!"!"!"!"!"!"!"!"! hghghghghghghghgfefefefefefefefefefefefedcdcdcdcdcdcdcdcbabababababababa_____`_``_`_`_`_`_`_`_`_^]^]^]^]^]^]^]^]^]^]^]^]\[\[\[\[\[\[\[\[\[ZYZYZYZYZYZYZYZYZYZYZYXWXWXWXWXWXWXWXWXWXWXWXWVUVUVUVUVUVUVUVUVUVUVUVUTSTSTSTSTSTSTSTSTSTSTSTSRQRQRQRQRQRQRQRQRQRQRQRQPOPOPOPOPOPOPOPOPOPOPOPONMNMNMNMNMNMNMNMNMNMNMNMLKLKLKLKLKLKLKLKJIJIJIJIJIJIJIJIGHGHGHGHGGGGGHGHHGHGHGGGFEFEFEFEFEFEFEFEFEFEFEFEDCDCDCDCDCDCDCDCDCBABABABABABABABABABABA@?@?@?@?@?@?@?@?@?@?@?@?>=>=>=>=>=>=>=>=>=>=>=>=<;<;<;<;<;<;<;<;<;<;<;<;:9:9:9:9:9:9:9:9:9:9:9:987878787878787878787878765656565656565656565656543434343434343432121212121212121/0/0/0/0/////0/00/0/0///.-.-.-.-.-.-.-.-.-.-.-.-,+,+,+,+,+,+,+,+,+*)*)*)*)*)*)*)*)*)*)*)('('('('('('('('('('('('&%&%&%&%&%&%&%&%&%&%&%&%$#$#$#$#$#$#$#$#$#$#$#$#"!"!"!"!"!"!"!"!"!"!"!"! hghghghghghghghgfefefefefefefefefefefefedcdcdcdcdcdcdcdcbabababababababa_`_`_`_``_`_`___`_`_`_`_^]^]^]^]^]^]^]^]^]\[\[\[\[\[\[\[\[\[\[\[ZYZYZYZYZYZYZYZYZYZYZYZYXWXWXWXWXWXWXWXWXWXWXWXWVUVUVUVUVUVUVUVUVUVUVUVUTSTSTSTSTSTSTSTSTSTSTSTSRQRQRQRQRQRQRQRQRQRQRQRQPOPOPOPOPOPOPOPOPOPOPOPONMNMNMNMNMNMNMNMNMNMNMNMLKLKLKLKLKLKLKLKJIJIJIJIJIJIJIJIGHGHGHGHGHGHGHGHGGHGHGHGFEFEFEFEFEFEFEFEFEDCDCDCDCDCDCDCDCDCDCDCBABABABABABABABABABABABA@?@?@?@?@?@?@?@?@?@?@?@?>=>=>=>=>=>=>=>=>=>=>=>=<;<;<;<;<;<;<;<;<;<;<;<;:9:9:9:9:9:9:9:9:9:9:9:987878787878787878787878765656565656565656565656543434343434343432121212121212121/0/0/0/0/0/0/0/0//0/0/0/.-.-.-.-.-.-.-.-.-,+,+,+,+,+,+,+,+,+,+,+*)*)*)*)*)*)*)*)*)*)*)*)('('('('('('('('('('('('&%&%&%&%&%&%&%&%&%&%&%&%$#$#$#$#$#$#$#$#$#$#$#$#"!"!"!"!"!"!"!"!"!"!"!"! hghghghghghghghgfefefefefefefefefefefefedcdcdcdcdcdcdcdcbabababababababa_`_`_`_`___`_`_``_`_`_`_^]^]^]^]^]^]^]^]\[\[\[\[\[\[\[\[\[\[\[\[ZYZYZYZYZYZYZYZYZYZYZYZYXWXWXWXWXWXWXWXWXWXWXWXWVUVUVUVUVUVUVUVUVUVUVUVUTSTSTSTSTSTSTSTSTSTSTSTSRQRQRQRQRQRQRQRQRQRQRQRQPOPOPOPOPOPOPOPOPOPOPOPONMNMNMNMNMNMNMNMNMLKLKLKLKLKLKLKLKLKLKLKJIJIJIJIJIJIJIJIGHGHGHGHGHGHGHGHHGFEFEFEFEFEFEFEFEFEFEFEDCDCDCDCDCDCDCDCDCDCDCDCBABABABABABABABABABABABA@?@?@?@?@?@?@?@?@?@?@?@?>=>=>=>=>=>=>=>=>=>=>=>=<;<;<;<;<;<;<;<;<;<;<;<;:9:9:9:9:9:9:9:9:9:9:9:987878787878787878787878765656565656565656543434343434343434343432121212121212121/0/0/0/0/0/0/0/00/.-.-.-.-.-.-.-.-.-.-.-,+,+,+,+,+,+,+,+,+,+,+,+*)*)*)*)*)*)*)*)*)*)*)*)('('('('('('('('('('('('&%&%&%&%&%&%&%&%&%&%&%&%$#$#$#$#$#$#$#$#$#$#$#$#"!"!"!"!"!"!"!"!"!"!"!"!
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
hhggffeeDDCCBBAA 99::;;<<]]^^__``FFEEDDCC""##$$%%PPQQRRSSVUUTTSSR-,,++**) (())**++LLMMNNOOaa``__^^==<<;;::
|
| 106 |
+
|
| 107 |
+
,,--..//PPQQRRSS]]\\[[ZZ9988776644556677XXYYZZ[[UUTTSSRR1100//..
|
| 108 |
+
|
| 109 |
+
<<==>>??``aabbccMMLLKKJJ))((''&& !!""##DDEEFFGGhhhhggffEEDDCCBB!! (())**++LLMMNNOO\\[[ZZYY..--,,++ --..//55[[\\]]^^IHGGFFEE"!!
|
| 110 |
+
|
| 111 |
+
,,--..//PPQQRRSS]]\\[[ZZ9988776644556677XXYYZZ[[UUTTSSRR1100//..
|
| 112 |
+
|
| 113 |
+
<<==>>??``aabbccMMLLKKJJ))((''&& !!""##DDEEFFGGhhhhggffEEDDCCBB!! (())**++LLMMNNOO\\[[ZZYY..--,,++ --..//55[[\\]]^^IHGGFFEE"!!
|
| 114 |
+
|
| 115 |
+
,,--..//PPQQRRSS]]\\[[ZZ9988776644556677XXYYZZ[[UUTTSSRR1100//..
|
| 116 |
+
|
| 117 |
+
<<==>>??``aabbccMMLLKKJJ))((''&& !!""##DDEEFFGGhhhhggffEEDDCCBB!! (())**++LLMMNNOO\\[[ZZYY..--,,++ --..//55[[\\]]^^IHGGFFEE"!! ``__^^]]<<;;::99 AABBCCDDeeffgghh>>==<<;;
|
| 118 |
+
|
| 119 |
+
,,--..//PPQQRRSSXXWWVVUU**))((''
|
| 120 |
+
|
| 121 |
+
66778899__eeffggDDCCBBAA
|
| 122 |
+
|
| 123 |
+
,,--..//PPQQRRSSXXWWVVUU**))((''
|
| 124 |
+
|
| 125 |
+
66778899__eeffggDDCCBBAA
|
| 126 |
+
|
| 127 |
+
,,--..//PPQQRRSSXXWWVVUU**))((''
|
| 128 |
+
|
| 129 |
+
66778899__eeffggDDCCBBAA\\[[ZZYY88776655!!""##$$EEFFGGHHhhggffee::998877
|
| 130 |
+
|
| 131 |
+
..//5566\\]]^^__GGFFEEDD! 44556677XXYYZZ[[UUTTSSRR1100//..
|
| 132 |
+
|
| 133 |
+
<<==>>??``aabbccMMLLKKJJ))((''&& !!""##DDEEFFGGhhhhggffEEDDCCBB!! (())**++LLMMNNOOaa``__^^==<<;;::
|
| 134 |
+
|
| 135 |
+
<<==>>??``aabbccMMLLKKJJ))((''&& !!""##DDEEFFGGhhhhggffEEDDCCBB!! (())**++LLMMNNOOaa``__^^==<<;;::
|
| 136 |
+
|
| 137 |
+
<<==>>??``aabbccMMLLKKJJ))((''&& !!""##DDEEFFGGhhhhggffEEDDCCBB!! (())**++LLMMNNOOaa``__^^==<<;;::
|
| 138 |
+
|
| 139 |
+
XXWWVVUU44332211
|
| 140 |
+
|
| 141 |
+
778899::eeffgghhCCBBAA@@8899::;;\\]]^^__QQPPOONN--,,++** @@AABBCCddeeffggIIHHGGFF%%$$##""
|
