File: /home/mostafedeg/public_html/erp/controllers/printparcodedetailed.php
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<!--<link href="https://fonts.googleapis.com/css?family=Varela+Round&display=swap" rel="stylesheet">-->
<!-- instead of link with href from web use it direct -->
<style>
/* hebrew */
@font-face {
font-family: 'Varela Round';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Varela Round Regular'), local('VarelaRound-Regular'), url(https://fonts.gstatic.com/s/varelaround/v12/w8gdH283Tvk__Lua32TysjIfpcuPP9g.woff2) format('woff2');
unicode-range: U+0590-05FF, U+20AA, U+25CC, U+FB1D-FB4F;
}
/* vietnamese */
@font-face {
font-family: 'Varela Round';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Varela Round Regular'), local('VarelaRound-Regular'), url(https://fonts.gstatic.com/s/varelaround/v12/w8gdH283Tvk__Lua32TysjIfqMuPP9g.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Varela Round';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Varela Round Regular'), local('VarelaRound-Regular'), url(https://fonts.gstatic.com/s/varelaround/v12/w8gdH283Tvk__Lua32TysjIfqcuPP9g.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Varela Round';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Varela Round Regular'), local('VarelaRound-Regular'), url(https://fonts.gstatic.com/s/varelaround/v12/w8gdH283Tvk__Lua32TysjIfp8uP.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
</style>
<style type="text/css">
@font-face {
font-family: 'DinNextRegular';
src: url('../views/default/assets/fonts/DinNextRegular.eot');
src: url('../views/default/assets/fonts/DinNextRegular.eot?#iefix') format('embedded-opentype'),
url('../views/default/assets/fonts/DinNextRegular.woff2') format('woff2'),
url('../views/default/assets/fonts/DinNextRegular.woff') format('woff'),
url('../views/default/assets/fonts/DinNextRegular.ttf') format('truetype'),
url('../views/default/assets/fonts/DinNextRegular.svg#DinNextRegular') format('svg');
font-weight: normal;
font-style: normal;
}
.barcode5{
width: 152px;
margin: -7px;
padding: 0 5px;
margin-top: 0;
/* margin-bottom: 27px; */
/* border: 1px solid #ddd; */
font-weight: bold;
letter-spacing: 1;
overflow: hidden;
margin-top: 10px!important;
margin-bottom: 10px!important;
display: block;
font-family: 'Varela Round', sans-serif;
}
.barcode5 .logo,.cat{
//width:50%;
float:left;
font-size:10px;
font-weight:bold
}
.barcode5 .logo{
font-size: 16px;
margin-top: -2px;
}
.barcode5 .code{
font-size:13px;
letter-spacing:1.5;
margin:0
}
.barcode5 img{
width: 96%;
height: 20px;
margin: 0;
margin-bottom: 1px;
}
.barcode5 .left{
width:75%;
float:left;
border-right:1px solid #ddd
}
.barcode5 .code{
margin:0;
font-size:11px;
letter-spacing:.5px;
text-align: center;
}
.barcode5 h5,.barcode5 h6{
margin:0
}
.logo-row{
display: block;
overflow: hidden;
}
.barcode5 .size{
margin-bottom:0px;
margin-top:0px
}
.barcode5 hr{
margin:0;
height:1px;
padding:0
}
.barcode5 .right{
width: 20%;
float: left;
padding-left: 4px;
text-transform: uppercase;
text-align: center;
}
.barcode5 .currency {
font-size: 9px!important;
}
.barcode5 h6{
font-size: 10px;
margin: 0;
height: 14px;
text-transform: capitalize;
}
.barcode5 .size span,.barcode5 .price span{
font-size:12px;
margin-top:-4px
}
.barcode5 .ref p{
font-size:11px;
margin:0
}
.barcode5 .prod-name{
font-size:11px
}
.barcode5 .size h6,.price h6{
}
.barcode5 .cat{
text-transform: uppercase;
float: right;
}
.barcode5 .underline{
text-decoration: underline;
}
</style>
</head>
<script src="../views/default/assets/js/jquery.js"></script>
<body>
<script>
$(document).ready(function (e) {
window.print();
setTimeout(window.close, 0);
});
</script>
<?php
//define (__TRACE_ENABLED__, false);
//define (__DEBUG_ENABLED__, false);
require("../library/barcode/barcode.php");
require("../library/barcode/i25object.php");
require("../library/barcode/c39object.php");
require("../library/barcode/c128aobject.php");
require("../library/barcode/c128bobject.php");
require("../library/barcode/c128cobject.php");
//include all DAO files
require_once('../models/sql/Connection.class.php');
require_once('../models/sql/ConnectionFactory.class.php');
require_once('../models/sql/ConnectionProperty.class.php');
require_once('../models/sql/QueryExecutor.class.php');
require_once('../models/sql/Transaction.class.php');
require_once('../models/sql/SqlQuery.class.php');
require_once('../models/core/ArrayList.class.php');
require_once('../models/dao/DAOFactory.class.php');
//Programsetting
require_once('../models/dao/ProgramsettingsDAO.class.php');
require_once('../models/dto/Programsetting.class.php');
require_once('../models/mysql/ProgramsettingsMySqlDAO.class.php');
require_once('../models/mysql/ext/ProgramsettingsMySqlExtDAO.class.php');
$ProgramsettingDAO = new ProgramsettingsMySqlDAO();
$programsettingsdata = $ProgramsettingDAO->load(1);
$itr = $_POST["itr"];
$name22 = $_POST['name'];
$userFontSize = (int) $_POST['size'];
if (empty($userFontSize)) {
$userFontSize = 16;
}
$priceoption = (int) $_POST['pricOption'];
$parcodeTypeToPrint = 1; //(int) $_POST['parcodeTypeToPrint'];
$userCurrency = $_POST['currency'];
if (empty($_POST["pricOption"])) {
$userCurrency = '';
}
$showCat = (int) $_POST['cat'];
for ($i = 1; $i <= $itr; $i++) {
for ($x = 0; $x < $_POST['productnum' . $i]; $x++) {
$price = 0;
$catname = $_POST['catname' . $i];
if ($showCat == 0) {//hide it so make it empty
$catname = '';
}
$priceText = 'price';
switch ($priceoption) {
case 0:
$price = '';
$userCurrency = '';
$priceText = '';
break;
case 1://total
$price = (float) $_POST['pricenen' . $i];
break;
case 2://half
$price = (float) $_POST['pricen' . $i];
break;
case 3://piece price
$price = (float) $_POST['price' . $i];
break;
}
if ($parcodeTypeToPrint == 0) {//الباركود القديم
$drawtext = "off";
//$type = "C128B";//supports numbers, upper- and lower-case letters and some additional characters.
$type = $settingType = $programsettingsdata->parcodeprinttype; //"C128A"; //supports numbers, upper-case letters, and control characters, such as tab and new-line.
$oddType = "C128A";
$width = $programsettingsdata->parcodeprintwidth; //"200";
$height = "70"; //"100";
$xres = "1"; //"2";
$font = 1; //"4";
$output = "png";
$style = BCS_ALIGN_CENTER;
$style |= ($output == "png" ) ? BCS_IMAGE_PNG : 0;
$style |= ($output == "jpeg") ? BCS_IMAGE_JPEG : 0;
$style |= ($border == "on" ) ? BCS_BORDER : 10;
$style |= ($drawtext == "on" ) ? BCS_DRAW_TEXT : 0;
$style |= ($stretchtext == "on" ) ? BCS_STRETCH_TEXT : 0;
$style |= ($negative == "on" ) ? BCS_REVERSE_COLOR : 0;
//$style = 37; //this style is with border
$type = $settingType;
if (strlen($_POST['productbarcode' . $i . '']) % 2 == 1) {
$type = $oddType;
}
$img = '<img src="../library/barcode/image.php?code=' . $_POST['productbarcode' . $i . ''] . '&style=' . $style . '&type=' . $type . '&width=' . $width . "&height=" . $height . '&xres=' . $xres . '&font=' . $font . '">';
} elseif ($parcodeTypeToPrint == 1) {//الباركود الجديد
$img = '<img src="../library/barcode2/barcode.php?text=' . $_POST['productbarcode' . $i . ''] . '&codetype=code128&size=50&print=false&sizefactor=1.4">';
}
echo '
<div class="barcode5">
<div class="logo-row">
<div class="logo" style="font-size:' . $userFontSize . 'px">' . $_POST['productname' . $i] . '</div>
<div class="cat">' . $catname . '</div>
</div>
<div>
<span class="left">
<h5 class="prod-name"> ' . $_POST['pk' . $i] . '</h5>
' . $img . '
<div class="code">
<span class="">' . $_POST['productbarcode' . $i] . '</span>
</div>
<div class="ref">
<p><span class="underline"></span> ' . $_POST['ref' . $i] . '<br>' . $_POST['madein' . $i] . '</p>
</div>
</div>
<div class="right">
<div class="size">
<h6 class="underline">size</h6>
<span>' . $_POST['productsize' . $i] . '</span>
</div>
<div class="price">
<h6 class="underline">' . $priceText . '</h6>
<span>' . $price . '</span>
<span class="currency">' . $userCurrency . '</span>
</div>
</div>
</div>';
}
}
?>
</body>
</html>