<!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>
</head>
 <link href="../views/default/assets/css/print.css" rel="stylesheet">
 <script src="../views/default/assets/js/jquery.js"></script>
<body>
<script>
$(document).ready(function(e) {
	//alert('fff');
   window.print() ;
});
</script>
<body>
<? 
 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"];
	
	 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>");	
	 }
 
 	/*$barcode=$_GET["parcode"];	
	$name=$_GET["name"];	
	$price=$_GET["price"];	*/
	$drawtext="on";
	$type     = "C128B";
	$width    = "128";	
	$height   = "74";
	$xres     = "1";
	$font     = "2";
	$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)) {
		 
		 ?>
         <div style="width:760px; padding-left:28px; padding-right:28px; padding-top:30px;  margin:auto; " align="center">
<?php 

$priceoption=$_POST["pricOption"];
//print_r('pricOption'.$pricOption);
if($priceoption !="1")
{
	
	
 for($i=1;$i<=$itr;$i++)
 {
	// print_r("itr".$itr."<br>");
		 for($x=0;$x<$_POST['productnum'.$i.''];$x++){
			 
			  $serailcount=$_POST['serailcount'.$i.''];
			  
			 // print_r($serailcount."serailcount"."<br>");
			  
			 for($j=1;$j<=($serailcount);$j++)
			  {
				  
			//  print_r($_POST[''.$i.'serialnumber'.$j.'']."serialnumber<br>");
			  
		 // print_r("productnum".$_POST['productnum'.$i.'']."<br>");
	 echo '<div style="width:152px;float:right"><span style="font-size:11px;float:right;margin-right:15px;">'.$_POST['productname'.$i.''].'</span>
	
	 <img src="http://www.barcodesinc.com/generator/image.php?code='.$_POST[''.$i.'serialnumber'.$j.''].'&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>';
			  }
		 }
 }
}
else
{
	
	
	for($i=1;$i<=$itr;$i++)
 {
		 for($x=0;$x<$_POST['productnum'.$i.''];$x++){
		 
		  
			  $serailcount=$_POST['serailcount'.$i.''];
			  
			 // print_r($serailcount."serailcount"."<br>");
			  
			
		  for($j=1;$j<=$serailcount;$j++)
		  {
			  
	 echo '<div style="width:152px;float:right">
	  <span style="font-size:11px;float:left;margin-left:10px;">'.$_POST['price'.$i.''].' L.E
	 <span style="font-size:11px;float:right;margin-right:15px;">'.$_POST['productname'.$i.''].'</span>
	
	 <img src="http://www.barcodesinc.com/generator/image.php?code='.$_POST[''.$i.'serialnumber'.$j.''].'&style='.$style.'&type='.$type.'&width='.$width."&height=".$height.'&xres='.$xres.'&font='.$font.'">
	 
	 <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>
 
 // }
//}
?>
<br />
<a href="productController.php?do=showserial"><input name="" value="رجوع"  type="button"  class="noprint"/></a>
</body>
</html>
