rendered paste body<?php
require_once('connect.php');
//individual lab totals
$result=mysql_query("select * FROM inventory ORDER BY lab_order")or die(mysql_error());
$number_returned = mysql_num_rows($result);
$width_of_rows = (90/$number_returned);
$spacer=7/$number_returned;
echo '<div style="width:150px; height:150px; border:2px solid #999; background:#e0dad8;">';
while ($row = mysql_fetch_object($result))
{
$percentage_paper = ($row->ink/$row->total_possible_ink)*100;
//$percentage_paper=1;
$percentage_paper_margin = 100-$percentage_paper;
echo '<div style="margin-bottom:0%; background:#3eb33c; margin-top:'.$percentage_paper_margin.'%; margin-left:'.$spacer.'; margin-right:'.$spacer.'; float:left; width:'.$width_of_rows.'%; height:'.$percentage_paper.'%;"></div>';
}
echo '</div>';