<?php
class Example_Test
{
public static function getHtml()
{
$colorband[0]['redlow'] = 255;
$colorband[0]['redhigh'] = 255;
$colorband[0]['greenlow'] = 150;
$colorband[0]['greenhigh'] = 215;
$colorband[0]['bluelow'] = 0;
$colorband[0]['bluehigh'] = 60;
$colorband[0]['targetWidth'] = 15;
$colorband[0]['maxWidth'] = 3;
$colorband[0]['minWidth'] = 1;
$colorband[1]['redlow'] = 0;
$colorband[1]['redhigh'] = 255;
$colorband[1]['greenlow'] = 0;
$colorband[1]['greenhigh'] = 0;
$colorband[1]['bluelow'] = 0;
$colorband[1]['bluehigh'] = 255;
$colorband[1]['targetWidth'] = 25;
$colorband[1]['maxWidth'] = 7;
$colorband[1]['minWidth'] = 1;
shuffle($colorband);
$borderWidthTargetArray[0]=3;
$borderWidthTargetArray[1]=3;
$borderStyle='';
$numStripeArray=0;
$numStripeArrays = count($colorband);
$ij=0;
$betterArray=array();
foreach( $colorband as $key=>$stripes):
$borderWidthTarget = $stripes['targetWidth'];
$numStripeArray++;
$borderWidthtotal=0;
$borderWidthtotal8=0;
$maxWidth=$stripes['maxWidth'];
$minWidth=$stripes['minWidth'];
while ($borderWidthtotal < $borderWidthTarget and $ij < 500):
$borderWidthThisLayer=rand($minWidth, $maxWidth);
$borderWidthtotal=$borderWidthtotal+$borderWidthThisLayer;
$betterArray[]= $borderWidthThisLayer;
$thisStripe = $borderWidthThisLayer . "px solid " . "rgb("
. rand($stripes['redlow'], $stripes['redhigh']) . ","
. rand($stripes['greenlow'], $stripes['greenhigh']) . ","
. rand($stripes['bluelow'], $stripes['bluehigh']) . "
);";
$borderStyle .= '#customwrap' . $ij
. " {border-left:" .$thisStripe . "border-top:" .$thisStripe . "border-bottom:" .$thisStripe . "border-right:" .$thisStripe ."z-index:999999;}
";
$ij++;
if ($borderWidthTarget-$borderWidthtotal<=$maxWidth):
$borderWidthThisLayer=$borderWidthTarget-$borderWidthtotal-1;
$borderWidthtotal=$borderWidthtotal+$borderWidthThisLayer;
$betterArray[]= $borderWidthThisLayer;
$thisStripe = $borderWidthThisLayer . "px solid " . "rgb("
. rand($stripes['redlow'], $stripes['redhigh']) . ","
. rand($stripes['greenlow'], $stripes['greenhigh']) . ","
. rand($stripes['bluelow'], $stripes['bluehigh']) . "
);";
$borderStyle .= '#customwrap' . $ij
. " {border-left:" .$thisStripe . "border-top:" .$thisStripe . "border-bottom:" .$thisStripe . "border-right:" .$thisStripe ."z-index:999999;}
";
$ij++;
$borderWidthThisLayer=1;
$borderWidthtotal=$borderWidthtotal+$borderWidthThisLayer;
$betterArray[]= $borderWidthThisLayer;
$borderStyle .= '#customwrap' . $ij
. " {border-left:3px solid #000; border-bottom:3px solid #000; border-top:3px solid#000; border-right:3px solid#000; #000;z-index:999999;}";
if ($numStripeArray == $numStripeArrays):
$borderStyle .= '#customwrap' . $ij
. " {box-shadow:inset 0 0 1px #000;}";
else:
$ij++;
endif;
endif;
endwhile;
endforeach;
echo '<style>' . $borderStyle . '</style>';
if (isset($betterArray)):
foreach($betterArray as $key=>$better):
echo '<div id="customwrap' . $key . '">';
endforeach;
endif;
}
}