<?php

$html_popover = "";
foreach ($i["packed"] as $p){
    $html_popover .= "<p class='packed-popover'><strong>".$p["packed_item_datetime"]."</strong> - ".$p["client_name"]."</p>";
}
?>

<div data-html="true" data-placement="top" data-trigger="manual" data-toggle="popover"
     data-content="<?=$html_popover?>"
     class="amount-inner <?php if($i["amount"] == count($i["packed"])) echo "true"; else echo "false"; ?>">
    
        <?=count($i["packed"]) ?>
        <span>/</span>
        <?php if (floor($i["amount"]) == $i["amount"]) echo round($i["amount"]); else echo $i["amount"]?>
</div>
