Location: PHPKode > projects > NetLink > netlink_os/edit_profile.php
<style type="text/css">
<!--
.edit
{
  font-size:11pt;
}
-->
</style>

<?php
	include("db.php");
	$dbh=mysql_connect ($host,$account,$acc_pw) or die (mysql_error());
	mysql_select_db ($table); 
	$rs=mysql_query($sql, $dbh);
	$row=mysql_fetch_array($rs);
	
	$user_name = ucfirst(strtolower($row['Username']));
	$pw=strtolower($row['Password']);
	$edit=$row['edit'];
  $theme=$row['theme'];
  $pref=$row['pref'];
	mysql_close($dbh);
	
echo "<form method='post' action='?id=profile'>";
echo "<table summary='profile' border='0'>";
echo "<tr><th>Title</th><th>Information</th></tr>";
echo "<tr><td>Username</td><td><b>$user_name*</b></td></tr>";
echo "<tr><td>First Name</td><td><input type='text' name='f_name_up' id='f_name_up' value='$f_name'/></td></tr>";
echo "<tr><td>Last Name</td><td><input type='text' name='l_name_up' id='f_name'up' value='$l_name'/></td></tr>";
echo "<tr><td>Password</td><td><i>Hidden for Security</i>\t\t<br/>";
echo "<a href='?id=change_password' class='under'>Change Password</a></td></tr>";

echo "<tr>";
echo "<td>Site Manager Preference:</td>";
echo "<td>";

echo "<table id='edit'>";
echo "<tr>";
echo "<td style='vertical-align: top;'><input type='radio' id='pref' name='pref' value='t'";
 if ($pref=='t') echo "checked='checked'";
echo ">Text</input><br/><div style='text-align: center; background-color: #ccc;'><small>Edit</small></div></td>";
echo "<td style='vertical-align: top;'><input type='radio' id='pref' name='pref' value='i'";
 if ($pref=='i') echo "checked='checked'";
echo ">Images</input><br/><div style='text-align: center; background-color: #ccc;'><img src='Images/edit.gif' border='0'/></div></td>";
echo "<td style='vertical-align: top;'><input type='radio' id='pref' name='pref' value='ti'";
 if ($pref=='ti') echo "checked='checked'";
echo ">Images and Text</input><br/><div style='text-align: center; background-color: #ccc;'><img src='Images/edit.gif'/><br/><small>Edit</small></div></td>";
echo "</tr></table>";
echo "</td></tr>";


echo "<tr><td>Editing Preference:</td>";
echo "<td><table summary='edit' border='0' valign='top'>";
	echo "<tr><td class='edit'>";
if ($edit=="Beginner")
{
	echo "<input type='radio' name='edit' id='edit' value='Beginner' checked='checked'><b>Beginner</b></input><br/>";
	echo "<small>In the <b>Beginner</b> editing mode,<br/>";
	echo "the user is given access to<br/>";
	echo "Visual Editors, using a <acronym style='border-bottom:1px black dashed' title='What You See Is What You Get'>WYSIWYG</acronym><br/>";
	echo "theme, you can add information with the <br/>";
	echo "click of the mouse! No advanced coding required!";
	echo "</td><td width='20px'/><td valign='top' class='edit'>";
	echo "<input type='radio' name='edit' id='edit' value='Advanced' disabled='disabled'><span style='font-weight:bold; color:#000099'>Advanced</span></input><br/>";
	echo "<small><b>Advanced</b> users do <u>not</u> have access<br/>";
	echo "the Visual Editors. These users <b>hard code</b> their<br/>";
	echo "sites from the Raw <span style='font-family:courier new, courier point 10, serif'>HTML</span>.<br/>";
	echo "If you would like to <b>Upgrade</b> from Beginner to <br/>";
	echo "Advanced, you can do that from the <a href='main.php?id=upgrade' class='under'>upgrade</a> page.</small>";
}
elseif ($edit=="Advanced")
{
  
	echo "<input type='radio' name='edit' id='edit' value='Beginner' disabled='disabled'><b style='color:#c0c0c0'>Beginner</b></input><br/>";
	echo "<small style='color:#c0c0c0'>In the <b>Beginner</b> editing mode,<br/>";
	echo "the user is given access to<br/>";
	echo "Visual Editors, using a <acronym style='border-bottom:1px #c0c0c0 dashed' title='What You See Is What You Get'>WYSIWYG</acronym><br/>";
	echo "theme, you can add information with the <br/>";
	echo "click of the mouse! No advanced coding required!";
	echo "</td><td width='20px'/><td valign='top' class='edit'>";
	echo "<input type='radio' name='edit' id='edit' value='Advanced' checked='checked'><span style='font-weight:bold; color:#000099'>Advanced</span></input><br/>";
	echo "<small><b>Advanced</b> users do <u>not</u> have access<br/>";
	echo "the Visual Editors. These users <b>hard code</b> their<br/>";
	echo "sites from the Raw <span style='font-family:courier new, courier point 10, serif'>HTML</span>.</small>";
	
}
echo "</td></tr></table></td></tr>";
echo "<input type='hidden' name='flag' id='flag' value='1' >"; 
echo "<tr><td>Site Theme:</td>";
echo "<td>";

#Table for picking themes
# for the user to use on
# their website for their
# their own "customization"

echo "<table summary='theme' border='0'>\n";
echo "<tr><td>\n";
echo "<div align='center'>\n";
echo "<img src='Images/themes/".strtolower($theme).".jpg' alt='$theme Theme'/><br/>\n";
echo "<small>".ucfirst($theme)."</small>\n";
echo "</div>\n";
echo "</td>\n";
echo "<td width='20px'/>\n";
echo "<td>Change Theme:</td>\n";
echo "<td><select id='theme_pick' name='theme_pick' onchange='theme_pick_link()'  onLoad='theme_pick_link()'";
if ($edit=="Advanced")
	echo " disabled='disabled'";
echo ">\n";
$theme_s=array( "None",
                "Cherry",
             	  "Dolphin",
                "Grape",
                "Forest",
                "Custom");

foreach ($theme_s as $i)
{
   if (ucfirst($theme)==$i)
   	echo "<option value='$i' selected='selected'>".ucfirst($i)."</option>\n";
   else
    echo "<option value='$i'>".ucfirst($i)."</option>\n";
}
echo "</select></td><td>\n";
echo "<div id='theme_link'>\n";
echo "<a href='preview.php?theme=$theme' style='font-size:10pt;' class='under' target='_blank'>Preview</a>\n";
echo "</div>\n";
echo "</td></table></td></tr>\n";
echo "<tr><td><small><br/>*Cannot be changed</small></td></tr>\n";
echo "</table>\n";

echo "<input type='submit' value='Update Profile'/>\n";


?>
<script type='text/javascript'>
function theme_pick_link()
{
   combo_box=document.forms[0].theme_pick.selectedIndex;
   theme=document.forms[0].theme_pick.options[combo_box].value;
   //alert(theme);
   //Define the THEME_HTML variable with the correct code
   if (theme=="Custom")
    theme_html="<a href='?id=edit_css' style='font-size:10pt' class='under'>Edit CSS Theme</a>";
   else
   {
    theme_html="<a href='preview.php?theme="
    theme_html+=theme
    theme_html+="' style='font-size:10pt;' class='under' target='_blank'>Preview</a>"
   } 
   
   document.getElementById("theme_link").innerHTML=theme_html
}

theme_pick_link();
</script>
Return current item: NetLink