| version 1.24, 2003/04/06 01:38:38 |
version 1.25, 2003/04/07 00:35:00 |
|
|
| * http://www.platon.sk/projects/phpMyEdit/ |
* http://www.platon.sk/projects/phpMyEdit/ |
| */ |
*/ |
| |
|
| /* $Platon: phpMyEdit/phpMyEditSetup.php,v 1.23 2003/04/02 22:09:31 nepto Exp $ */ |
/* $Platon: phpMyEdit/phpMyEditSetup.php,v 1.24 2003/04/06 01:38:38 nepto Exp $ */ |
| |
|
| ?> |
?> |
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| |
"http://www.w3.org/TR/html4/loose.dtd"> |
| <html> |
<html> |
| <head> |
<head> |
| |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| <title>phpMyEdit Setup</title> |
<title>phpMyEdit Setup</title> |
| <style type="text/css"> |
<style type="text/css"> |
| <!-- |
<!-- |
|
|
| |
|
| <?php |
<?php |
| |
|
| $pageTitle = @$HTTP_POST_VARS['pageTitle']; |
$hn = @$HTTP_POST_VARS['hn']; |
| $baseFilename = @$HTTP_POST_VARS['baseFilename']; |
$un = @$HTTP_POST_VARS['un']; |
| $submit = @$HTTP_POST_VARS['submit']; |
$pw = @$HTTP_POST_VARS['pw']; |
| $hn = @$HTTP_POST_VARS['hn']; |
$db = @$HTTP_POST_VARS['db']; |
| $un = @$HTTP_POST_VARS['un']; |
$tb = @$HTTP_POST_VARS['tb']; |
| $pw = @$HTTP_POST_VARS['pw']; |
$id = @$HTTP_POST_VARS['id']; |
| $db = @$HTTP_POST_VARS['db']; |
$submit = @$HTTP_POST_VARS['submit']; |
| $tb = @$HTTP_POST_VARS['tb']; |
$options = @$HTTP_POST_VARS['options']; |
| $id = @$HTTP_POST_VARS['id']; |
$baseFilename = @$HTTP_POST_VARS['baseFilename']; |
| |
$pageTitle = @$HTTP_POST_VARS['pageTitle']; |
| |
$pageHeader = @$HTTP_POST_VARS['pageHeader']; |
| |
$HTMLissues = @$HTTP_POST_VARS['HTMLissues']; |
| |
$CSSstylesheet = @$HTTP_POST_VARS['CSSstylesheet']; |
| |
|
| $phpExtension = '.php'; |
$phpExtension = '.php'; |
| if (isset($baseFilename) && $baseFilename != '') { |
if (isset($baseFilename) && $baseFilename != '') { |
| Line 159 if ((!$dbl) or empty($submit)) { |
|
| Line 165 if ((!$dbl) or empty($submit)) { |
|
| } else if (!isset($id)) { |
} else if (!isset($id)) { |
| echo ' <h1>Please choose an identifier from table: '.htmlspecialchars($tb).'</h1> |
echo ' <h1>Please choose an identifier from table: '.htmlspecialchars($tb).'</h1> |
| <p> |
<p> |
| This field will be used in change, view, copy and deletes operation.<br> |
This field will be used in change, view, copy and delete operations.<br> |
| It should be numeric and must uniquely identify a record. |
The field should be numeric and must uniquely identify a record. |
| </p> |
</p> |
| <p> |
<p> |
| Please note, that there were problems reported by phpMyEdit users |
Please note, that there were problems reported by phpMyEdit users |
| Line 190 if ((!$dbl) or empty($submit)) { |
|
| Line 196 if ((!$dbl) or empty($submit)) { |
|
| $r = @mysql_fetch_array($tb_desc, $j); |
$r = @mysql_fetch_array($tb_desc, $j); |
| } |
} |
| echo '</table><br> |
echo '</table><br> |
| |
<input type="submit" name="submit" value="Submit"> |
| |
<input type="submit" name="cancel" value="Cancel"> |
| |
</form>'."\n"; |
| |
|
| |
} else if (!isset($options)) { |
| |
echo '<h1>Please choose an additional options</h1> |
| |
<form action="'.htmlspecialchars($self).'" method="POST"> |
| |
<input type="hidden" name="hn" value="'.htmlspecialchars($hn).'"> |
| |
<input type="hidden" name="un" value="'.htmlspecialchars($un).'"> |
| |
<input type="hidden" name="pw" value="'.htmlspecialchars($pw).'"> |
| |
<input type="hidden" name="db" value="'.htmlspecialchars($db).'"> |
| |
<input type="hidden" name="tb" value="'.htmlspecialchars($tb).'"> |
| |
<input type="hidden" name="id" value="'.htmlspecialchars($id).'"> |
| <table border="1" cellpadding="1" cellspacing="1" summary="Additional options"> |
<table border="1" cellpadding="1" cellspacing="1" summary="Additional options"> |
| <tr><td>Page title</td><td><input type="text" name=pageTitle value =""></td></tr> |
|
| <tr><td>Base filename</td><td><input type="text" name=baseFilename value ="'.htmlspecialchars($tb).'"></td></tr> |
<tr><td>Base filename</td><td><input type="text" name=baseFilename value ="'.htmlspecialchars($tb).'"></td></tr> |
| |
<tr><td>Page title</td><td><input type="text" name=pageTitle value ="'.htmlspecialchars($tb).'"></td></tr> |
| |
<tr><td>Page header</td><td><input type="checkbox" name=pageHeader></td></tr> |
| |
<tr><td>HTML header & footer</td><td><input type="checkbox" name=HTMLissues></td></tr> |
| |
<tr><td>CSS basic stylesheet</td><td><input checked type="checkbox" name=CSSstylesheet></td></tr> |
| </table><br> |
</table><br> |
| <input type="submit" name="submit" value="Submit"> |
<input type="submit" name="submit" value="Submit"> |
| <input type="submit" name="cancel" value="Cancel"> |
<input type="submit" name="cancel" value="Cancel"> |
| |
<input type="hidden" name="options" value="1"> |
| </form>'."\n"; |
</form>'."\n"; |
| |
|
| } else { |
} else { |
| echo '<h1>Here is your phpMyEdit calling program</h1>'."\n"; |
echo '<h1>Here is your phpMyEdit calling program</h1>'."\n"; |
| echo '<h2>You may now copy and paste it into your PHP editor</h2>'."\n"; |
echo '<h2>You may now copy and paste it into your PHP editor</h2>'."\n"; |
| echo_buffer('<style type="text/css"> |
if ($pageHeader) { |
| table { border: #004d9c 1px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; } |
echo_buffer('<h3>'.$pageTitle.'</h3>'); |
| th { border: #004d9c 1px solid; padding: 4px; background: #add8e6; } |
} |
| td { border: #004d9c 1px solid; padding: 3px; } |
|
| hr { border: 0px solid; padding: 0px; margin: 0px; border-top-width: 1px; height: 1px; } |
|
| </style>'); |
|
| strlen($pageTitle) > 0 && echo_buffer('<h3>'.$pageTitle.'</h3>'); |
|
| echo_buffer("<?php |
echo_buffer("<?php |
| |
|
| /* |
/* |
| Line 381 appear in generated list. Here are some |
|
| Line 399 appear in generated list. Here are some |
|
| require_once 'phpMyEdit.class.php'; |
require_once 'phpMyEdit.class.php'; |
| new phpMyEdit(\$opts); |
new phpMyEdit(\$opts); |
| |
|
| ?>"); |
?> |
| |
"); |
| |
|
| |
$css_directive = <<<END |
| |
<style type="text/css"> |
| |
table { border: #004d9c 1px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; } |
| |
th { border: #004d9c 1px solid; padding: 4px; background: #add8e6; } |
| |
td { border: #004d9c 1px solid; padding: 3px; } |
| |
hr { border: 0px solid; padding: 0px; margin: 0px; border-top-width: 1px; height: 1px; } |
| |
</style> |
| |
END; |
| |
if (! $CSSstylesheet) { |
| |
$css_directive = ''; |
| |
} |
| |
|
| |
if ($HTMLissues) { |
| |
$buffer = <<<END |
| |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| |
"http://www.w3.org/TR/html4/loose.dtd"> |
| |
<html> |
| |
<head> |
| |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| |
<title>$pageTitle</title> |
| |
$css_directive |
| |
</head> |
| |
<body> |
| |
END |
| |
. "\n" . $buffer; |
| |
} else if ($CSSstylesheet) { |
| |
$buffer = $css_directive . $buffer; |
| |
} |
| |
if ($HTMLissues) { |
| |
$buffer .= <<<END |
| |
</body> |
| |
</html> |
| |
END; |
| |
} |
| |
|
| // write the content include file |
// write the content include file |
| echo 'Trying to write content file to: <b>'.'./'.$contentFile.'</b><br>'."\n"; |
echo 'Trying to write content file to: <b>'.'./'.$contentFile.'</b><br>'."\n"; |
| $filehandle = @fopen('./'.$contentFile,'w+'); |
$filehandle = @fopen('./'.$contentFile, 'w+'); |
| if ($filehandle) { |
if ($filehandle) { |
| fwrite($filehandle,$buffer); |
fwrite($filehandle, $buffer); |
| flush($filehandle); |
flush($filehandle); |
| fclose($filehandle); |
fclose($filehandle); |
| echo 'phpMyEdit content file written successfully<br>'; |
echo 'phpMyEdit content file written successfully<br>'; |