summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/event/add.phtml
blob: 43fd4c2d1e360a5f7f5198a9a2f94504e8aac0df (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<h1>Add Event</h1>
<script type="text/javascript">
<?php
$this->addForm->setAction($this->url());
$this->bootoslist = $this->addForm->getBootoslist();
$this->configlist = $this->addForm->getConfiglist();
if(isset($this->bootoslist)) {
	foreach($this->bootoslist as $bootos) {
		if(array_key_exists($bootos->getID(), $this->configlist)) {
			$bootosIDs[] = $bootos->getID();
		}
	}
}
$bootosIDs = implode(", ", $bootosIDs);
echo "\tvar bootosIDs = new Array(" . $bootosIDs . ");\n";
?>
</script>
<?php
echo $this->addForm . "\n";
?>
<script type="text/javascript">
<?php
if(isset($this->params['add'])) {
	echo "\taddeventcategoryfieldChanged('category', bootosIDs, '" . $this->params['add'] . "');\n";
	echo "\timmediateChanged('immediate', bootosIDs, '" . $this->params['add'] . "');\n";
} else {
	echo "\taddeventcategoryfieldChanged('category', bootosIDs);\n";
	echo "\timmediateChanged('immediate', bootosIDs);\n";
}
?>
	$(function() {
		$("#start").datetimepicker({
			onSelect: function (selectedDateTime){
		    var start = $(this).datetimepicker('getDate');
		    var end = $('#end').datetimepicker("getDate");
		    $('#end').datetimepicker('option', 'minDate', new Date(start.getTime()));
		    $('#end').datetimepicker('setDate', end);
		  },
			dateFormat: "mm/dd/yy",
			timeFormat: "hh:mm tt",
			ampm: true
		});
		$("#end").datetimepicker({
			 onSelect: function (selectedDateTime){
		    var end = $(this).datetimepicker('getDate');
		    var start = $('#start').datetimepicker('getDate');
		    $('#start').datetimepicker('option', 'maxDate', new Date(end.getTime()) );
		    $('#start').datetimepicker('setDate', start);
		  },
			dateFormat: "mm/dd/yy",
			timeFormat: "hh:mm tt",
			ampm: true
		});
		$("#repeatdate").datetimepicker({
			dateFormat: "mm/dd/yy",
			timeFormat: "hh:mm tt",
			ampm: true
		});
	});
</script>