<br/>
<?php
$running_time = $tpl['from'];
for($i = 0; $i < 24; $i ++)
{
	$print_time = date('H:i', $running_time);
	$key_date = date('Y-m-d H', $running_time);
	$num_supports = !empty($tpl['support'][$key_date]) ? count($tpl['support'][$key_date]) : 0; 
	$num_customers = !empty($tpl['customer'][$key_date]) ? count($tpl['customer'][$key_date]) : 0; 
	$support_px = intval($num_supports * 53 / 5);
	$customer_px = intval($num_customers * 53 / 5);
	if($support_px > 4){
		$support_px = $support_px - 4;
	}
	if($customer_px > 4){
		$customer_px = $customer_px - 4;
	}
	?>
	<div class="time-row">
		<label><?php echo $print_time ?></label>
		<div class="reply-bar">
			<div class="customer"><div class="middle" style="width:<?php echo $customer_px;?>px;">&nbsp;</div><div class="right"></div></div>
			<div class="support"><div class="middle" style="width:<?php echo $support_px;?>px;">&nbsp;</div><div class="right"></div></div>
		</div>
	</div>
	<?php
	$running_time = strtotime(date('Y-m-d H:i:s', $running_time) . "+1 hour");
}

?>