Project

General

Profile

Download (39.5 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
	firewall_schedule_edit.php
4
	Copyright (C) 2004 Scott Ullrich
5
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
6
	All rights reserved.
7

    
8
	originally part of m0n0wall (http://m0n0.ch/wall)
9
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
	All rights reserved.
11

    
12
	Redistribution and use in source and binary forms, with or without
13
	modification, are permitted provided that the following conditions are met:
14

    
15
	1. Redistributions of source code must retain the above copyright notice,
16
	   this list of conditions and the following disclaimer.
17

    
18
	2. Redistributions in binary form must reproduce the above copyright
19
	   notice, this list of conditions and the following disclaimer in the
20
	   documentation and/or other materials provided with the distribution.
21

    
22
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
	POSSIBILITY OF SUCH DAMAGE.
32
*/
33
/*
34
	pfSense_MODULE:	schedules
35
*/
36

    
37
##|+PRIV
38
##|*IDENT=page-firewall-schedules-edit
39
##|*NAME=Firewall: Schedules: Edit page
40
##|*DESCR=Allow access to the 'Firewall: Schedules: Edit' page.
41
##|*MATCH=firewall_schedule_edit.php*
42
##|-PRIV
43

    
44
function schedulecmp($a, $b) {
45
	return strcmp($a['name'], $b['name']);
46
}
47

    
48
function schedule_sort(){
49
        global $g, $config;
50

    
51
        if (!is_array($config['schedules']['schedule']))
52
                return;
53

    
54
        usort($config['schedules']['schedule'], "schedulecmp");
55
}
56

    
57
require("guiconfig.inc");
58
require_once("functions.inc");
59
require_once("filter.inc");
60
require_once("shaper.inc");
61

    
62
$pgtitle = array(gettext("Firewall"),gettext("Schedules"),gettext("Edit"));
63

    
64
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_schedule.php');
65

    
66
$dayArray = array (gettext('Mon'),gettext('Tues'),gettext('Wed'),gettext('Thur'),gettext('Fri'),gettext('Sat'),gettext('Sun'));
67
$monthArray = array (gettext('January'),gettext('February'),gettext('March'),gettext('April'),gettext('May'),gettext('June'),gettext('July'),gettext('August'),gettext('September'),gettext('October'),gettext('November'),gettext('December'));
68

    
69
if (!is_array($config['schedules']['schedule']))
70
	$config['schedules']['schedule'] = array();
71

    
72
$a_schedules = &$config['schedules']['schedule'];
73

    
74
if (is_numericint($_GET['id']))
75
	$id = $_GET['id'];
76
if (isset($_POST['id']) && is_numericint($_POST['id']))
77
	$id = $_POST['id'];
78

    
79
if (isset($id) && $a_schedules[$id]) {
80
	$pconfig['name'] = $a_schedules[$id]['name'];
81
	$pconfig['descr'] = html_entity_decode($a_schedules[$id]['descr']);
82
	$pconfig['timerange'] = $a_schedules[$id]['timerange'];
83
	$pconfig['schedlabel'] = $a_schedules[$id]['schedlabel'];
84
	$getSchedule = true;
85
}
86

    
87
if ($_POST) {
88
	
89
	if(strtolower($_POST['name']) == "lan")
90
		$input_errors[] = gettext("Schedule may not be named LAN.");
91
	if(strtolower($_POST['name']) == "wan")
92
		$input_errors[] = gettext("Schedule may not be named WAN.");
93
	if(strtolower($_POST['name']) == "")
94
		$input_errors[] = gettext("Schedule name cannot be blank.");
95

    
96
	$x = is_validaliasname($_POST['name']);
97
	if (!isset($x)) {
98
		$input_errors[] = gettext("Reserved word used for schedule name.");
99
	} else {
100
		if (is_validaliasname($_POST['name']) == false)
101
			$input_errors[] = gettext("The schedule name may only consist of the characters a-z, A-Z, 0-9");
102
	}
103
	
104
	/* check for name conflicts */
105
	foreach ($a_schedules as $schedule) {
106
		if (isset($id) && ($a_schedules[$id]) && ($a_schedules[$id] === $schedule))
107
			continue;
108

    
109
		if ($schedule['name'] == $_POST['name']) {
110
			$input_errors[] = gettext("A Schedule with this name already exists.");
111
			break;
112
		}
113
	}
114
	$schedule = array();
115
	
116
	$schedule['name'] = $_POST['name'];
117
	$schedule['descr'] = htmlentities($_POST['descr'], ENT_QUOTES, 'UTF-8');	
118
	
119
	$timerangeFound = false;
120
	for ($x=0; $x<99; $x++){
121
		if($_POST['schedule' . $x]) {
122
			if (!preg_match('/^[0-9]+:[0-9]+$/', $_POST['starttime' . $x])) {
123
				$input_errors[] = sprintf(gettext("Invalid start time - '%s'"), $_POST['starttime' . $x]);
124
				continue;
125
			}
126
			if (!preg_match('/^[0-9]+:[0-9]+$/', $_POST['stoptime' . $x])) {
127
				$input_errors[] = sprintf(gettext("Invalid stop time - '%s'"), $_POST['stoptime' . $x]);
128
				continue;
129
			}
130
			$timerangeFound = true;
131
			$timeparts = array();
132
			$firstprint = false;
133
			$timestr = $_POST['schedule' . $x];
134
			$timehourstr = $_POST['starttime' . $x];
135
			$timehourstr .= "-";
136
			$timehourstr .= $_POST['stoptime' . $x];
137
			$timedescrstr = htmlentities($_POST['timedescr' . $x], ENT_QUOTES, 'UTF-8'); 
138
			$dashpos = strpos($timestr, '-');
139
			if ($dashpos === false)
140
			{
141
				$timeparts['position'] = $timestr;
142
			}
143
			else
144
			{
145
				$tempindarray = array();
146
				$monthstr = "";
147
				$daystr = "";
148
				$tempindarray = explode(",", $timestr);
149
				foreach ($tempindarray as $currentselection)
150
				{
151
					if ($currentselection){
152
						if ($firstprint)
153
						{
154
							$monthstr .= ",";
155
							$daystr .= ",";						
156
						}
157
						$tempstr = "";
158
						$monthpos = strpos($currentselection, "m");
159
						$daypos = strpos($currentselection, "d");
160
						$monthstr .= substr($currentselection, $monthpos+1, $daypos-$monthpos-1);
161
						$daystr .=  substr($currentselection, $daypos+1);			
162
						$firstprint = true;
163
					}
164
				}
165
				$timeparts['month'] = $monthstr;
166
				$timeparts['day'] = $daystr;
167
			}			
168
			$timeparts['hour'] = $timehourstr;
169
			$timeparts['rangedescr'] = $timedescrstr;
170
			$schedule['timerange'][$x] = $timeparts;
171
		}
172
	}
173
	
174
	if (!$timerangeFound)
175
		$input_errors[] = gettext("The schedule must have at least one time range configured.");
176
		
177
	if (!$input_errors) {		
178
		
179
		if (!empty($pconfig['schedlabel']))
180
			$schedule['schedlabel'] = $pconfig['schedlabel'];
181
		else
182
			$schedule['schedlabel'] = uniqid();
183

    
184
		if (isset($id) && $a_schedules[$id]){
185
			$a_schedules[$id] = $schedule;
186
		}
187
		else{
188
			$a_schedules[] = $schedule;
189
		}
190
		schedule_sort();
191
		if (write_config())
192
			filter_configure();
193

    
194
		header("Location: firewall_schedule.php");
195
		exit;
196
		
197
	}
198
	//we received input errors, copy data to prevent retype
199
	else
200
	{
201
		if (!$_POST['schedule0'])
202
			$getSchedule = false;
203
		else
204
			$getSchedule = true;
205
		$pconfig['name'] = $schedule['name'];
206
		$pconfig['descr'] = $schedule['descr'];
207
		$pconfig['timerange'] = $schedule['timerange'];
208
	}	
209

    
210
}
211
include("head.inc");
212

    
213
/* put your custom HTML head content here        */
214
/* using some of the $pfSenseHead function calls */
215
$jscriptstr = <<<EOD
216
<script type="text/javascript">
217
//<![CDATA[
218
var daysSelected = "";
219
var month_array = ['January','February','March','April','May','June','July','August','September','October','November','December'];
220
var day_array = ['Mon','Tues','Wed','Thur','Fri','Sat','Sun'];
221
var schCounter = 0;
222

    
223
function rgb2hex(rgb) {
224
	var parts = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
225
	if (parts == null)
226
		return;
227
	function hex(x) {
228
		return ("0" + parseInt(x).toString(16)).slice(-2);
229
	}
230
	return ("#" + hex(parts[1]) + hex(parts[2]) + hex(parts[3])).toUpperCase();
231
}
232

    
233
function repeatExistingDays(){
234
	var tempstr, tempstrdaypos, week, daypos, dayposdone = "";
235
	
236
	var dayarray = daysSelected.split(",");
237
	for (i=0; i<=dayarray.length; i++){
238
		tempstr = dayarray[i];
239
		tempstrdaypos = tempstr.search("p");
240
		week = tempstr.substring(1,tempstrdaypos);
241
		week = parseInt(week);
242
		dashpos = tempstr.search("-");		
243
		daypos = tempstr.substring(tempstrdaypos+1, dashpos);
244
		daypos = parseInt(daypos);
245
		
246
		daydone = dayposdone.search(daypos);
247
		tempstr = 'w' + week + 'p' + daypos;
248
		daycell = eval('document.getElementById(tempstr)');
249
		if (daydone == "-1"){
250
			if (rgb2hex(daycell.style.backgroundColor) == "#F08080")  // lightcoral
251
				daytogglerepeating(week,daypos,true);
252
			else
253
				daytogglerepeating(week,daypos,false);
254
			dayposdone += daypos + ",";
255
		}
256
	}	
257
}
258

    
259
function daytogglerepeating(week,daypos,bExists){
260
	var tempstr, daycell, dayoriginal = "";
261
	for (j=1; j<=53; j++)
262
	{						
263
		tempstr = 'w' + j + 'p' + daypos;
264
		daycell = eval('document.getElementById(tempstr)');
265
		dayoriginalpos =  daysSelected.indexOf(tempstr);
266
		
267
		//if bExists set to true, means cell is already select it
268
		//unselect it and remove original day from daysSelected string		
269
	
270
		if (daycell != null)
271
		{
272
			if (bExists){	
273
				daycell.style.backgroundColor = "#FFFFFF";  // white
274
			}
275
			else
276
			{
277
				daycell.style.backgroundColor = "#F08080";  // lightcoral		
278
			}	
279
	
280
			if (dayoriginalpos != "-1")
281
			{						
282
				dayoriginalend = daysSelected.indexOf(',', dayoriginalpos);
283
				tempstr = daysSelected.substring(dayoriginalpos, dayoriginalend+1);
284
				daysSelected = daysSelected.replace(tempstr, "");
285
				
286
			}				
287
		}			
288
	}	
289
}
290

    
291
function daytoggle(id) {
292
	var runrepeat, tempstr = "";
293
	var bFoundValid = false;
294
	
295
	iddashpos = id.search("-");
296
	var tempstrdaypos = id.search("p");
297
	var week = id.substring(1,tempstrdaypos);
298
	week = parseInt(week);
299
	
300
	if (iddashpos == "-1")
301
	{
302
		idmod = id;
303
		runrepeat = true;
304
		var daypos = id.substr(tempstrdaypos+1);	
305
	}
306
	else
307
	{		
308
		idmod = id.substring(0,iddashpos);
309
		var daypos = id.substring(tempstrdaypos+1,iddashpos);
310
	}
311
	
312
	daypos = parseInt(daypos);
313
	
314
	while (!bFoundValid){
315
		var daycell = document.getElementById(idmod);		
316
	
317
		if (daycell != null){
318
			if (rgb2hex(daycell.style.backgroundColor) == "#FF0000"){  // red
319
				daycell.style.backgroundColor = "#FFFFFF";  // white
320
				str = id + ",";
321
				daysSelected = daysSelected.replace(str, "");
322
			}
323
			else if (rgb2hex(daycell.style.backgroundColor) == "#F08080")  // lightcoral
324
			{
325
				daytogglerepeating(week,daypos,true);
326
			}
327
			else //color is white cell
328
			{
329
				if (!runrepeat)
330
				{
331
					daycell.style.backgroundColor = "#FF0000";  // red
332
				}
333
				else
334
				{
335
					daycell.style.backgroundColor = "#F08080";  // lightcoral
336
					daytogglerepeating(week,daypos,false);								
337
				}
338
				daysSelected += id + ",";
339
			}
340
			bFoundValid = true;
341
		}
342
		else
343
		{
344
			//we found an invalid cell when column was clicked, move up to the next week
345
			week++;
346
			tempstr = "w" + week + "p" + daypos;
347
			idmod = tempstr;			
348
		}
349
	}
350
}
351

    
352
function update_month(){
353
	var indexNum = document.forms[0].monthsel.selectedIndex;
354
	var selected = document.forms[0].monthsel.options[indexNum].text;
355

    
356
	for (i=0; i<=11; i++){
357
		option = document.forms[0].monthsel.options[i].text;
358
		document.popupMonthLayer = eval('document.getElementById (option)');
359
		
360
		if(selected == option) {
361
			document.popupMonthLayer.style.display="block";
362
		}
363
		else
364
			document.popupMonthLayer.style.display="none";
365
	}
366
}
367

    
368
function checkForRanges(){
369
	if (daysSelected != "")
370
	{
371
		alert("You have not saved the specified time range. Please click 'Add Time' button to save the time range.");
372
		return false;
373
	}
374
	else
375
	{
376
		return true;
377
	}
378
}
379

    
380
function processEntries(){
381
	var tempstr, starttimehour, starttimemin, stoptimehour, stoptimemin, errors = "";
382
	var passedValidiation = true;
383
	
384
	//get time specified
385
	starttimehour = parseInt(document.getElementById("starttimehour").value);
386
	starttimemin = parseInt(document.getElementById("starttimemin").value);
387
	stoptimehour = parseInt(document.getElementById("stoptimehour").value);
388
	stoptimemin = parseInt(document.getElementById("stoptimemin").value);
389

    
390

    
391
	//do time checks	
392
	if (starttimehour > stoptimehour)
393
	{
394
		errors = "Error: Start Hour cannot be greater than Stop Hour.";
395
		passedValidiation = false;
396
		
397
	}
398
	else if (starttimehour == stoptimehour)
399
	{
400
		if (starttimemin > stoptimemin){
401
			errors = "Error: Start Minute cannot be greater than Stop Minute.";
402
			passedValidiation = false;
403
		}
404
	}	
405
		
406
	if (passedValidiation){
407
		addTimeRange();
408
	}
409
	else {
410
		if (errors != "")
411
			alert(errors);
412
	}
413
}
414

    
415
function addTimeRange(){
416
	var tempdayarray = daysSelected.split(",");
417
	var tempstr, tempFriendlyDay, starttimehour, starttimemin, stoptimehour, nrtempFriendlyTime, rtempFriendlyTime, nrtempID, rtempID = "";
418
	var stoptimemin, timeRange, tempstrdaypos, week, daypos, day, month, dashpos, nrtempTime, rtempTime, monthstr, daystr = "";
419
	rtempFriendlyTime = "";
420
	nrtempFriendlyTime = "";
421
	nrtempID = "";
422
	rtempID = "";
423
	nrtempTime = "";
424
	rtempTime = "";
425
	tempdayarray.sort();	
426
	rtempFriendlyDay = "";
427
	monthstr = "";
428
	daystr = "";
429
	
430
	//check for existing entries
431
	var findCurrentCounter;
432
	for (u=0; u<99; u++){
433
		findCurrentCounter = document.getElementById("schedule" + u);
434
		if (!findCurrentCounter)
435
		{
436
			schCounter = u;
437
			break;
438
		}
439
	}
440
		
441
	if (daysSelected != ""){
442
		//get days selected
443
		for (i=0; i<tempdayarray.length; i++)
444
		{
445
			tempstr = tempdayarray[i];
446
			if (tempstr != "")
447
			{			
448
				tempstrdaypos = tempstr.search("p");
449
				week = tempstr.substring(1,tempstrdaypos);
450
				week = parseInt(week);
451
				dashpos = tempstr.search("-");			
452
				
453
				if (dashpos != "-1")
454
				{	
455
					var nonrepeatingfound = true;
456
					daypos = tempstr.substring(tempstrdaypos+1, dashpos);
457
					daypos = parseInt(daypos);	
458
					monthpos = tempstr.search("m");	
459
					tempstrdaypos = tempstr.search("d");
460
					month = tempstr.substring(monthpos+1, tempstrdaypos);
461
					month = parseInt(month);
462
					day = tempstr.substring(tempstrdaypos+1);
463
					day = parseInt(day);
464
					monthstr += month + ",";
465
					daystr += day + ",";
466
					nrtempID += tempstr + ",";
467
				}
468
				else
469
				{	
470
					var repeatingfound = true;
471
					daypos = tempstr.substr(tempstrdaypos+1);
472
					daypos = parseInt(daypos);	
473
					rtempFriendlyDay += daypos + ",";
474
					rtempID += daypos + ",";					
475
				}		
476
			}				
477
		}	
478
		
479
		//code below spits out friendly look format for nonrepeating schedules
480
		var foundEnd = false;
481
		var firstDayFound = false;
482
		var firstprint = false;
483
		var tempFriendlyMonthArray = monthstr.split(",");
484
		var tempFriendlyDayArray = daystr.split(",");
485
		var currentDay, firstDay, nextDay, currentMonth, nextMonth, firstDay, firstMonth = "";
486
		for (k=0; k<tempFriendlyMonthArray.length; k++){
487
			tempstr = tempFriendlyMonthArray[k];
488
			if (tempstr != ""){
489
				if (!firstDayFound)
490
				{
491
					firstDay = tempFriendlyDayArray[k];
492
					firstDay = parseInt(firstDay);
493
					firstMonth = tempFriendlyMonthArray[k];
494
					firstMonth = parseInt(firstMonth);
495
					firstDayFound = true;
496
				}
497
				currentDay = tempFriendlyDayArray[k];
498
				currentDay = parseInt(currentDay);
499
				//get next day
500
				nextDay = tempFriendlyDayArray[k+1];
501
				nextDay = parseInt(nextDay);
502
				//get next month
503
				
504
				currentDay++;						
505
				if ((currentDay != nextDay) || (tempFriendlyMonthArray[k] != tempFriendlyMonthArray[k+1])){
506
					if (firstprint)
507
						nrtempFriendlyTime += ", ";
508
					currentDay--;
509
					if (currentDay != firstDay)
510
						nrtempFriendlyTime += month_array[firstMonth-1] + " " + firstDay + "-" + currentDay;
511
					else
512
						nrtempFriendlyTime += month_array[firstMonth-1] + " " + currentDay; 
513
					firstDayFound = false;	
514
					firstprint = true;			
515
				}
516
			}			
517
		}		
518
		
519
		//code below spits out friendly look format for repeating schedules
520
		foundEnd = false;
521
		firstDayFound = false;
522
		firstprint = false;
523
		tempFriendlyDayArray = rtempFriendlyDay.split(",");
524
		tempFriendlyDayArray.sort();
525
		currentDay, firstDay, nextDay = "";
526
		for (k=0; k<tempFriendlyDayArray.length; k++){
527
			tempstr = tempFriendlyDayArray[k];
528
			if (tempstr != ""){
529
				if (!firstDayFound)
530
				{
531
					firstDay = tempFriendlyDayArray[k];
532
					firstDay = parseInt(firstDay);
533
					firstDayFound = true;
534
				}
535
				currentDay = tempFriendlyDayArray[k];
536
				currentDay = parseInt(currentDay);
537
				//get next day
538
				nextDay = tempFriendlyDayArray[k+1];
539
				nextDay = parseInt(nextDay);
540
				currentDay++;					
541
				if (currentDay != nextDay){
542
					if (firstprint)
543
						rtempFriendlyTime += ", ";
544
					currentDay--;
545
					if (currentDay != firstDay)
546
						rtempFriendlyTime += day_array[firstDay-1] + " - " + day_array[currentDay-1];
547
					else
548
						rtempFriendlyTime += day_array[firstDay-1];
549
					firstDayFound = false;	
550
					firstprint = true;			
551
				}
552
			}
553
		}			
554
		
555
		//sort the tempID
556
		var tempsortArray = rtempID.split(",");
557
		var isFirstdone = false;
558
		tempsortArray.sort();
559
		//clear tempID
560
		rtempID = "";
561
		for (t=0; t<tempsortArray.length; t++)
562
		{
563
			if (tempsortArray[t] != ""){
564
				if (!isFirstdone){
565
					rtempID += tempsortArray[t];
566
					isFirstdone = true;
567
				}
568
				else
569
					rtempID += "," + tempsortArray[t];
570
			}
571
		} 
572
		
573
		 
574
		//get time specified
575
		starttimehour =  document.getElementById("starttimehour").value
576
		starttimemin = document.getElementById("starttimemin").value;
577
		stoptimehour = document.getElementById("stoptimehour").value;
578
		stoptimemin = document.getElementById("stoptimemin").value;
579
		
580
		timeRange = "||" + starttimehour + ":";
581
		timeRange += starttimemin + "-";
582
		timeRange += stoptimehour + ":";	
583
		timeRange += stoptimemin;		
584
				
585
		//get description for time range
586
		var tempdescr = document.getElementById("timerangedescr").value		
587
		
588
		if (nonrepeatingfound){
589
			nrtempTime += nrtempID;
590
			//add time ranges
591
			nrtempTime += timeRange;			
592
			//add description
593
			nrtempTime += "||" + tempdescr;
594
			insertElements(nrtempFriendlyTime, starttimehour, starttimemin, stoptimehour, stoptimemin, tempdescr, nrtempTime, nrtempID);
595
		}
596
		
597
		if (repeatingfound){
598
			rtempTime += rtempID;
599
			//add time ranges
600
			rtempTime += timeRange;
601
			//add description
602
			rtempTime += "||" + tempdescr;
603
			insertElements(rtempFriendlyTime, starttimehour, starttimemin, stoptimehour, stoptimemin, tempdescr, rtempTime, rtempID);
604
		}
605
		
606
	}
607
	else
608
	{
609
		//no days were selected, alert user
610
		alert ("You must select at least 1 day before adding time");
611
	}
612
}
613

    
614
function insertElements(tempFriendlyTime, starttimehour, starttimemin, stoptimehour, stoptimemin, tempdescr, tempTime, tempID){
615
	
616
		//add it to the schedule list
617
		d = document;
618
		tbody = d.getElementById("scheduletable").getElementsByTagName("tbody").item(0);
619
		tr = d.createElement("tr");
620
		td = d.createElement("td");
621
		td.innerHTML= "<span class='vexpl'>" + tempFriendlyTime + "<\/span>";
622
		tr.appendChild(td);	
623
			
624
		td = d.createElement("td");
625
		td.innerHTML="<input type='text' readonly class='vexpl' name='starttime" + schCounter + "' id='starttime" + schCounter + "' style=' word-wrap:break-word; width:100%; border:0px solid;' value='" + starttimehour + ":" + starttimemin + "' />";
626
		tr.appendChild(td);
627
		
628
		td = d.createElement("td");
629
		td.innerHTML="<input type='text' readonly class='vexpl' name='stoptime" + schCounter + "' id='stoptime" + schCounter + "' style=' word-wrap:break-word; width:100%; border:0px solid;' value='" + stoptimehour + ":" + stoptimemin + "' />";
630
		tr.appendChild(td);
631
		
632
		td = d.createElement("td");
633
		td.innerHTML="<input type='text' readonly class='vexpl' name='timedescr" + schCounter + "' id='timedescr" + schCounter + "' style=' word-wrap:break-word; width:100%; border:0px solid;' value='" + tempdescr + "' />";
634
		tr.appendChild(td);
635
		
636
		td = d.createElement("td");
637
		td.innerHTML = "<a onclick='editRow(\"" + tempTime + "\",this); return false;' href='#'><img border='0' src='/themes/" + theme + "/images/icons/icon_e.gif' alt='edit' /></\a>";
638
		tr.appendChild(td);
639
			
640
		td = d.createElement("td");
641
		td.innerHTML = "<a onclick='removeRow(this); return false;' href='#'><img border='0' src='/themes/" + theme + "/images/icons/icon_x.gif' alt='remove' /></\a>";
642
		tr.appendChild(td);
643
		
644
		td = d.createElement("td");		
645
		td.innerHTML="<input type='hidden' id='schedule" + schCounter + "' name='schedule" + schCounter + "' value='" + tempID + "' />";		
646
		tr.appendChild(td);
647
		tbody.appendChild(tr);
648
		
649
		schCounter++;
650
		
651
		//reset calendar and time and descr
652
		clearCalendar();
653
		clearTime();
654
		clearDescr();
655
}
656

    
657

    
658
function clearCalendar(){
659
	var tempstr, daycell = "";
660
	//clear days selected
661
	daysSelected = "";
662
	//loop through all 52 weeks
663
	for (j=1; j<=53; j++)
664
	{
665
		//loop through all 7 days
666
		for (k=1; k<8; k++){
667
			tempstr = 'w' + j + 'p' + k;
668
			daycell = eval('document.getElementById(tempstr)');
669
			if (daycell != null){
670
				daycell.style.backgroundColor = "#FFFFFF";  // white	
671
			}	
672
		}
673
	}	
674
}
675

    
676
function clearTime(){
677
	document.getElementById("starttimehour").value = "0";
678
	document.getElementById("starttimemin").value = "00";
679
	document.getElementById("stoptimehour").value = "23";
680
	document.getElementById("stoptimemin").value = "59";
681
}
682

    
683
function clearDescr(){
684
	document.getElementById("timerangedescr").value = "";
685
}
686

    
687
function editRow(incTime, el) {
688
	var check = checkForRanges();
689
	
690
	if (check){  
691
		
692
		//reset calendar and time
693
		clearCalendar();
694
		clearTime();
695
		
696
		var starttimehour, descr, days, tempstr, starttimemin, hours, stoptimehour, stoptimemin = ""; 
697
		
698
		tempArray = incTime.split ("||");
699
		
700
		days = tempArray[0];
701
		hours = tempArray[1];
702
		descr = tempArray[2];
703
		
704
		var tempdayArray = days.split(",");
705
		var temphourArray = hours.split("-");
706
		tempstr = temphourArray[0];
707
		var temphourArray2 = tempstr.split(":");
708
	
709
		document.getElementById("starttimehour").value = temphourArray2[0];
710
		document.getElementById("starttimemin").value = temphourArray2[1];	
711
		
712
		tempstr = temphourArray[1];
713
		temphourArray2 = tempstr.split(":");
714
		
715
		document.getElementById("stoptimehour").value = temphourArray2[0];
716
		document.getElementById("stoptimemin").value = temphourArray2[1];
717
		
718
		document.getElementById("timerangedescr").value = descr;
719
	
720
		//toggle the appropriate days
721
		for (i=0; i<tempdayArray.length; i++)
722
		{
723
			if (tempdayArray[i]){
724
				var tempweekstr = tempdayArray[i];
725
				dashpos = tempweekstr.search("-");			
726
						
727
				if (dashpos == "-1")
728
				{
729
					tempstr = "w2p" + tempdayArray[i];
730
				}
731
				else
732
				{
733
					tempstr = tempdayArray[i];
734
				}
735
				daytoggle(tempstr);
736
			}
737
		}
738
		removeRownoprompt(el);
739
	}
740
}
741

    
742
function removeRownoprompt(el) {
743
    var cel;
744
    while (el && el.nodeName.toLowerCase() != "tr")
745
	    el = el.parentNode;
746

    
747
    if (el && el.parentNode) {
748
	cel = el.getElementsByTagName("td").item(0);
749
	el.parentNode.removeChild(el);
750
    }
751
}
752

    
753

    
754
function removeRow(el) {
755
	var check = confirm ("Do you really want to delete this time range?");
756
	if (check){
757
	    var cel;
758
	    while (el && el.nodeName.toLowerCase() != "tr")
759
		    el = el.parentNode;
760
	
761
	    if (el && el.parentNode) {
762
		cel = el.getElementsByTagName("td").item(0);
763
		el.parentNode.removeChild(el);
764
	    }
765
	}
766
}
767
//]]>
768
</script>
769
EOD;
770
?>
771

    
772
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
773

    
774

    
775
<?php include("fbegin.inc");	echo $jscriptstr; ?>
776
<?php if ($input_errors) print_input_errors($input_errors); ?>
777
<div id="inputerrors"></div>
778

    
779
<form action="firewall_schedule_edit.php" method="post" name="iform" id="iform">
780
	<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="firewall schedule">
781
		<tr>
782
			<td colspan="2" valign="top" class="listtopic"><?=gettext("Schedule information");?></td>
783
		</tr>	
784
        <tr>
785
          <td>
786
			  <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
787
               	<tr>
788
				  <td width="15%" valign="top" class="vncellreq"><?=gettext("Schedule Name");?></td>
789
				  <td width="85%" class="vtable">
790
				  <?php if(is_schedule_inuse($pconfig['name']) == true): ?>
791
				  			<input name="name" type="hidden" id="name" size="40"  value="<?=htmlspecialchars($pconfig['name']);?>" />
792
						  <?php echo $pconfig['name']; ?>
793
						      <p>
794
						        <span class="vexpl"><?=gettext("NOTE: This schedule is in use so the name may not be modified!");?></span>
795
						      </p>
796
				<?php else: ?>
797
				  <input name="name" type="text" id="name" size="40" maxlength="40" class="formfld unknown" value="<?=htmlspecialchars($pconfig['name']);?>" /><br />
798
				      	<span class="vexpl">
799
     					   <?=gettext("The name of the alias may only consist of the characters a-z, A-Z and 0-9");?>
800
      					</span>
801
      			<?php endif; ?>   					
802
				  </td>
803
				</tr>
804
				<tr>
805
					<td width="15%" valign="top" class="vncell"><?=gettext("Description");?></td>
806
					<td width="85%" class="vtable"><input name="descr" type="text" id="descr" size="40" maxlength="40" class="formfld unknown" value="<?=htmlspecialchars($pconfig['descr']);?>" /><br />
807
 						<span class="vexpl">
808
				        	<?=gettext("You may enter a description here for your reference (not parsed).");?>
809
				      	</span>
810
				  
811
					</td>
812
				</tr>
813
				<!-- tr>
814
				</tr -->
815
			    <tr>
816
				  <td width="15%" valign="top" class="vncellreq"><?=gettext("Month");?></td>
817
				  <td width="85%" class="vtable">
818
                    <select name="monthsel" class="formselect" id="monthsel" onchange="update_month();">
819
                    	<?php 
820
                    	$monthcounter = date("n");
821
                    	$monthlimit = $monthcounter + 12;
822
                    	$yearcounter = date("Y");
823
                    	for ($k=0; $k<12; $k++){?>	             
824
                    		<option value="<?php echo $monthcounter;?>"><?php echo date("F_y", mktime(0, 0, 0, date($monthcounter), 1, date($yearcounter)));?></option>
825
                          <?php        	
826
                          if ($monthcounter == 12)
827
							{
828
								$monthcounter = 1;
829
								$yearcounter++;
830
							}
831
							else
832
							{
833
								$monthcounter++;
834
							}	
835
						} ?>      	
836
                    </select><br /><br />
837
            		<?php
838
            		$firstmonth = TRUE;
839
            		$monthcounter = date("n");
840
            		$yearcounter = date("Y");
841
            		for ($k=0; $k<12; $k++){
842
						$firstdayofmonth = date("w", mktime(0, 0, 0, date($monthcounter), 1, date($yearcounter)));
843
						if ($firstdayofmonth == 0)
844
							$firstdayofmonth = 7;
845
							
846
						$daycounter = 1;
847
						//number of day in month
848
						$numberofdays = date("t", mktime(0, 0, 0, date($monthcounter), 1, date($yearcounter)));
849
						$firstdayprinted = FALSE;
850
						$lasttr = FALSE;
851
						$positioncounter = 1;//7 for Sun, 1 for Mon, 2 for Tues, etc						
852
						?>	
853
	                        <div id="<?php echo date("F_y",mktime(0, 0, 0, date($monthcounter), 1, date($yearcounter)));?>" style=" position:relative; display:<?php if($firstmonth)echo "block";else echo "none";?>">    	
854
		                   	<table border="1" cellspacing="1" cellpadding="1" id="calTable<?=$monthcounter . $yearcounter;?>" class="tabcont" summary="month">
855
								<tr><td colspan="7" align="center" class="listbg"><b><?php echo date("F_Y", mktime(0, 0, 0, date($monthcounter), 1, date($yearcounter)));?></b></td>
856
								</tr>
857
								<tr>	
858
									<td align="center" class="listhdrr" style="cursor: pointer;" onclick="daytoggle('w1p1');"><u><b><?=gettext("Mon");?></b></u></td>
859
									<td align="center" class="listhdrr" style="cursor: pointer;" onclick="daytoggle('w1p2');"><u><b><?=gettext("Tue");?></b></u></td>
860
									<td align="center" class="listhdrr" style="cursor: pointer;" onclick="daytoggle('w1p3');"><u><b><?=gettext("Wed");?></b></u></td>
861
									<td align="center" class="listhdrr" style="cursor: pointer;" onclick="daytoggle('w1p4');"><u><b><?=gettext("Thu");?></b></u></td>
862
									<td align="center" class="listhdrr" style="cursor: pointer;" onclick="daytoggle('w1p5');"><u><b><?=gettext("Fri");?></b></u></td>
863
									<td align="center" class="listhdrr" style="cursor: pointer;" onclick="daytoggle('w1p6');"><u><b><?=gettext("Sat");?></b></u></td>
864
									<td align="center" class="listhdrr" style="cursor: pointer;" onclick="daytoggle('w1p7');"><u><b><?=gettext("Sun");?></b></u></td>
865
								</tr>
866
								<?php			
867
								$firstmonth = FALSE;				
868
								while ($daycounter<=$numberofdays){
869
									$weekcounter =  date("W", mktime(0, 0, 0, date($monthcounter), date($daycounter), date($yearcounter)));
870
									$weekcounter = ltrim($weekcounter, "0");
871
									if ($positioncounter == 1)
872
									{
873
										echo "<tr>";
874
									}											
875
									if ($firstdayofmonth == $positioncounter){?>
876
										<td align="center" style="cursor: pointer;" class="listr" id="w<?=$weekcounter;?>p<?=$positioncounter;?>" onclick="daytoggle('w<?=$weekcounter;?>p<?=$positioncounter;?>-m<?=$monthcounter;?>d<?=$daycounter;?>');">
877
										<?php echo $daycounter;
878
										$daycounter++;
879
										$firstdayprinted = TRUE;
880
										echo "</td>";
881
									}
882
									elseif ($firstdayprinted == TRUE && $daycounter <= $numberofdays){?>
883
										<td align="center" style="cursor: pointer;" class="listr" id="w<?=$weekcounter;?>p<?=$positioncounter;?>" onclick="daytoggle('w<?=$weekcounter;?>p<?=$positioncounter;?>-m<?=$monthcounter;?>d<?=$daycounter;?>');">
884
										<?php echo $daycounter;
885
										$daycounter++;
886
										echo "</td>";
887
									}
888
									else
889
									{
890
										echo "<td align=\"center\" class=\"listr\"></td>";
891
									}
892
									
893
									if ($positioncounter == 7 || $daycounter > $numberofdays){
894
										$positioncounter = 1;
895
										echo "</tr>";
896
									}
897
									else{
898
										$positioncounter++;
899
									}
900
								
901
								}//end while loop?>	
902
							</table>
903
							</div>
904
					<?php 
905
						
906
						if ($monthcounter == 12)
907
						{
908
							$monthcounter = 1;
909
							$yearcounter++;
910
						}
911
						else
912
						{
913
							$monthcounter++;
914
						}					
915
					} //end for loop
916
					?>
917
							<br />
918
					<?=gettext("Click individual date to select that date only. Click the appropriate weekday Header to select all occurrences of that weekday.");?>
919
	                 </td>
920
				</tr>
921
				<tr>
922
				  <td width="15%" valign="top" class="vncellreq"><?=gettext("Time");?></td>
923
				  <td width="85%" class="vtable">
924
				  	<table cellspacing="2" class="tabcont" summary="time">
925
				  		<tr>
926
				  			<td class="listhdrr" align="center"><?=gettext("Start Time");?></td><td></td><td class="listhdrr" align="center"><?=gettext("Stop Time");?></td>
927
				  		</tr>
928
				  		<tr>
929
				  			<td>
930
				  				<select name="starttimehour" class="formselect" id="starttimehour">
931
				  					<?php 
932
				  						for ($i=0; $i<24; $i++)
933
				  						{				  							
934
				  							echo "<option value=\"$i\">";
935
				  							echo $i;
936
				  							echo "</option>";
937
				  						}
938
				  					?>
939
				  				</select>&nbsp;<?=gettext("Hr"); ?>&nbsp;&nbsp;
940
				  				<select name="starttimemin" class="formselect" id="starttimemin">
941
				  					<option value="00">00</option>
942
				  					<option value="15">15</option>
943
				  					<option value="30">30</option>
944
				  					<option value="45">45</option>
945
				  					<option value="59">59</option>
946
				  				</select>&nbsp;<?=gettext("Min"); ?>
947
				  			</td>
948
				  			<td></td>
949
				  			<td>
950
				  				<select name="stoptimehour" class="formselect" id="stoptimehour">
951
				  				<?php 
952
				  						for ($i=0; $i<24; $i++)
953
				  						{
954
				  							if ($i==23)
955
				  								$selected = "selected=\"selected\"";
956
				  							else
957
				  								$selected = "";
958
				  								
959
				  							echo "<option value=\"$i\" $selected>";
960
				  							echo $i;
961
				  							echo "</option>";
962
				  						}
963
				  					?>
964
				  				</select>&nbsp;<?=gettext("Hr");?>&nbsp;&nbsp;
965
				  				<select name="stoptimemin" class="formselect" id="stoptimemin">
966
				  					<option value="00">00</option>
967
				  					<option value="15">15</option>
968
				  					<option value="30">30</option>
969
				  					<option value="45">45</option>
970
				  					<option value="59" selected="selected">59</option>
971
				  				</select>&nbsp;<?=gettext("Min");?>
972
				  			</td>
973
				  		</tr>
974
				  	</table><br />
975
                   <?=gettext("Select the time range for the day(s) selected on the Month(s) above. A full day is 0:00-23:59.")?>
976
					</td>
977
				</tr>
978
				<tr>
979
					<td width="15%" valign="top" class="vncell"><?=gettext("Time Range Description")?></td>
980
					<td width="85%" class="vtable"><input name="timerangedescr" type="text" class="formfld unknown" id="timerangedescr" size="40" maxlength="40" /><br />
981
 						<span class="vexpl">
982
				        	<?=gettext("You may enter a description here for your reference (not parsed).")?>
983
				      	</span>     
984
				      </td>					
985
				</tr>
986
				<tr>
987
				  <td width="22%" valign="top">&nbsp;</td>
988
				  <td width="78%">
989
				  	<input type="button" value="<?=gettext("Add Time");?>"  class="formbtn"  onclick="javascript:processEntries();" />&nbsp;&nbsp;&nbsp;
990
				  	<input type="button" value="<?=gettext("Clear Selection");?>" class="formbtn" onclick="javascript:clearCalendar(); clearTime(); clearDescr();" />
991
                    </td>
992
				</tr>
993
				<tr>
994
				  <td width="15%" valign="top" class="vtable"></td>
995
				  <td width="85%" class="vtable">
996
                    </td>
997
				</tr>
998
				<tr>
999
					<td colspan="2" valign="top" class="listtopic"><?=gettext("Schedule repeat");?></td>
1000
				</tr>	
1001
				<tr>
1002
					<td width="15%" valign="top" class="vncellreq"><?=gettext("Configured Ranges");?></td>
1003
					<td width="85%">
1004
						<table id="scheduletable" summary="range">
1005
							<tbody>
1006
								<tr>
1007
									<td align="center" class="listbg" width="35%"><?=gettext("Day(s)");?></td>
1008
									<td align="center" class="listbg" width="12%"><?=gettext("Start Time");?></td>
1009
									<td align="center" class="listbg" width="11%"><?=gettext("Stop Time");?></td>
1010
									<td align="center" class="listbg" width="42%"><?=gettext("Description");?></td>
1011
								</tr>
1012
								<?php
1013
								if ($getSchedule){
1014
									$counter = 0;
1015
																		
1016
									foreach($pconfig['timerange'] as $timerange) {
1017
										$tempFriendlyTime = "";
1018
										$tempID = "";
1019
										if ($timerange){
1020
											$dayFriendly = "";
1021
											$tempFriendlyTime = "";
1022
											$timedescr = $timerange['rangedescr'];			
1023
												
1024
											//get hours
1025
											$temptimerange = $timerange['hour'];
1026
											$temptimeseparator = strrpos($temptimerange, "-");
1027
											
1028
											$starttime = substr ($temptimerange, 0, $temptimeseparator); 
1029
											$stoptime = substr ($temptimerange, $temptimeseparator+1); 
1030
											$currentDay = "";
1031
											$firstDay = "";
1032
											$nextDay = "";
1033
											$foundEnd = false;
1034
											$firstDayFound = false;
1035
											$firstPrint = false;	
1036
											$firstprint2 = false;
1037
											
1038
											if ($timerange['month']){
1039
												$tempmontharray = explode(",", $timerange['month']);
1040
												$tempdayarray = explode(",",$timerange['day']);
1041
												$arraycounter = 0;
1042
												foreach ($tempmontharray as $monthtmp){
1043
													$month = $tempmontharray[$arraycounter];
1044
													$day = $tempdayarray[$arraycounter];
1045
													$daypos = date("w", mktime(0, 0, 0, date($month), date($day), date("Y")));
1046
													//if sunday, set position to 7 to get correct week number. This is due to php limitations on ISO-8601. When we move to php5.1 we can change this.
1047
													if ($daypos == 0){
1048
														$daypos = 7;
1049
													}									
1050
													$weeknumber = date("W", mktime(0, 0, 0, date($month), date($day), date("Y")));
1051
													$weeknumber = ltrim($weeknumber, "0");		
1052
																										
1053
													if ($firstPrint)
1054
													{
1055
														$tempID .= ",";
1056
													}
1057
													$tempID .= "w" . $weeknumber . "p" . $daypos . "-m" .  $month . "d" . $day;
1058
													$firstPrint = true;
1059
													
1060
													if (!$firstDayFound)
1061
													{
1062
														$firstDay = $day;
1063
														$firstmonth = $month;
1064
														$firstDayFound = true;
1065
													}
1066
														
1067
													$currentDay = $day;
1068
													$nextDay = $tempdayarray[$arraycounter+1];
1069
													$currentDay++;
1070
													if (($currentDay != $nextDay) || ($tempmontharray[$arraycounter] != $tempmontharray[$arraycounter+1])){
1071
														if ($firstprint2)
1072
															$tempFriendlyTime .= ", ";
1073
														$currentDay--;
1074
														if ($currentDay != $firstDay)
1075
															$tempFriendlyTime .= $monthArray[$firstmonth-1] . " " . $firstDay . " - " . $currentDay ;
1076
														else
1077
															$tempFriendlyTime .=  $monthArray[$month-1] . " " . $day;
1078
														$firstDayFound = false;	
1079
														$firstprint2 = true;
1080
													}													
1081
													$arraycounter++;			
1082
												}																						
1083
												
1084
											}
1085
											else
1086
											{
1087
												$dayFriendly = $timerange['position'];
1088
												$tempID = $dayFriendly;
1089
											}											
1090
											
1091
											$tempTime = $tempID . "||" . $starttime . "-" . $stoptime . "||" . $timedescr;
1092
									
1093
											//following code makes the days friendly appearing, IE instead of Mon, Tues, Wed it will show Mon - Wed
1094
											$foundEnd = false;
1095
											$firstDayFound = false;
1096
											$firstprint = false;
1097
											$tempFriendlyDayArray = explode(",", $dayFriendly);
1098
											$currentDay = "";
1099
											$firstDay = "";
1100
											$nextDay = "";
1101
											$i = 0;
1102
											if (!$timerange['month']){										
1103
												foreach ($tempFriendlyDayArray as $day){
1104
													if ($day != ""){
1105
														if (!$firstDayFound)
1106
														{
1107
															$firstDay = $tempFriendlyDayArray[$i];
1108
															$firstDayFound = true;
1109
														}
1110
														$currentDay =$tempFriendlyDayArray[$i];
1111
														//get next day
1112
														$nextDay = $tempFriendlyDayArray[$i+1];
1113
														$currentDay++;					
1114
														if ($currentDay != $nextDay){
1115
															if ($firstprint)
1116
																$tempFriendlyTime .= ", ";
1117
															$currentDay--;
1118
															if ($currentDay != $firstDay)
1119
																$tempFriendlyTime .= $dayArray[$firstDay-1] . " - " . $dayArray[$currentDay-1];
1120
															else
1121
																$tempFriendlyTime .= $dayArray[$firstDay-1];
1122
															$firstDayFound = false;	
1123
															$firstprint = true;			
1124
														}
1125
														$i++;
1126
													}
1127
												}		
1128
											}	
1129
												
1130
																																													
1131
									?>
1132
						          <tr>
1133
						          	<td>
1134
						          		<span class="vexpl"><?php echo $tempFriendlyTime; ?></span>
1135
						          	</td>
1136
									<td>
1137
						              <input type='text' readonly='readonly' class='vexpl' name='starttime<?php echo $counter; ?>' id='starttime<?php echo $counter; ?>' style=' word-wrap:break-word; width:100%; border:0px solid;' value='<?php echo $starttime; ?>' />
1138
							        </td>
1139
						            <td>
1140
						              <input type='text' readonly='readonly' class='vexpl' name='stoptime<?php echo $counter; ?>' id='stoptime<?php echo $counter; ?>' style=' word-wrap:break-word; width:100%; border:0px solid;' value='<?php echo $stoptime; ?>' /> 
1141
							        </td>
1142
							        <td>
1143
							        	<input type='text' readonly='readonly' class='vexpl' name='timedescr<?php echo $counter; ?>' id='timedescr<?php echo $counter; ?>' style=' word-wrap:break-word; width:100%; border:0px solid;' value='<?php echo $timedescr; ?>' />
1144
							        </td>
1145
							        <td>
1146
							        	<a onclick='editRow("<?php echo $tempTime; ?>",this); return false;' href='#'><img border='0' src='/themes/<?php echo $g['theme']; ?>/images/icons/icon_e.gif' alt='edit' /></a>
1147
							        </td>
1148
							        <td>
1149
							        	<a onclick='removeRow(this); return false;' href='#'><img border='0' src='/themes/<?php echo $g['theme']; ?>/images/icons/icon_x.gif' alt='remove' /></a>
1150
							        </td>
1151
							        <td>
1152
							        	<input type='hidden' id='schedule<?php echo $counter; ?>' name='schedule<?php echo $counter; ?>' value='<?php echo $tempID; ?>' />
1153
							        </td>
1154
						          </tr>
1155
									<?php
1156
						        $counter++;
1157
									}//end if						
1158
						        } // end foreach	
1159
								}//end if							
1160
								?>
1161
							</tbody>	
1162
						</table>				
1163
					</td>
1164
				</tr>
1165
			 	<tr>
1166
				    <td width="15%" valign="top">&nbsp;</td>
1167
				    <td width="85%">
1168
				      <input id="submit" name="submit" type="submit" onclick="return checkForRanges();" class="formbtn" value="<?=gettext("Save"); ?>" />
1169
				      <input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
1170
				      <?php if (isset($id) && $a_schedules[$id]): ?>
1171
				      <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
1172
				      <?php endif; ?>
1173
				    </td>
1174
			  	</tr>
1175
			 </table>
1176
		
1177
</td></tr></table></form>
1178
<?php include("fend.inc"); ?>
1179
</body>
1180
</html>
(74-74/256)