getTechnician ()->getStartTime ();
$previousOrder = null;
while ( $start < $schedule->getTechnician ()->getEndTime () ) {
$order = $schedule->getWorkorderAtTime ( $start );
//convert to standard hours 8:00am, 3:30pm etc
$h = substr ( $start, 0, 2 );
$hh = substr ( $start, 0, 1 );
$m = substr ( $start, 2, 2 );
if ($hh == '0') {
$hour = substr ( $start, 1, 1 );
}
if ($hh != '0' && $h < 13) {
$hour = $h;
}
if ($h > 12) {
$hour = $h - 12;
}
$time = $hour . ':' . $m;
if($order!=null){
}
if ($order == null) {
// no job is schedule for this hour
//display empty hour
?>
' . $time . '';
$cssClazz = 'scheduled';
if (($previousOrder != null && $previousOrder->getId () != $order->getId ()) || $previousOrder == null) {
//print_r(get_class($order));
$job_start = $order->getJobStart ();
$job_end = $order->getJobEnd ();
if($order->getJobStatusId() == 7)
$newBg = "Style = 'background-color: red'";
elseif($order->getExactTime())
$newBg = "Style = 'background-color: #0099FF'";
else
$newBg = "";
//just in case this client was deleted from the DB we create an empty client to avoid an error
if($order->getClient())
$c_address = $order->getClient ()->getAddress () . ' ' . $order->getClient ()->getCity () . ' ' . $order->getClient ()->getState (). ' '.$order->getClient ()->getZip ()."
";
if(!$order->getClient())
$content = "
THE CLIENT THIS JOB WAS SCHEDULED FOR NO LONGER EXIST
";
else
$content .= '
'. $order->convertTime($job_start) .'-'.$order->convertTime($job_end).' '. $order->getClient ()->getClientName () . ' (' . $order->getClient ()->getClientIdentification () . ') ' . $order->getClient ()->getCity () . ', ' . $order->getClient ()->getState () . '
Assigned By: '.$order->getAssignerName(). $c_address.' | ';
}
if ($previousOrder != null && $previousOrder->getId () != $order->getId ()) {
$cssClazz = $cssClazz . ' scheduled-new';
} else {
$cssClazz = $cssClazz . ' scheduled-existing';
if ($previousOrder != null) {
$content .= '
| ';
}
}
$previousOrder = $order;
$callback = '';
if (isset ( $workorderCallbackFunction ))
$callback = $workorderCallbackFunction . '(' . $order->getId () . ')'?>