<?php 

ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);

require_once 'mxl-reader-master/src/Mxl.php';

//$dch = file('http://flowerswholesale.ru/price/data.txt');
$price = '/home/john/www/flowerswholesale.ru/price/4.mxl';
$dchp = filemtime($price);
print_r($price);
print_r($dchp);

//$url = file_get_contents('http://flowerswholesale.ru/price/4.mxl');

$mxl = new \VampiRUS\MxlReader\Mxl($price);
$a = $mxl->getDataAsArray();
//print_r($a);

unset($a[0],$a[1],$a[2],$a[3],$a[4],$a[5],$a[6]);

$rosken=' Роза 40 Кения';
$req = '';
$reqw = '';
$reqr = '';
$tros = '';
$tulip = '';
$tros='';
$url ='/home/john/www/flowerswholesale.ru'; 
//print_r($rosken);

$array = array(
	array($rosken,7,0,$url.'/ssi/price/7ke.html'),
	array($rosken,9,0,'/ssi/price/9ke.html'),
	array($rosken,11,0,'/ssi/price/11ke.html'),
	array($rosken,15,0,'/ssi/price/15ke.html'),
	array($rosken,25,0,'/ssi/price/25ke.html'),
	array($rosken,51,0,'/ssi/price/51kenya.html'),
	array($rosken,51,0,'/ssi/price/101kenya.html'),
	array($rosken,101,0,'/ssi/price/51kenya-red.html'),
	array($rosken,101,0,'/ssi/price/101kenya-red.html'),
    array($rosken,1,0,'/ssi/price/kenya-promo.html'),
	array($rosken,1,0,'/ssi/price/kenya-red.html'),
	array($rosken,1,0,'/ssi/price/kenya-white.html'),
	array($rosken,1,0,'/ssi/price/kenya-promo.html'),
	//array('Роза 35-40 см Кения микс',1,0,'/ssi/price/kenya-red.html'),
	//array('Роза 35-40 см Кения микс',1,0,'/ssi/price/kenya-white.html'),
	array('Альстромерия',1,0,'/ssi/price/alstr.html'),

	array($req,7,0,'/ssi/price/7eq.html'),
	array($req,9,0,'/ssi/price/9eq.html'),
	array($req,11,0,'/ssi/price/11eq.html'),
	array($req,15,0,'/ssi/price/15eq.html'),
	array($req,25,0,'/ssi/price/25equador.html'),
	array($req,51,0,'/ssi/price/51equador.html'),
	array($req,101,0,'/ssi/price/101equador.html'),
	array($req,25,0,'/ssi/price/25equador-red.html'),
	array($req,25,0,'/ssi/price/25equador-white.html'),
    array($req,51,0,'/ssi/price/51equador-red.html'),
	array($req,51,0,'/ssi/price/51equador-white.html'),
	array($req,101,0,'/ssi/price/101equador-red.html'),
	array($req,101,0,'/ssi/price/101equador-white.html'),
	array($req,1,0,'/ssi/price/ecuador-white-promo.html'),
    array($req,1,0,'/ssi/price/ecuador-promo.html'), // 50см вероятно
	array($req,1,0,'/ssi/price/ecuador-red-promo.html'),
	array($req,1,0,'/ssi/price/eq-promo.html'),

	array($tulip,1,0,'/ssi/price/tulip-promo.html'),

);

foreach ($a AS $a3)
{
foreach ($array AS $ar)
{ 
if ($a3[2] == $ar[0])
{ 	
	//print_r('('.$a3[2].')');
	//print_r('('.$ar[0].')');
$z=$a3[3]*$ar[1];
file_put_contents($ar[3], $z);
//print_r($ar[3]);
}}}


?>

