<?php
$admin = 2;
$file = __FILE__;
include_once ("../inc/inc_connect.php");

if ($action =="go")
{
    $query = "UPDATE $admintable SET strShowQuotes = '$Showquotes', strLinkRandomQuotes = '$Linkrandomquotes', strTimerMorning = '$Timermorning', strTimerAfternoon = '$Timernoon', strTimerEvening = '$Timerevening', strAllowAvatarUpload = '$Allowavatarupload'";
    mysql_query( $query, $link ) or die ( "Error! : ".mysql_error() );

    $query = "UPDATE $userstable SET strProfile1 = '$Profile1', strProfile2 = '$Profile2', strProfile3 = '$Profile3', strProfile4 = '$Profile4'";
    mysql_query( $query, $link ) or die ( "Error! : ".mysql_error() );
}

include ("../inc/inc_common.php");
include ("../inc/inc_admincheck.php");
include ("../inc/inc_getdate.php");
include ("../inc/inc_forumname.php");
$page = "Admin - Customise Profiles";
$pagelink = $file;
include("../inc/inc_setonline.php");
$title = "$name1 Admin - $gfcookie[1] - Customise Profiles";
include ("../inc/inc_head.php");
include ("../inc/inc_body.php");
$title = "Customise Profiles";
include ("../inc/inc_title.php");

if ($showquotes == 1)
{
    $Showquotesch = "Checked";
}
if ($linkrandomquotes == 1)
{
    $Linkrandomquotesch = "Checked";
}
if ($allowavatarupload == 1)
{
    $Allowavataruploadch = "Checked";
}

$result=mysql_query("SELECT * FROM $userstable LIMIT 0,1");
$num_rows = mysql_num_rows( $result );
while ( $a_row = mysql_fetch_object( $result ) )
{
    $profile1 = $a_row->strProfile1;
    $profile2 = $a_row->strProfile2;
    $profile3 = $a_row->strProfile3;
    $profile4 = $a_row->strProfile4;
}


$result=mysql_query("SELECT * FROM $admintable LIMIT 0, 1");
$num_rows = mysql_num_rows( $result );
while ( $a_row = mysql_fetch_object( $result ) )
{
    print "<table border=1 cellpadding=5 cellspacing=0 style=\"border-collapse: collapse\" bordercolor=\"$bordercolor\" style=\"font-family: $font; font-size: $fontpoint\" bgcolor=\"$fgcolour\"><tr><td width=\"100%\" align=\"center\">

    <form method=\"post\" action=\"admin_cus_profile.php?action=go\"><br>

    <table border=0 cellpadding=3 cellspacing=0 width=100% style=\"font-family: $font; font-size: $fontpoint\">

    <tr><td align=\"center\">
    Show Random Quotes</td><td align=\"center\"><input type=\"checkbox\" $Showquotesch name=\"Showquotes\" value=\"1\"></td></tr>

    <tr><td align=\"center\">
    Link Random Quotes To Post</td><td align=\"center\"><input type=\"checkbox\" $Linkrandomquotesch name=\"Linkrandomquotes\" value=\"1\"></td></tr>

    <tr><td align=\"center\">
    Allow Avatar Upload</td><td align=\"center\"><input type=\"checkbox\" $Allowavataruploadch name=\"Allowavatarupload\" value=\"1\"></td></tr>

    <tr><td width=\"50%\" align=\"center\">
    Custom Profile Question 1</td><td align=\"center\"><input type=\"text\" onfocus=\"document.onkeypress=function(){};\" name=\"Profile1\" value=\"$profile1\" style=\"color: #FFFFFF; background-image: url('../images/textbox_background_red.gif')\"></td></tr>

    <tr><td width=\"50%\" align=\"center\">
    Custom Profile Question 2</td><td align=\"center\"><input type=\"text\" onfocus=\"document.onkeypress=function(){};\" name=\"Profile2\" value=\"$profile2\" style=\"color: #FFFFFF; background-image: url('../images/textbox_background_red.gif')\"></td></tr>

    <tr><td width=\"50%\" align=\"center\">
    Custom Profile Question 3</td><td align=\"center\"><input type=\"text\" onfocus=\"document.onkeypress=function(){};\" name=\"Profile3\" value=\"$profile3\" style=\"color: #FFFFFF; background-image: url('../images/textbox_background_red.gif')\"></td></tr>

    <tr><td width=\"50%\" align=\"center\">
    Custom Profile Question 4</td><td align=\"center\"><input type=\"text\" onfocus=\"document.onkeypress=function(){};\" name=\"Profile4\" value=\"$profile4\" style=\"color: #FFFFFF; background-image: url('../images/textbox_background_red.gif')\"></td></tr>

    <tr><td width=\"50%\" align=\"center\">
    Description Of Morning Posters</td><td align=\"center\"><input type=\"text\" onfocus=\"document.onkeypress=function(){};\" name=\"Timermorning\" value=\"$a_row->strTimerMorning\" style=\"color: #FFFFFF; background-image: url('../images/textbox_background_red.gif')\"></td></tr>

    <tr><td width=\"50%\" align=\"center\">
    Description Of Afternoon Posters</td><td align=\"center\"><input type=\"text\" onfocus=\"document.onkeypress=function(){};\" name=\"Timernoon\" value=\"$a_row->strTimerAfternoon\" style=\"color: #FFFFFF; background-image: url('../images/textbox_background_red.gif')\"></td></tr>

    <tr><td width=\"50%\" align=\"center\">
    Description Of Evening Posters</td><td align=\"center\"><input type=\"text\" onfocus=\"document.onkeypress=function(){};\" name=\"Timerevening\" value=\"$a_row->strTimerEvening\" style=\"color: #FFFFFF; background-image: url('../images/textbox_background_red.gif')\"></td></tr>


    </table><br><br><input type=\"submit\" value=\"Set This Value\"></form></td></tr></table><br><br><a href=\"admin_customise.php\"><font size=2>Back to the Main Customise Page</a>";

}

include ("../inc/inc_footer.php");