<?PHP
//........................

$table = "$prefix" . "SETTINGS";
$return = "options.php";

//........................

$SQL = "SELECT * from $table WHERE ID = '1'";  $result = @mySQL_query( $SQL ); $row = @mySQL_fetch_array( $result );

if (empty($row[ID]))
        $qt = insert;
if (!empty($row[ID]))
        $qt = update;

if ($_GET[page] == 'query')
        $save = 'Saved';
else
        $save = 'Save';

//........................
?> 

<h2><?PHP /* (LANGUAGE) */ $t = "Options"; $f = "header"; include "langinc.php"; /* (LANGUAGE) */ ?></h2>

<form name="form" method="post" action="index.php?page=query&save=saved">

<input type="hidden" name="controller" value="<?php echo $table; ?>~<?php echo $qt; ?>~<?php echo $return; ?>~1">

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr> 

<td style="padding-right:10px;" width="50%"> 

<h3><?PHP /* (LANGUAGE) */ $t = "Search Engine Friendly Pages"; $f = "seofriendly"; include "langinc.php"; /* (LANGUAGE) */ ?></h3>

<select name="MR" class="fieldbox" style="width: 100%;">

<option selected> 

<?PHP echo $row['MR']; ?>

</option>

<option value="Enabled"><?PHP /* (LANGUAGE) */ $t = "Enabled"; $f = "enabled"; include "langinc.php"; /* (LANGUAGE) */ ?></option>

<option value="Disabled"><?PHP /* (LANGUAGE) */ $t = "Disabled"; $f = "disabled"; include "langinc.php"; /* (LANGUAGE) */ ?></option>

</select>

</td>

<td style="padding-left:10px;" width="50%"> 

<h3><?PHP /* (LANGUAGE) */ $t = "Default Language"; $f = "defaultlanguage"; include "langinc.php"; /* (LANGUAGE) */ ?></h3>

<select name="LANG" class="fieldbox" style="width: 100%;">

<option selected> 

<?php echo $row[LANG]; ?>

</option>

<?PHP
$table = "$prefix" . "LANG";
$SQLbeta = "SELECT * from $table";
$resultbeta = @mySQL_query( $SQLbeta ); while( $rowbeta = @mySQL_fetch_array( $resultbeta ) ) {
?>

<option value="<?php echo $rowbeta[CODE]; ?>">

<?php echo $rowbeta[LANG]; ?>

</option>

<?PHP } ?>

</select>

</td>

</tr>

<tr>

<td style="padding-right:10px;" width="50%" class="linksmall">

<h3 style="margin-top:15px;"><?PHP /* (LANGUAGE) */ $t = "Google Translate API Key"; $f = "googlekey"; include "langinc.php"; /* (LANGUAGE) */ ?></h3>

<a href="http://code.google.com/apis/language/translate/v2/pricing.html" target="_blank">(<?PHP /* (LANGUAGE) */ $t = "Get a Google Translate API Key"; $f = "getgooglekey"; include "langinc.php"; /* (LANGUAGE) */ ?>)</a>

<input type="text" name="GTAPI" class="fieldbox" style="width: 100%;" value="<?php echo $row['GTAPI']; ?>">

</td>

<td style="padding-left:10px;" width="50%">&nbsp;</td>

</tr>

</table>

<div align="center">

<?php if ($_GET[save] != saved) { ?>

<input class="sparklybutton" type="submit" name="Submit" value="<?PHP /* (LANGUAGE) */ $t = "Save"; $f = "save"; include "langinc.php"; /* (LANGUAGE) */ ?>" style="margin-top: 15px;">

<?PHP } ?>

<?php if ($_GET[save] == saved) { ?>

<input class="sparklybutton" type="submit" name="Submit" value="<?PHP /* (LANGUAGE) */ $t = "Saved, Save Again?"; $f = "saved"; include "langinc.php"; /* (LANGUAGE) */ ?>" style="margin-top: 15px;">

<?PHP } ?>

</div>

</form>
