Skip to content

Instantly share code, notes, and snippets.

@cam-gists
Created January 11, 2013 22:09
Show Gist options
  • Save cam-gists/4514379 to your computer and use it in GitHub Desktop.
Save cam-gists/4514379 to your computer and use it in GitHub Desktop.
better indents??
<?php
$array = array(
'within' => 0,
'near' => 0,
'exceed' =>
);
foreach($data as $key => $value)
{
$r = businessHours(strtotime($value->ordereddate))/3600;
$diff = $r - $value->standard_sla;
if( $diff <= 0 ){
$data['within']++;
}
elseif($diff <= $value->standard_sla - 1){
$data['near']++;
}
elseif($diff <= $value->standard_sla){
$data['within']++;
}
elseif($diff > $value->standard_sla){
$data['exceed']++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment