<?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 $admin_file;
$aid = substr("$aid", 0,25);
$row = $GLOBALS['db']->sql_fetchrow($GLOBALS['db']->sql_query("SELECT `title`, `admins` FROM `".TABLE_MODULES."` WHERE title='Your_Account'"));
$row2 = $GLOBALS['db']->sql_fetchrow($GLOBALS['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) {


    $pagetitle = ": "._USERSCHAMPS;
    incoh();
    title(_USERSCHAMPS);
    amain();
    br('1');

 /*

    opentable();
 echo "<form action='admin.php' method='post'>";
 echo "<br /><b>Ajout d'un champ param�rable</b><br /> Nom du champ:<br /><input type=\"text\" name=\"titre\" value=\"$titre\" size=\"50\" maxlength=\"100\">";
 echo "<br />Description du champ:<br /><input type=\"text\" name=\"description\" value=\"$description\" size=\"50\" maxlength=\"100\">";

 echo "<br />Activer ce champ<input type='radio' name='xactive' value='1' checked>"._YES." &nbsp;";
 echo "<input type='radio' name='xactive' value='0'>"._NO."\n";


 echo "<br /><br /><CENTER><input type='hidden' name='op' value='UsersChampsSave'>
       <input type='submit' value='Valider'></form></CENTER><br />";
    Max_CloseTable();
    br('1');
 */



    Max_OpenTable();

   	// tablo
	 echo    "<TABLE BORDER=0 WIDTH=100% CELLPADDING=4 CELLSPACING=2 >"
 	."<tr>"
 	."<TD bgcolor=\"$bgcolor3\" ALIGN=LEFT width='5%'><font color='$textcolor1'> ID </font></td>"
 	."<TD bgcolor=\"$bgcolor2\" ALIGN=LEFT width='75%'><font color='$textcolor2'><b> "._TITLE." </b></font></td>"
	//."<TD bgcolor=\"$bgcolor2\" ALIGN=LEFT width='25%'><font color='$textcolor2'><b> "._DESCRIPTION." </b></font></td>"
	."<TD bgcolor=\"$bgcolor2\" ALIGN=LEFT width='10%'><font color='$textcolor2'><CENTER><b> "._ACTIVE." </b></CENTER></font></td>"
 	//."<TD bgcolor=\"$bgcolor3\" ALIGN=center width='15%'><font color='$textcolor1'> "._DATE." </font></td>"
	."<TD bgcolor=\"$bgcolor3\" ALIGN=center width='10%'><font color='$textcolor1'> "._YA_ACTION." </font></td>";

//require_once("db/sql.php");
      //   $result = $db->requete("select * from ".$prefix."_nsnchat order by date desc");
     $result = $db->sql_query("select * from `".TABLE_NSNYA_FIELDS."` order by `id`");
         while ($row = $db->sql_fetchrow($result)) {
	$id= intval($row['id']);
	//$pseudo = stripslashes(check_html($row['pseudo'], "nohtml"));
	$titre = stripslashes(check_html($row['titre'], "nohtml"));
	//$description = stripslashes(check_html($row['description'], "nohtml"));
	$active= intval($row['active']);
	/*$date = $row['date'];
    $year = substr($date,0,4);
    $month = substr($date,5,2);
    $day = substr($date,8,2);
    $hour = substr($date,11,2);
    $minute = substr($date,14,2);
    $second = substr($date,17,2);
$date = date("d-m-Y �H:i:s",mktime ($hour,$minute,$second,$month,$day,$year));
 */

echo "<table BORDER=0 WIDTH=100% CELLPADDING=2 CELLSPACING=2>";


echo "<TD bgcolor=\"$bgcolor3\"  ALIGN=LEFT width='5%'><b>$id</b></td>";

echo "<TD bgcolor=\"$bgcolor3\"  ALIGN=LEFT width='75%' ><a href='".$admin_file.".php?op=UsersChampsEdit&xid=$id'>$titre</a></td>";




//echo "<TD bgcolor=\"$bgcolor3\"  ALIGN=LEFT width='25%' > &nbsp;$description</a></td>";


if ($active == 1 ) {
echo "<TD bgcolor=\"$bgcolor3\"  ALIGN='center' width='10%' ><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='10%' ><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 "<TD bgcolor=\"$bgcolor3\"  ALIGN=center width='15%'>$date</td>"
 ECHO "<TD bgcolor=\"$bgcolor3\"  ALIGN=center width='10%'><a href='".$admin_file.".php?op=UsersChampsEdit&xid=$id'><img src='modules/Your_Account/images/edit.png' alt=\""._EDIT."\" title=\""._EDIT."\" border='0'></A></td>";

  //ECHO "&nbsp; <a href='admin.php?op=UsersChampsDel&xid=$id'><img src='modules/Your_Account/images/delete2.png' alt=\""._DELETE."\" title=\""._DELETE."\" border='0'></A></td>"
ECHO "</table>";


    }

   Max_CloseTable();
    incof();

}