<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">

body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.mainbarcode {
	height: 200px;
	width: 300px;
	margin: 0px;
	padding: 0px;
}
.price {
	width: 100px;
	float: left;
	
	margin-top:30px;
	margin-left:15px;
	
	font-size: 35px;
	font-weight:bold;
}
.parcodeimage {
	float: right;
	margin-right: 10px;
	margin-top:-37;
}
.barcodnum {
	float: right;
	text-align: center;
	margin-right: 8px;
	margin-left: 0px;
	margin-bottom: 5px;
	font-size: 30px;
	font-weight: bold;
	margin-top: -20px;
	font-weight: bold;
	}
.single {
	height: 90px;
	float: right;
	
	width: 300px;
	border-bottom-width: medium;
	border-bottom-style: dotted;
	border-bottom-color: #000;
	margin-bottom: 5px;
	margin-top: 5px;
}
.companyname {
    font-weight: bold;
    float: left;
    position: relative;
    font-size: 20px;
    left: -110px;
    font-family: Verdana,Geneva,sans-serif;

}
.productname {
position: relative;
background-color: #FFF;
margin: -25px -15px 0px 0px;
font-size: 18px;
font-weight: bold;
width: 300px;
height: 20px;

text-align: center;
float:left;
}



.barcodnum1 {
position: relative;
background-color: #FFF;

font-size: 16px;
font-weight: bold;
width: 100%;
margin-top:-25px;
left:0px;
text-align: center;
}


</style>
<style>
@media all {
.page-break {
	display: none;
	margin:0;
	padding:0;
}
}
 @media print {
.page-break {
	display: block;
	page-break-before: always;
}
}
</style>
<style type="text/css" media="print">
a{
	visibility:hidden;
	display:none;
	}
</style>
<style type="text/css">
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
</style>
</head>
<script src="../views/default/assets/js/jquery.js"></script>
<body>
<script>
$(document).ready(function(e) {
    window.print() ;
    setTimeout(window.close, 0);
});
</script>
<? 
 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");
 
 
     $itr=$_POST["itr"];
	 
	 //echo $checkbx ;
	 for($i=1;$i<=$itr;$i++)
	 {
		 //'parcode'.$i.''
		$Qty=$_POST['productnum'.$i.''];
		$barcode=$_POST['productbarcode'.$i.''];	
		$name=$_POST['productname'.$i.''];
		//print_r($name."<br>");	
		$price=$_POST['price'.$i.''];	
		//print_r($price."<br>");	
	 }
 $name22=$_POST['name'];
// echo $name22 ;
 	/*$barcode=$_GET["parcode"];	
	$name=$_GET["name"];	
	$price=$_GET["price"];	*/
	$drawtext="on";
	$type     = "C128B";
	$width    = "190";	
	$height   = "60";
	$xres     = "2";
	$font     = "4";
	$output   = "png"; 		
	
	//$today=date("dm");	
	//$barcode=$barcode.$today;	  
		//print($today);			
