<?php
session_start();
if (!isset($_SESSION['login']))
{include("index.php");
exit();}
?>
<html>
<head>
<title>
<?php
extract($_GET);
echo "Rotide Egap v1.4 - Editing $file";
?>
</title>
<style type='text/css'>
body
{
font-family:arial, serif;
}
</style>
<script type='text/javascript' src='about/about.js'>
</script>
<script type='text/javascript'>
<?php
include("db.php");
$user=$_SESSION['login'];
$dbh=mysql_connect ($host,$account,$acc_pw) or die (mysql_error());
mysql_select_db ($table);
$sql="SELECT * FROM Accounts WHERE Username='$user'";
$rs=mysql_query($sql,$dbh);
$row=mysql_fetch_array($rs);
$edit=$row['edit'];
$theme=$row['theme'];
mysql_close($dbh);
echo "function detect()\n";
echo "{\n";
echo "edit='$edit';\n";
?>
if (edit=="Beginner")
{
detect=document.getElementById("saved").innerHTML;
//alert(detect_b);
not_saved=detect.indexOf("Not")
//alert(not_saved);
if (not_saved=="37")
{
save=confirm("Save Changes?", "Save Changes?")
if (save==true)
document.getElementById("egap").submit();
else if (save==false)
{
cancel=confirm("Do you want to exit?", "Exit?")
if (cancel==true)
location.href='main.php?id=cms'
}
}
else
location.href='main.php?id=cms';
}
else
location.href='main.php?id=cms';
}
function code()
{
code=document.getElementById("egap_b_code").value
alert(code);
}
</script>
</head>
<body>
<?php
echo "<form id='egap' name='egap' method='post' action='egap_save.php?file=$file'>";
#Commented out for TESTING purposes... (12/05/04)
#extract($_SESSION['login']);
?>
<table summary='top' border='0' width='100%'>
<tr>
<td>
<img src='http://netlink.kaibasoftware.com/Images/Logos/rotide1_4.gif' alt=''/><br/>
<small><a href="about/rotide14.php" onclick="NewWindow(this.href,'name','490','250','yes');return false;">
Copyright Information</a></small>
<div id='rotide_top' style='border: 2px black solid; font-size: 10pt; width:550px;' >
Welcome to
<b>R<small>OTIDE</small> E<small>GAP</small> v1.4</b>
- a visual web page editor!
<br/>
If you are new to the R<small>OTIDE</small> Editors, please visit the
<a href='main.php?id=tutorial#egap'>Tutorial</a> section first
before proceeding.
</div>
</td>
<td width='200px'>
<!--
Final Options consisting of Save and Cancel. Mainly for the user to Save their current page
- with the process of the Edit Page and Saved Page along with having the ability to cancel
- their changes if they want. Knowing teachers....who knows?
-->
<div align='center'>
<fieldset style='border: 2px black solid; background-color: #FFCC00;' >
<legend align='center' style='font-weight:bold;'>
Options
</legend>
<?php
echo "<input type='submit' value='Save $file' style='font-weight:bold'>\n"
?><br/><br/>
<input type='button' value='Cancel Changes' onclick="detect()">
</fieldset>
</div>
</td>
</tr>
</table>
<br/>
Current Editing Style:
<?php
$host='216.10.20.4';
$account='kaiba_webmaster';
$acc_pw='staples1279294';
$table="kaiba_netlink";
$user=$_SESSION['login'];
$dbh=mysql_connect ($host,$account,$acc_pw) or die (mysql_error());
mysql_select_db ($table);
$sql="SELECT * FROM Accounts WHERE Username='$user'";
$rs=mysql_query($sql,$dbh);
$row=mysql_fetch_array($rs);
$edit=$row['edit'];
$theme=$row['theme'];
mysql_close($dbh);
if ($edit=="Beginner")
{
echo "<span style='font-weight:bold; color: #0000FF;'>Beginner (R<small>OTIDE</small> Editors)</span>";
echo "<br/><br/>\n";
include("egap_b.php");
}
elseif ($edit=="Advanced")
{
echo "<span style='font-weight:bold; color: #006699;'>Advanced (Raw <span style='font-family: Courier New, serif;'>HTML</span>)</span>";
echo "<br/><br/>\n";
include("egap_a.php");
}
?>
</form>
</body>
</html>