abs($estimated) ) { //this event is before the start of the task, so will never occurs $xTimer = 30; $sWhen = abs($when) - abs($estimated); imagestring ($im, 2, $xTimer -8 , $h -16, $sWhen, $black); $s = 'i'; } if ( abs($when) < abs($estimated) ) { //this event is after the start of the task, drawing $xTimer = 170; $sWhen = $estimated + $when; imagestring ($im, 2, $xTimer -4 , $h -16, $sWhen, $black); } if ( abs($when) == abs($estimated) ) { //this event is exactly at starting $xTimer = 80; $sWhen = $estimated + $when; imagestring ($im, 2, $xTimer -4 , $h -16, $sWhen, $black); } } //when is positive and the event occurs after, then this event will occurs if ( $when > 0 && $o == 'a' ) { $xTimer = 270; $sWhen = $estimated + $when; imagestring ($im, 2, $xTimer -4 , $h -16, $sWhen, $black); } //when is positive and the event occurs starting, then this event will occurs if ( $when > 0 && $o == 's' ) { if ( abs($when) < abs($estimated) ) $xTimer = 140; if ( abs($when) > abs($estimated) ) $xTimer = 270; if ( abs($when) == abs($estimated) ) $xTimer = 220; imagestring ($im, 2, $xTimer -4 , $h -16, $when, $black); } if ( $when == 0 ) { $xTimer = ( $o == 's' ) ? 80: 220 ; } if ( $s == 'a' ) { drawTimerEvent ( $im, $xTimer, $h -70 , $h -15); } header("Content-Type: image/png"); imagepng($im); die;