if (isset($barcode) && strlen($barcode)>0) {   
  $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; 
  
  switch ($type)
  {
    case "I25":
			  $obj = new I25Object(250, 120, $style, $barcode);
			  break;
    case "C39":
			  $obj = new C39Object(250, 120, $style, $barcode);
			  break;
    case "C128A":
			  $obj = new C128AObject(250, 120, $style, $barcode);
			  break;
    case "C128B":
			  $obj = new C128BObject(250, 120, $style, $barcode);
			  break;
    case "C128C":
                          $obj = new C128CObject(250, 120, $style, $barcode);
			  break;
	default:
			$obj = false;
  }
  if ($obj) {
     if ($obj->DrawObject($xres)) {
$checkbx=$_POST['speparcode'];	
$priceoption=$_POST["pricOption"];
$priceoption1=$_POST["pricOption1"];
$double = $_POST['double'];
if($checkbx=="1"){

	if ($double=="1"){
			
					 
				//echo '<div class="mainbarcode">	 ';
					for($i=1;$i<=$itr;$i++)
 {	
 
					 for($x=0;$x<$_POST['productnum'.$i.''];$x++){
					 if(($x%2==0)){
			  
			  echo '  <div class="mainbarcode">';
			  }	 
					
				echo '	 
		  <div class="single">
			<div class="price">'.$_POST['price'.$i.''].'</div>
			<div>
			     <div class="companyname">'.$name22.'</div>
				 <div class="barcodnum">'.$_POST['productbarcode'.$i.''].'</div>
			
			</div>
			<div class="parcodeimage"><img style="margin-top:-40px;" src="../library/barcode/image.php?code='.$_POST['productbarcode'.$i.''].'&style='.$style.'&type='.$type.'&width='.$width."&height=".$height.'&xres='.$xres.'&font='.$font.'"></div>
			<div class="productname">'.$_POST['productname'.$i.''].'</div>
		</div>
		  ';
		 if($x%2==1){
			  
			  echo '</div>';
			  
			  }
			
				 } 
						
		
		
 }
		
		}else{
	

		$width = 128;		 
$drawtext="on";
$height=55;
	
		for($i=1;$i<=$itr;$i++)
 {
		 for($x=0;$x<$_POST['productnum'.$i.''];$x++){
			 
			 
	 echo '<div style="width:152px; margin-top:10px;">
	  <span style="font-size:16px;float:left;margin-left:10px;font-weight: bold;">'.$_POST['price'.$i.''].' </span>
	 <span style="font-size:16px;float:right;margin-right:5px;;font-weight: bold;">'.$_POST['productname'.$i.''].'</span>
	 <div align="center" ><img src="../library/barcode/image.php?code='.$_POST['productbarcode'.$i.''].'&style='.$style.'&type='.$type.'&width='.$width."&height=".$height.'&xres=1&font=2"/><div class="barcodnum1">'.$_POST['productbarcode'.$i.''].'</div></div> ';
	
	 if($priceoption1=="1")
			{
				 echo'
				  <span style="font-size:11px;float:left;margin-left:10px;position:absolute;padding-top:53px;margin-left:-120px;">'.($_POST['pricen'.$i]+10).'<span/>';
				  
	 		 }
	  
	
	 echo'</div><div style="visibility:hidden">/n</div>';


		 } 
		 }}
	
	}else{


    
    	 ?>
<link href="../views/default/assets/css/print.css" rel="stylesheet">
<div style="width:760px; padding-left:28px; padding-right:28px; padding-top:30px;  margin:auto; " align="center">
<?php 
	$drawtext="on";

	$width = 128;	 
	$xres = 1 ;
$height = 75;
//print_r('pricOption'.$pricOption);
if($priceoption !="1")
{
	
	
 for($i=1;$i<=$itr;$i++)
 {
	 
for($x=0;$x<$_POST['productnum'.$i.''];$x++){

	 echo '<div style="width:152px;float:right"><span style="font-size:11px;float:right;margin-right:15px;">'.$_POST['productname'.$i.''].'</span>
	
	 <img src="../library/barcode/image.php?code='.$_POST['productbarcode'.$i.''].'&style='.$style.'&type='.$type.'&width='.$width."&height=".$height.'&xres='.$xres.'&font='.$font.'">
	 
	 <div style="float:right; margin-right:11px;margin-left:12px;padding:0px">

</div></div>';
				if($checkbx=="1"){
					echo'<span style="visibility:hidden">f</span><div class="page-break"></div>';
				}


		 }
 }
}
else
{
	
	
	for($i=1;$i<=$itr;$i++)
 {
		 for($x=0;$x<$_POST['productnum'.$i.''];$x++){
	 echo '<div style="width:152px;float:right">
	  <span style="font-size:11px;float:left;margin-left:10px;">'.$_POST['price'.$i.''].'.LE 
	 <span style="font-size:11px;float:right;margin-right:15px;">'.$_POST['productname'.$i.''].'</span>
	
	 <img src="../library/barcode/image.php?code='.$_POST['productbarcode'.$i.''].'&style='.$style.'&type='.$type.'&width='.$width."&height=".$height.'&xres='.$xres.'&font='.$font.'"> '; 
		 if($priceoption1=="1"){ 
	 echo '
	  <span style="font-size:11px;float:left;margin-left:10px;position:absolute;padding-top:53px;margin-left:-120px;">'.($_POST['pricen'.$i]+10).'';}
	 echo '
	 <div style="float:right; margin-right:11px;margin-left:12px;padding:0px">
	 </span>

</div></div>';
			
		 }
 }
	
}

// <span style="font-size:11px;float:left;margin-left:10px;">'.$_GET['price'].' L.E</span>
 
	 }
 }
	
}  
}  

?>
<a href="productController.php?do=showbarcode">
<input name="" value="رجوع"  type="button"  class="noprint"/>
</a>
</body>
</html>
