<thead> <tr <?php echo isset($_GET["tipoReporte"]) ? "" : "class='ui-widget-header'"; ?> > <th width="190">Customer</th> <th width="100">Need</th> <th width="100">Available</th> <th width="100">Missing</th> </tr> </thead> <tbody> <?php include_once "../model/Item.php"; $itemObj = new Item(); $customers = $itemObj->missingReportDetail($_GET["iditem"]); $available = $_GET["available"]; foreach ($customers as $customer) { if ($customer["available"] == "") { if ($available >= $customer["need"]) { $available = $available - $customer["need"]; $custAvailable = $customer["need"]; } else { $custAvailable = $available; $available = 0; } } else { $custAvailable = $customer["available"]; } ?> <tr>