Пример #1
0
                print "</HEAD>\n<BODY onLoad = 'ck_frames();'>\n";
                // 9/21/08
                $evenodd = array("even", "odd");
                ?>
<DIV ID='to_bottom' style="position:fixed; top:4px; left:20px; height: 12px; width: 10px;" onclick = "location.href = '#bottom';"><IMG SRC="markers/down.png" BORDER=0 /></div>
<A NAME="top" /> <!-- 11/11/09 -->

<?php 
                print "<SPAN STYLE='margin-left:40px'><FONT CLASS='header'>Edit Settings</FONT>  (mouseover caption for help information)</SPAN><BR /><BR />\n\t\t\t\t<TABLE BORDER='0' STYLE='margin-left:40px'><FORM METHOD='POST' NAME= 'set_Form'  \n\t\t\t\tonSubmit='return validate_set(document.set_Form);' ACTION='config.php?func=settings&go=true'>";
                $counter = 0;
                $result = mysql_query("SELECT * FROM `{$GLOBALS['mysql_prefix']}settings` ORDER BY name") or do_error('config.php::list_settings', 'mysql_query() failed', mysql_error(), __FILE__, __LINE__);
                while ($row = stripslashes_deep(mysql_fetch_array($result))) {
                    if ($row['name'][0] != "_") {
                        // hide these
                        $capt = str_replace("_", " ", $row['name']);
                        print "<TR CLASS='" . $evenodd[$counter % 2] . "'><TD CLASS='td_label'><A HREF='#' TITLE='" . get_setting_help($row['name']) . "'>{$capt}</A>: &nbsp;</TD>";
                        print "<TD><INPUT MAXLENGTH='512' SIZE='128' TYPE='text' VALUE='" . $row['value'] . "' NAME='" . $row['name'] . "'></TD></TR>\n";
                        $counter++;
                    }
                }
                // str_replace ( search, replace, subject)
                print "</FORM></TABLE>\n";
                // 7/16/09
                ?>
		<A NAME="bottom" /> <!-- 11/11/09 -->
		<IMG SRC="markers/up.png" BORDER=0  onclick = "location.href = '#top';" STYLE = 'margin-left: 20px'></TD>

			<DIV ID="foo"><DIV ID="bar">		<!-- 9/26/09 -->
				<INPUT TYPE='button' VALUE='Cancel' onClick='document.can_Form.submit();'><BR /><BR />
<?php 
                // 3/19/11
Пример #2
0
                for ($i = 0; $i < $_POST["frm_values"]; $i++) {
                    $query = "UPDATE settings SET value='" . $_POST[frm_setting_value][$i] . "' WHERE id='" . $_POST[frm_setting_id][$i] . "'";
                    if ($debug) {
                        print '<p> $query: ' . $query;
                    }
                    $result = mysql_query($query) or do_error('config.php::save_setting #$i', 'mysql_query() failed', mysql_error());
                }
                print '<FONT CLASS="header">Settings saved.</FONT><BR><BR>';
            } else {
                print '<FONT CLASS="header">System Settings</FONT><BR><BR><TABLE BORDER="0">
					<FORM METHOD="POST" ACTION="config.php?mode=settings&go=true">';
                $counter = 0;
                $query = 'SELECT * FROM settings ORDER BY name';
                $result = mysql_query($query) or do_error('config.php::list_settings', 'mysql_query() failed', mysql_error());
                while ($row = mysql_fetch_array($result)) {
                    print '<TR><TD CLASS="td_label"><A HREF="#" TITLE="' . get_setting_help($row[name]) . '">' . $row[name] . '</A>: &nbsp;</TD>' . " \n ";
                    print '<TD colspan="2" ><INPUT MAXLENGTH="255" SIZE="40" TYPE="text" VALUE="' . $row[value] . '" NAME="frm_setting_value[]">';
                    print '<INPUT TYPE="hidden" NAME="frm_setting_id[]" VALUE="' . $row[id] . "\"></TD></TR> \n ";
                    $counter++;
                }
                print '<TR><TD></TD><TD ><INPUT TYPE="hidden" NAME="frm_values" VALUE="' . $counter . '">' . " \n ";
                print '<INPUT TYPE="submit" VALUE="Apply"></FORM></TD>' . " \n ";
                print '<td align="right"><FORM METHOD="post" ACTION="config.php"><INPUT TYPE="submit" VALUE="Cancel / Go Back"></FORM></td></tr>' . " \n ";
                print '</TABLE>' . " \n ";
                powered();
                // Print "Powered by" and end the HTML page
                exit;
            }
        }
        break;
    case "id":