<?php
session_start();

if($_SESSION['dbName']==""){
header("location:../index.php");
}

include("config.inc.php");

$connection = mysql_connect($config['dbServer'],$config['dbUser'],$config['dbPass'],true,65536) or die("Could not connect to DB");
mysql_select_db($_SESSION['dbName'],$connection) or die("Could not find DB");

$actionmode       = $_GET['actionmode'];
$item_barcode     = $_GET['item_barcode'];
$projects         = $_GET['projects'];
$list_of_costcent = $_GET['list_of_costcent'];
$quantity_needed  = $_GET['quantity_needed'];

if($actionmode == "generatebarcode1"){
	$list_of_costcent = substr($list_of_costcent, 0, strlen($list_of_costcent)-2);
	$list_of_costcent = explode(",", $list_of_costcent);
	$i = 1;
	while($i <= $quantity_needed){
	foreach($list_of_costcent as $val){
		$text = $item_barcode.$projects.$val;
		echo "<img src='test_1D.php?text=$text' height='25'  width='170' border=0>";
		echo "<br>$text<br><br>";
	}
	$i++;
	}
	
}
?>