Viewing file: configuration.php (12.58 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? include('includes/application_top.php'); ?>
<?
if ($HTTP_GET_VARS['action']) {
if ($HTTP_GET_VARS['action'] == 'save') {
tep_db_query("update configuration set configuration_key = '" . $HTTP_POST_VARS['configuration_key'] . "', configuration_value = '" . $HTTP_POST_VARS['configuration_value'] . "', use_function = '" . $HTTP_POST_VARS['use_function'] . "', last_modified = now() where configuration_id = '" . $HTTP_POST_VARS['configuration_id'] . "'");
header('Location: ' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action')) . '&gID=' . $HTTP_GET_VARS['gID'], 'NONSSL')); tep_exit();
}
}
?>
<html>
<head>
<title><? echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body onload="SetFocus();" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<? $include_file = DIR_WS_INCLUDES . 'header.php'; include(DIR_WS_INCLUDES . 'include_once.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="5" cellpadding="5">
<tr>
<td width="<? echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<? echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<? $include_file = DIR_WS_INCLUDES . 'column_left.php'; include(DIR_WS_INCLUDES . 'include_once.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
</tr>
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="boxborder">
<tr>
<td bgcolor="<? echo TOP_BAR_BACKGROUND_COLOR; ?>" width="100%" nowrap><font face="<? echo TOP_BAR_FONT_FACE; ?>" size="<? echo TOP_BAR_FONT_SIZE; ?>" color="<? echo TOP_BAR_FONT_COLOR; ?>"> <? echo TOP_BAR_TITLE; ?> </font></td>
</tr>
</table></td>
</tr>
<tr>
<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td nowrap><font face="<? echo HEADING_FONT_FACE; ?>" size="<? echo HEADING_FONT_SIZE; ?>" color="<? echo HEADING_FONT_COLOR; ?>"> <? echo HEADING_TITLE; ?> </font></td>
<td align="right" nowrap> <? echo tep_image(DIR_WS_CATALOG . 'images/pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT, '0', ''); ?> </td>
</tr>
</table></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2"><? echo tep_black_line(); ?></td>
</tr>
<tr>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td nowrap><font face="<? echo TABLE_HEADING_FONT_FACE; ?>" size="<? echo TABLE_HEADING_FONT_SIZE; ?>" color="<? echo TABLE_HEADING_FONT_COLOR; ?>"><b> <? echo TABLE_HEADING_CONFIGURATION_TITLE; ?> </b></font></td>
<td nowrap><font face="<? echo TABLE_HEADING_FONT_FACE; ?>" size="<? echo TABLE_HEADING_FONT_SIZE; ?>" color="<? echo TABLE_HEADING_FONT_COLOR; ?>"><b> <? echo TABLE_HEADING_CONFIGURATION_VALUE; ?> </b></font></td>
<td align="center" nowrap><font face="<? echo TABLE_HEADING_FONT_FACE; ?>" size="<? echo TABLE_HEADING_FONT_SIZE; ?>" color="<? echo TABLE_HEADING_FONT_COLOR; ?>"><b> <? echo TABLE_HEADING_ACTION; ?> </b></font></td>
</tr>
<tr>
<td colspan="3"><? echo tep_black_line(); ?></td>
</tr>
<?
$rows = 0;
$configuration_query = tep_db_query("select configuration_id as cfgID, configuration_title as cfgTitle, configuration_value as cfgValue, use_function from configuration where configuration_group_id = '" . $HTTP_GET_VARS['gID'] . "' order by sort_order");
while ($configuration = tep_db_fetch_array($configuration_query)) {
$rows++;
if (tep_not_null($configuration['use_function'])) {
$cfgValue = $configuration['use_function']($configuration['cfgValue']);
} else {
$cfgValue = $configuration['cfgValue'];
}
if (((!$HTTP_GET_VARS['info']) || (@$HTTP_GET_VARS['info'] == $configuration['cfgID'])) && (!$cfgInfo) && (substr($HTTP_GET_VARS['action'], 0, 3) != 'new')) {
$cfg_extra_query = tep_db_query("select configuration_key as cfgKey, configuration_description as cfgDesc, date_added, last_modified, use_function from configuration where configuration_id = '" . $configuration['cfgID'] . "'");
$cfg_extra = tep_db_fetch_array($cfg_extra_query);
$cfgInfo_array = tep_array_merge($configuration, $cfg_extra);
$cfgInfo = new configurationInfo($cfgInfo_array);
}
if ($configuration['cfgID'] == @$cfgInfo->id) {
echo ' <tr bgcolor="#b0c8df">' . "\n";
} else {
echo ' <tr bgcolor="#d8e1eb" onmouseover="this.style.background=\'#cc9999\';this.style.cursor=\'hand\'" onmouseout="this.style.background=\'#d8e1eb\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('info', 'action')) . 'info=' . $configuration['cfgID'], 'NONSSL') . '\'">' . "\n";
}
?>
<td nowrap><font face="<? echo SMALL_TEXT_FONT_FACE; ?>" size="<? echo SMALL_TEXT_FONT_SIZE; ?>" color="<? echo SMALL_TEXT_FONT_COLOR; ?>"> <? echo $configuration['cfgTitle']; ?> </font></td>
<td nowrap><font face="<? echo SMALL_TEXT_FONT_FACE; ?>" size="<? echo SMALL_TEXT_FONT_SIZE; ?>" color="<? echo SMALL_TEXT_FONT_COLOR; ?>"> <? echo htmlspecialchars($cfgValue); ?> </font></td>
<?
if ($configuration['cfgID'] == @$cfgInfo->id) {
?>
<td align="center" nowrap><font face="<? echo SMALL_TEXT_FONT_FACE; ?>" size="<? echo SMALL_TEXT_FONT_SIZE; ?>" color="<? echo SMALL_TEXT_FONT_COLOR; ?>"> <? echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', 13, 13, 0, ''); ?> </font></td>
<?
} else {
?>
<td align="center" nowrap><font face="<? echo SMALL_TEXT_FONT_FACE; ?>" size="<? echo SMALL_TEXT_FONT_SIZE; ?>" color="<? echo SMALL_TEXT_FONT_COLOR; ?>"> <? echo '<a href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('info', 'action')) . 'info=' . $configuration['cfgID'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', '13', '13', '0', IMAGE_ICON_INFO) . '</a>'; ?> </font></td>
<?
}
?>
</tr>
<?
}
?>
<tr>
<td colspan="3"><? echo tep_black_line(); ?></td>
</tr>
</table></td>
<td width="25%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?
$info_box_contents = array();
if ($cfgInfo) $info_box_contents[] = array('align' => 'left', 'text' => ' <b>' . $cfgInfo->title . '</b> ');
if ((!$peInfo) && ($HTTP_GET_VARS['action'] == 'new')) $info_box_contents[] = array('align' => 'left', 'text' => ' <b>' . TEXT_INFO_HEADING_NEW_PRODUCT . '</b> ');
?>
<tr bgcolor="#81a2b6">
<td>
<? new infoBoxHeading($info_box_contents); ?>
</td>
</tr>
<tr bgcolor="#81a2b6">
<td><? echo tep_black_line(); ?></td>
</tr>
<?
if ($HTTP_GET_VARS['action'] == 'new') {
$form = '<form name="specials_new" action="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, tep_get_all_get_params(array('action')) . 'action=insert', 'NONSSL') . '" method="post">' ."\n";
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left', 'text' => TEXT_INFO_INSERT_INTRO . '<br> ');
$info_box_contents[] = array('align' => 'left', 'text' => ' ' . TEXT_INFO_PRODUCTS_NAME . '<br> <input type="text" name="products_name"><br> <br>' . TEXT_INFO_DATE_EXPECTED . '<br> <input type="text" name="date_expected"><br> ');
$info_box_contents[] = array('align' => 'left', 'text' => TEXT_INFO_DATE_NOTE . '<br> ');
$info_box_contents[] = array('align' => 'center', 'text' => tep_image_submit(DIR_WS_IMAGES . 'button_save.gif', '66', '20', '0', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, tep_get_all_get_params(array('action')), 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'button_cancel.gif', '66', '20', '0', IMAGE_CANCEL) . '</a>');
} elseif ($HTTP_GET_VARS['action'] == 'edit') {
$form = '<form name="configuration" action="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action')) . 'action=save', 'NONSSL') . '" method="post"><input type="hidden" name="configuration_id" value="' . $cfgInfo->id . '">' . "\n";
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left', 'text' => TEXT_INFO_EDIT_INTRO . '<br> ');
$info_box_contents[] = array('align' => 'left', 'text' => TEXT_INFO_KEY . '<br><input type="text" name="configuration_key" value="' . $cfgInfo->key . '"><br> ');
$info_box_contents[] = array('align' => 'left', 'text' => TEXT_INFO_VALUE . '<br><input type="text" name="configuration_value" value="' . $cfgInfo->value . '"><br> ');
$info_box_contents[] = array('align' => 'left', 'text' => TEXT_INFO_FUNCTION . '<br><input type="text" name="use_function" value="' . $cfgInfo->use_function . '"><br> ');
$info_box_contents[] = array('align' => 'left', 'text' => TEXT_INFO_DEFINE_NOTE . '<br> ');
$info_box_contents[] = array('align' => 'left', 'text' => TEXT_INFO_FUNCTION_NOTE . '<br> ');
$info_box_contents[] = array('align' => 'center', 'text' => tep_image_submit(DIR_WS_IMAGES . 'button_update.gif', '66', '20', '0', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action')), 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'button_cancel.gif', '66', '20', '0', IMAGE_CANCEL) . '</a>');
} elseif ($HTTP_GET_VARS['action'] == 'delete') {
$form = '<form name="products_expected" action="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, tep_get_all_get_params(array('action')) . 'action=deleteconfirm', 'NONSSL') . '" method="post"><input type="hidden" name="products_expected_id" value="' . $peInfo->id . '">' ."\n";
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left', 'text' => TEXT_INFO_DELETE_INTRO . '<br> ');
$info_box_contents[] = array('align' => 'left', 'text' => ' <b>' . $peInfo->products_name . '</b><br> ');
$info_box_contents[] = array('align' => 'center', 'text' => tep_image_submit(DIR_WS_IMAGES . 'button_delete.gif', '66', '20', '0', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, tep_get_all_get_params(array('action')), 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'button_cancel.gif', '66', '20', '0', IMAGE_CANCEL) . '</a>');
} else {
$info_box_contents = array();
$info_box_contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action')) . 'action=edit', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'button_edit.gif', '66', '20', '0', IMAGE_EDIT) . '</a>');
$info_box_contents[] = array('align' => 'left', 'text' => '<br> ' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($cfgInfo->date_added) . '<br> ' . TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($cfgInfo->last_modified));
$info_box_contents[] = array('align' => 'left', 'text' => '<br>' . TEXT_INFO_DESCRIPTION . '<br>' . $cfgInfo->description);
}
?>
<tr bgcolor="#b0c8df"><? echo $form; ?>
<td>
<? new infoBox($info_box_contents); ?>
</td>
<? if ($form) echo '</form>'; ?></tr>
<tr bgcolor="#b0c8df">
<td><? echo tep_black_line(); ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<? $include_file = DIR_WS_INCLUDES . 'footer.php'; include(DIR_WS_INCLUDES . 'include_once.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<? $include_file = DIR_WS_INCLUDES . 'application_bottom.php'; include(DIR_WS_INCLUDES . 'include_once.php'); ?>
|