<?php
require_once('../Connections/courier.php'); 
require_once('libs/phpqrcode/qrlib.php');
/////////////// Select items from service items table ///////////////////
//echo "SELECT * FROM service_items WHERE ins_com_code = '' OR qr_code IS NULL LIMIT 0,100";
// $query = mysql_query("SELECT * FROM service_items WHERE ins_com_code = '' OR ins_com_code IS NULL LIMIT 0,1");
// $numOfRows = mysql_num_rows($query);
// if ($numOfRows > 0) {
// 	while ($fetchResult = mysql_fetch_assoc($query)) {

    $dateNow = date("His");
    $letter = rand(65,90);
    $any_number = rand(1,100);
    $qrCode = $dateNow.$letter.$any_number.$fetchResult['id'];

	$tempDir = ''; 
	$qrCodeValue = $qrCode;
	$itemId =  $fetchResult['id'];
	$filename = '12345678';
	$itemName =  $fetchResult['item'];
	$codeContents = '12345678'; 
	QRcode::png($codeContents, $tempDir.''.$filename.'.png', QR_ECLEVEL_L, 5);
	$newfilename = $filename;
//////////////////// Insert qr into service item table //////////////
// mysql_query("UPDATE service_items SET ins_com_code ='$newfilename' WHERE id='$itemId'");
// 	}
// }




?>

