function generate($code = '012345678901', $encoding = 'EAN', $scale = '1', $mode = 'png') { if (get_magic_quotes_gpc()) { $code = stripslashes($code); } else { $code = $code; } //if (!$code) $code='123456789012'; barcode_print($code, $encoding, $scale, $mode); }
public function eanAction() { $ean = $this->getRequest()->get("ean"); $this->getResponse()->clearAllHeaders(); barcode_print($ean, "EAN", 2, "png"); }
include $ruta_raiz . '/ver_datosrad.php'; $noRad = $_REQUEST['nurad']; $radicado_separado = substr($noRad, 0, 4) . "-" . substr($noRad, 4, 3) . "-" . substr($noRad, 7, 6) . "-" . substr($noRad, 13, 1); $numero_radicado = $_REQUEST['nurad']; $numero_documento = substr($docDir, 0, 20); $remitente = substr($nombret_us1, 0, 20); $ruta_imagen = BODEGA_TMP; $grabar_archivo = true; $url_radicado = ORFEO_URL_BUSCAR . $numero_radicado; $qrcode_imagen = $ruta_imagen . 'qr' . $numero_radicado . '.' . $modo; if (isset($qrencodes_path)) { $qrencodes_exec = $qrencodes_path . ' ' . $url_radicado . ' -o ' . $qrcode_imagen; shell_exec($qrencodes_exec); $grabo_qrcode = is_file($qrcode_imagen); } $grabo_imagen = barcode_print($numero_radicado, $codificacion, $escala_imagen, $modo, $grabar_archivo, $numero_radicado, $ruta_imagen); if ($grabo_imagen) { $url_imagen = URL_TMP . $numero_radicado . '.' . $modo; } if ($grabo_qrcode) { $url_qrcode = URL_TMP . 'qr' . $numero_radicado . '.' . $modo; } $smarty->assign('RADICADO_SEPARADO', $radicado_separado); $smarty->assign('URL_IMAGEN', $url_imagen); $smarty->assign('URL_QRCODE', $url_qrcode); $smarty->assign('NUMERO_DOCUMENTO', $numero_documento); $smarty->assign('REMITENTE', $remitente); $smarty->assign('NUMERO_RADICADO', $numero_radicado); $smarty->assign('RADI_FECH_RADI', $radi_fech_radi); $smarty->assign('RADI_DEPE_ACTU', $radi_depe_actu); $smarty->assign('URL_ENTIDAD_STICKER', URL_ENTIDAD_STICKER);
* Part of PHP-Barcode 0.3pl1 * (C) 2001,2002,2003,2004 by Folke Ashberg <*****@*****.**> * The newest version can be found at http://www.ashberg.de/bar * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ require "php-barcode.php"; function getvar($name) { global $_GET, $_POST; if (isset($_GET[$name])) { return $_GET[$name]; } else { if (isset($_POST[$name])) { return $_POST[$name]; } else { return false; } } } barcode_print(getvar('code'), getvar('encoding'), getvar('scale'), getvar('mode'), getvar('total_y'));
/** * \brief Return an image file on the fly (no need to write on disk) * \param $code Value to encode * \param $encoding Mode of encoding * \param $readable Code can be read */ function buildBarCode($code,$encoding,$readable='Y') { global $_GET,$_SERVER; global $conf; global $genbarcode_loc, $bar_color, $bg_color, $text_color, $font_loc; if (! $this->encodingIsSupported($encoding)) return -1; if ($encoding == 'EAN8' || $encoding == 'EAN13') $encoding = 'EAN'; if ($encoding == 'C39' || $encoding == 'C128') $encoding = substr($encoding,1); $scale=1; $mode='png'; $_GET["code"]=$code; $_GET["encoding"]=$encoding; $_GET["scale"]=$scale; $_GET["mode"]=$mode; require_once(DOL_DOCUMENT_ROOT.'/includes/barcode/php-barcode/php-barcode.php'); dol_syslog("modPhpbarcode::buildBarCode $code,$encoding,$scale,$mode"); if ($code) $result=barcode_print($code,$encoding,$scale,$mode); if (! is_array($result)) { $this->error=$result; print $this->error;exit; return -1; } return 1; }
if (get_magic_quotes_gpc()) { $code = stripslashes(getvar('code')); $mode = stripslashes(getvar('mode')); $scale = stripslashes(getvar('scale')); $encoding = stripslashes(getvar('encoding')); } else { $code = getvar('code'); $mode = getvar('mode'); $scale = getvar('scale'); $encoding = getvar('encoding'); } if (!$code) { $code = '123456789012'; } if (!$mode) { $mode = 'png'; } if (!$scale) { $scale = '2'; } if (!$encoding) { $encoding = 'EAN'; } barcode_print($code, $encoding, $scale, $mode); /* * call * http://........./barcode.php?code=012345678901 * or * http://........./barcode.php?code=012345678901&encoding=EAN&scale=4&mode=png * */
* GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ require "php-barcode.php"; function getvar($name) { global $_GET, $_POST; if (isset($_GET[$name])) { return $_GET[$name]; } else { if (isset($_POST[$name])) { return $_POST[$name]; } else { return false; } } } $code = stripslashes(getvar('code')); if (!$code) { $code = '123456789012'; } barcode_print($code, getvar('encoding'), getvar('scale'), getvar('mode')); /* * call * http://........./barcode.php?code=012345678901 * or * http://........./barcode.php?code=012345678901&encoding=EAN&scale=4&mode=png * */
<?php require_once "php-barcode.php"; !$_GET['code'] ? $code = '000000000000' : ($code = $_GET['code']); !$_GET['scale'] ? $scale = 1 : ($scale = $_GET['scale']); barcode_print($code, encoding, $scale, mode);
if (preg_match("#^(text|txt|plain)\$#i", $mode)) { print barcode_outtext($bars['text'], $bars['bars']); } elseif (preg_match("#^(html|htm)\$#i", $mode)) { print barcode_outhtml($bars['text'], $bars['bars'], $scale, 0, 0); } else { barcode_outimage($bars['text'], $bars['bars'], $scale, $mode); } return $bars; } function generateEAN($number) { $code = '200' . str_pad($number, 9, '0'); $weightflag = true; $sum = 0; // Weight for a digit in the checksum is 3, 1, 3.. starting from the last digit. // loop backwards to make the loop length-agnostic. The same basic functionality // will work for codes of different lengths. for ($i = strlen($code) - 1; $i >= 0; $i--) { $sum += (int) $code[$i] * ($weightflag ? 3 : 1); $weightflag = !$weightflag; } $code .= (10 - $sum % 10) % 10; return $code; } $code = $_GET['shtrihkod']; //if (!$code) $code='123456789012'; //$code=generateEAN('1256789'); //echo ""; //$code=$_GET['shtrihkod']; barcode_print($code, 'EAN', 2, 'png');
/** * Return an image file on the fly (no need to write on disk) * * @param string $code Value to encode * @param string $encoding Mode of encoding * @param string $readable Code can be read * @param integer $scale Scale * @return int <0 if KO, >0 if OK */ function buildBarCode($code, $encoding, $readable = 'Y', $scale = 1) { global $_GET, $_SERVER; global $conf; global $genbarcode_loc, $bar_color, $bg_color, $text_color, $font_loc; if (!$this->encodingIsSupported($encoding)) { return -1; } if ($encoding == 'EAN8' || $encoding == 'EAN13') { $encoding = 'EAN'; } if ($encoding == 'C39' || $encoding == 'C128') { $encoding = substr($encoding, 1); } $mode = 'png'; $_GET["code"] = $code; $_GET["encoding"] = $encoding; $_GET["scale"] = $scale; $_GET["mode"] = $mode; dol_syslog(get_class($this) . "::buildBarCode {$code},{$encoding},{$scale},{$mode}"); if ($code) { $result = barcode_print($code, $encoding, $scale, $mode); } if (!is_array($result)) { $this->error = $result; print $this->error; return -1; } return 1; }
<? require("php-barcode.php"); barcode_print($_GET[codigo],"128",$_GET[tamano],"PNG"); ?>
print_header("{$course->shortname}: {$blended->name}: {$strlabelspage}: {$strprintlabels}", "{$course->shortname}", $navigation, "", "", true, update_module_button($cm->id, $course->id, $blended->name, $strlabelspage, $strprintlabels), navmenu($course, $cm)); // Print the main part of the page ---------------------------------- print_spacer(30); $url = "labels.php?a={$blended->id}"; if ($code == -1) { notice(get_string("cantprintlabel", "blended"), $url); } else { if ($code == -2) { notice(get_string("cantprintlabel2", "blended"), $url); } } print_spacer(20); } // ACTION BARCODE imprime una etiqueta if ($action == 'barcode') { barcode_print($code, "ean", $scale, "png"); } else { if ($action == 'sheet') { $numrows = required_param('numrows', PARAM_INT); $numcolumns = required_param('numcolumns', PARAM_INT); echo '<table align="left">'; for ($r = 0; $r < $numrows; $r++) { echo "<tr>"; for ($c = 0; $c < $numcolumns; $c++) { echo "<td><img src=\"printlabels.php?a={$blended->id}&action=barcode&scale=2&code={$code}\" ></td>"; } echo "</tr>"; } echo '</table>'; } }