'; /******************************************************/ // Add user /******************************************************/ if ( isset ($_POST["ADD"]) ) { $cn=new Database(); $pass5=md5($_POST['PASS']); $new_user=new User($cn,0); $new_user->first_name=HtmlInput::default_value_post('FNAME',''); $new_user->last_name=HtmlInput::default_value_post('LNAME',''); $login=HtmlInput::default_value_post('LOGIN',''); $login=str_replace("'","",$login); $login=str_replace('"',"",$login); $login=str_replace(" ","",$login); $login=strtolower($login); $new_user->login=$login; $new_user->pass=$pass5; $new_user->email=HtmlInput::default_value_post('EMAIL',''); if ( trim($login)=="") { alert(_("Le login ne peut pas être vide")); } else { $new_user->insert(); $new_user->load(); $_REQUEST['use_id']=$new_user->id; require_once NOALYSS_INCLUDE.'/user_detail.inc.php'; return; } } //SET login // View user detail if ( isset($_REQUEST['det'])) { require_once NOALYSS_INCLUDE.'/user_detail.inc.php'; return; } ?> '; echo HtmlInput::button_action(_("Ajout utilisateur"), "$('create_user').show();","cu"); echo '

'; // Show all the existing user on 7 columns $repo=new Dossier(0); /******************************************************/ // Detail of a user /******************************************************/ $compteur=0; $header=new Sort_Table(); $url=basename($_SERVER['PHP_SELF'])."?action=".$_REQUEST['action']; $header->add(_("Login"), $url," order by use_login asc", "order by use_login desc","la", "ld"); $header->add(_("Nom"), $url," order by use_name asc,use_first_name asc", "order by use_name desc,use_first_name desc","na", "nd"); $header->add(_('Dossier'),$url,' order by ag_dossier asc','order by ag_dossier desc', 'da','dd'); $header->add(_("Actif"), $url," order by use_active asc", "order by use_active desc","aa", "ad"); $ord=(isset($_REQUEST['ord']))?$_REQUEST['ord']:'la'; $sql=$header->get_sql_order($ord); $a_user=$repo->get_user_folder($sql); if ( !empty ($a_user) ) { echo ''; echo _('Filtre').HtmlInput::infobulle(22); echo HtmlInput::filter_table("user", "0,1,2,5","1"); echo ''; echo ''; echo ''; echo ''; echo ''; echo th(_("Prénom")); echo ''; echo ""; echo ''; echo ''; foreach ( $a_user as $r_user) { $compteur++; $class=($compteur%2==0)?"odd":"even"; echo ""; if ( $r_user['use_active'] == 0 ) { $Active=$g_failed; } else { $Active=$g_succeed; } $det_url=$url."&det&use_id=".$r_user['use_id']; echo ""; echo td($r_user['use_name']); echo td($r_user['use_first_name']); echo td($Active); $type=($r_user['use_admin']==1)?_("Administrateur"):_("Utilisateur"); echo ""; echo td($r_user['ag_dossier']); echo ''; }// foreach echo '
'.$header->get_header(0).''.$header->get_header(1).''.$header->get_header(3).'"._('Type')."'.$header->get_header(2).'
"; echo HtmlInput::anchor($r_user['use_login'],$det_url); echo "".$type."
'; } // $cn != null ?>