home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.f-secure.com
/
2014.06.ftp.f-secure.com.tar
/
ftp.f-secure.com
/
support
/
hotfix
/
fsav-server
/
FSAVSRV900_HF07.jar
/
iuwebui
/
forms
/
tree_updates
/
autoupdates-schedule.php
< prev
Wrap
PHP Script
|
2010-09-07
|
8KB
|
203 lines
<?php
include ("..\common\commonphp.php");
$tab_name = "tabAUASchedule";
$Page_Settings = array(1 => array(oid => '1.3.6.1.4.1.2213.42.1.11.8', type => GLOBAL_TBL));
$Week_Days = array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun');
if(!isset($_POST[SUBMIT_TABLE]))
{
/* first load of the page */
readSettings(&$Page_Settings);
}
else
{
if($_POST[RESTORE_TABLE] == 1)
{
/* user wants to restore defaults */
readDefaultSettings(&$Page_Settings);
}
else
{
/* Read table */
for($index = 0, $position = 0; $index < $_POST["ENTRIES_TABLE"]; $index++)
{
if(isset($_POST["EMPTY_TABLE"]) && $_POST["EMPTY_TABLE"] == 1 &&
isset($_POST["EMPTY_TABLE__{$index}"]) && $_POST["EMPTY_TABLE__{$index}"] == 1)
continue;
$Page_Settings[1][value][$position] = array("", "", "");
if(isset($_POST["VAR_TABLE__{$index}__0:0"]))
{
$_POST["VAR_TABLE__{$index}__0"] = '';
for($i = 0; $i < count($Week_Days); $i++)
if($_POST["VAR_TABLE__{$index}__0:$i"] == 1)
$_POST["VAR_TABLE__{$index}__0"] .= ",{$Week_Days[$i]}";
if($_POST["VAR_TABLE__{$index}__0"][0] == ',')
$_POST["VAR_TABLE__{$index}__0"] = substr($_POST["VAR_TABLE__{$index}__0"], 1);
$_POST["VAR_TABLE__{$index}__1"] = '';
if(isset($_POST["VAR_TABLE__{$index}__1:0"]) && strlen($_POST["VAR_TABLE__{$index}__1:0"]) > 0)
{
$_POST["VAR_TABLE__{$index}__1"] = $_POST["VAR_TABLE__{$index}__1:0"];
if(isset($_POST["VAR_TABLE__{$index}__1:1"]) && strlen($_POST["VAR_TABLE__{$index}__1:1"]) > 0)
$_POST["VAR_TABLE__{$index}__1"] .= ':' . $_POST["VAR_TABLE__{$index}__1:1"];
else
$_POST["VAR_TABLE__{$index}__1"] .= ':00';
}
$_POST["VAR_TABLE__{$index}__2"] = '';
if(isset($_POST["VAR_TABLE__{$index}__2:0"]) && strlen($_POST["VAR_TABLE__{$index}__2:0"]) > 0)
{
$_POST["VAR_TABLE__{$index}__2"] = $_POST["VAR_TABLE__{$index}__2:0"];
if(isset($_POST["VAR_TABLE__{$index}__2:1"]) && strlen($_POST["VAR_TABLE__{$index}__2:1"]) > 0)
$_POST["VAR_TABLE__{$index}__2"] .= ':' . $_POST["VAR_TABLE__{$index}__2:1"];
else
$_POST["VAR_TABLE__{$index}__2"] .= ':00';
}
$Page_Settings[1][value][$position][0] = stripslashes($_POST["VAR_TABLE__{$index}__0"]);
$Page_Settings[1][value][$position][1] = stripslashes($_POST["VAR_TABLE__{$index}__1"]);
$Page_Settings[1][value][$position][2] = stripslashes($_POST["VAR_TABLE__{$index}__2"]);
}
$position++;
}
readPageData(&$Page_Settings);
if($_POST[SUBMIT_TABLE] == 1)
writeSettings($Page_Settings);
}
exit(0);
}
if(count($Page_Settings[1][value]) == 0)
{
$info_txt = GLOBAL_EMPTYTBL_TEXT;
$table_as_html = "
<tr valign=center><td align='center'>
<font class='no_borders_input'>$info_txt</font>
</td><td> </td><td> </td><td align='center'>
<img src='/pics/empty.gif' width=1 height=1>
</td></tr>";
}
else
{
for($index = 0; $index < count($Page_Settings[1][value]); $index++)
{
unset($checked);
for($i = 0; $i < count($Week_Days); $i++)
if(strpos(strtoupper($Page_Settings[1][value][$index][0]), strtoupper($Week_Days[$i])) !== false)
$checked[$i] = 'checked';
$line0_content = '';
for($i = 0; $i < count($Week_Days); $i++)
$line0_content .= "<input type='checkbox' name='VAR_TABLE__{$index}__0:$i' value=1 $checked[$i]><font class='no_borders_input'> {$Week_Days[$i]} </font>";
$colon = strpos($Page_Settings[1][value][$index][1], ':');
if($colon !== false)
{
$hours = substr($Page_Settings[1][value][$index][1], 0, $colon);
$minutes = substr($Page_Settings[1][value][$index][1], $colon + 1);
}
else
{
$hours = $Page_Settings[1][value][$index][1];
$minutes = '';
}
$line1_content = " <input name='VAR_TABLE__{$index}__1:0' value='$hours' size=1 class='weekdaysfont'>:<input name='VAR_TABLE__{$index}__1:1' value='$minutes' size=1 class='weekdaysfont'>";
$colon = strpos($Page_Settings[1][value][$index][2], ':');
if($colon !== false)
{
$hours = substr($Page_Settings[1][value][$index][2], 0, $colon);
$minutes = substr($Page_Settings[1][value][$index][2], $colon + 1);
}
else
{
$hours = $Page_Settings[1][value][$index][2];
$minutes = '';
}
$line2_content = " <input name='VAR_TABLE__{$index}__2:0' value='$hours' size=1 class='weekdaysfont'>:<input name='VAR_TABLE__{$index}__2:1' value='$minutes' size=1 class='weekdaysfont'>";
$table_as_html .= "
<tr align=center>
<td>$line0_content</td>
<td>$line1_content</td>
<td>$line2_content</td>
<td align='center'><input type='checkbox' name='EMPTY_TABLE__{$index}' value='1'></td>
</tr>
";
}
}
$table_width = $INSIDE_TEXT_WIDTH;
$col1_width = 330;
$col4_width = 30;
$col2_width = $col3_width = ($table_width - $col1_width - $col4_width) / 2;
show_form_management($tab_name);
?>
<script language="javascript">
tabAUASchedule_add_hit = function()
{
document.form_tabAUASchedule.ENTRIES_TABLE.value++;
document.form_tabAUASchedule.SUBMIT_TABLE.value=1;
refreshed = true;
}
tabAUASchedule_empty_hit = function()
{
document.form_tabAUASchedule.EMPTY_TABLE.value=1;
document.form_tabAUASchedule.SUBMIT_TABLE.value=1;
refreshed = true;
}
</script>
<form method="POST" action='<?php echo "{$_SERVER['PHP_SELF']}?{$_SERVER['QUERY_STRING']}";?>' id="form_<?php echo $tab_name;?>" name="form_<?php echo $tab_name;?>" style="padding: 0; margin: 0;">
<input type="hidden" name="SUBMIT_TABLE" value="0">
<input type="hidden" name="RESTORE_TABLE" value="0">
<input type="hidden" name="APPLY_SETTINGS" value="0">
<input type="hidden" name="EMPTY_TABLE" value="0">
<input type="hidden" name="ENTRIES_TABLE" value="<?php echo count($Page_Settings[1][value]);?>">
<input type='hidden' name='VAR_PAGE_SETTINGS_0' value='0'>
<?php
for($index = 0; $index < count($Page_Settings[1][value]); $index++)
for($i = 0; $i < count($Week_Days); $i++)
echo "\n\t\t<input type=\"hidden\" name=\"VAR_TABLE__{$index}__0:$i\" value=\"0\">";
?>
<?php show_action_menu('Download Schedule', $tab_name); ?>
<table border="0" cellspacing="5" cellpadding="0" class="main_page_table">
<tr>
<td valign="top">
<table cellspacing="0" cellpadding="0" border="0" width="100%" class="table_settings">
<?php show_section_title('Settings');?>
<tr align="left" class="tr_setting">
<td nowrap class="td_setting">
<?=$Page_Settings[0][lock];?>
<?=fsloc('Download Schedule table')?>
<table style='table-layout:fixed;' border=1 cellpadding=0 cellspacing=0 bordercolorlight=D4D0C8>
<tr bgcolor="E6E6E6">
<td align="center" width=<?php echo $col1_width?>>Days</td>
<td align="center" width=<?php echo $col2_width?>>From</td>
<td align="center" width=<?php echo $col3_width?>>To</td>
<td valign="center" align="center" width=<?php echo $col4_width?>>
<a href="javascript:markall('form_<?php echo $tab_name;?>');"><img NAME="MyTrash" VALUE="MyTrash" border="0" src="/pics/trashbin.gif" alt="Select/Deselect all">
</td>
</tr>
<?php echo $table_as_html;?>
</table>
<p style="padding-top: 5px; margin: 0;">
<?php show_newtable_buttons($table_width + 10, $tab_name, true); ?>
</td></tr>
</table>
</td>
</tr>
<?php show_action_buttons($tab_name, true, true); ?>
</table>
</form>