<?php
/********************************************************/
/* NSN Your Account                                     */
/* By: NukeScripts Network (webmaster@nukescripts.fr)   */
/* http://www.nukescripts.fr                            */
/* Copyright  2000-2004 by NukeScripts Network         */
/* ==================================================== */
/* Based from:                                          */
/* NSN YAT 320 from www.nukescripts.net                 */
/* Based from:                                          */
/* PHP-NUKE: Web Portal System                          */
/********************************************************/
if (!defined('ADMIN_ALLOW') && !defined('ADMIN_MAX')) {
	die ("Access Denied");
}
global $prefix, $db, $admin_file;
$aid = substr("$aid", 0,25);
$row = $db->sql_fetchrow($db->sql_query("SELECT title, admins FROM ".TABLE_MODULES." WHERE title='Your_Account'"));
$row2 = $db->sql_fetchrow($db->sql_query("SELECT name, radminsuper FROM ".TABLE_AUTHORS." WHERE aid='$aid'"));
$admins = explode(",", $row['admins']);
$auth_user = 0;
for ($i=0; $i < sizeof($admins); $i++) {
    if ($row2['name'] == "$admins[$i]" AND $row['admins'] != "") {
        $auth_user = 1;
    }
}
if ($row2['radminsuper'] == 1 || $auth_user == 1) {

$stopwysiwyg = 1;
    $pagetitle = ": "._USERSCHAMPSEDIT;
    incoh();
    title(_USERSCHAMPSEDIT);
    amain();
    br('1');
    Max_OpenTable();
    echo "<center><b>"._EDITCHAMPS."</b></center><br />";
   $result = $db->sql_query("select * from ".TABLE_NSNYA_FIELDS." WHERE id='$xid' ");
         while ($row = $db->sql_fetchrow($result)) {
	$id= intval($row['id']);
	$titre = stripslashes(check_html($row['titre'], "nohtml"));
	$active= intval($row['active']);


echo     "<table BORDER=0 WIDTH=100% CELLPADDING=2 CELLSPACING=2>"
	."<TD bgcolor=\"$bgcolor3\"  ALIGN=LEFT width='10%'><b>$id</b></td>"
	."<form action='".$admin_file.".php' method='post'>"
	."<TD bgcolor=\"$bgcolor3\"  ALIGN=LEFT width='25%' ><input type=\"text\" name=\"xtitre\" value=\"$titre\" size=\"30\" maxlength=\"100\"></td>";

if ($active == 1 ) {
echo "<TD bgcolor=\"$bgcolor3\"  ALIGN='center' width='5%' ><a href='".$admin_file.".php?op=UsersChampsDeactive&xid=$id'><img src='modules/Your_Account/images/green_dot.gif' alt=\""._ACTIVE."\" title=\""._ACTIVE."\" border='0'></a></td>";
} else {
echo "<TD bgcolor=\"$bgcolor3\"  ALIGN='center' width='5%' ><a href='".$admin_file.".php?op=UsersChampsActive&xid=$id'><img src='modules/Your_Account/images/red_dot.gif' alt=\""._DEACTIVE."\" title=\""._NOACTIVE."\" border='0'></a></td>";
}
echo "</table>";


    }
   echo  "<input type='hidden' name='xid' value='$id'>"
	."<br /><br /><CENTER><input type='hidden' name='op' value='UsersChampsEditSave'>
       <input type='submit' value='Valider'></form></CENTER><br />";

   Max_CloseTable();
    incof();

}