summaryrefslogblamecommitdiffstats
path: root/application/views/scripts/event/checkoverlapdrop.phtml
blob: e1150d1957412f13f38a8069e35c49303590f741 (plain) (tree)
1
2
3
4
5
6
7
8
9
     






                                                        
 







                                                                                                                                                                                       
         
                                               
 


                                                   
         







                                                                                                                                                                                               
                 
                                                 
         
 


                                                      
         
 
                          
 
<?php
if($this->past) {
	$output['past'] = 1;
	$output['withoutrepeat'] = -1;
	$output['withrepeat'] = -1;
} else {
	$output['past'] = 0;
	$output['cfevents'] = $this->cfeventswithrepeat;

	// conflict free plot with repeat
	$output['cfplotwithrepeat'] = '<ul id="cfplot">';
	foreach($this->cfeventswithrepeat as $c){
		if(isset($c['end'])) {
			$output['cfplotwithrepeat'] .=  '<li>' . 'EventID: ' . $c['eventID'] . ', Title: ' . $c['title'] . ', Start: ' . $c['start'] . ', End: ' . $c['end'] . '</li>';
		} else {
			$output['cfplotwithrepeat'] .=  '<li>' . 'EventID: ' . $c['eventID'] . ', Title: ' . $c['title'] . ', Start: ' . $c['start'] . '</li>';
		}
	}
	$output['cfplotwithrepeat'] .= '</ul>';

	// conflict plot with repeat
	if(count($this->overlapswithrepeat) == 0) {
		$output['withrepeat'] = -1;
	}
	else {
		$output['withrepeat'] = '<ul id="conflictEvents">';
		foreach($this->overlapswithrepeat as $o){
			if(isset($o['end'])) {
				$output['withrepeat'] .=	'<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . ', End: ' . $o['end'] . '</li>';
			} else {
				$output['withrepeat'] .=  '<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . '</li>';
			}
		}
		$output['withrepeat'] .= '</ul>';
	}

	// conflict plot without repeat
	if(count($this->overlapswithoutrepeat) == 0) {
		$output['withoutrepeat'] = -1;
	}
}
echo json_encode($output);
?>