access == 2) $th = array(_("User login"), _("Full Name"), _("Phone"), _("E-mail"), _("Last Visit"), _("Access Level"), "", ""); else $th = array(_("User login"), _("Full Name"), _("Phone"), _("E-mail"), _("Last Visit"), _("Access Level"), ""); table_header($th); $k = 0; //row colour counter while ($myrow = db_fetch($result)) { alt_table_row_color($k); $last_visit_date = sql2date($myrow["last_visit_date"]); /*The security_headings array is defined in config.php */ label_cell($myrow["user_id"]); label_cell($myrow["real_name"]); label_cell($myrow["phone"]); label_cell($myrow["email"]); label_cell($last_visit_date, "nowrap"); label_cell($security_headings[$myrow["full_access"]]); edit_button_cell("Edit".$myrow["user_id"], _("Edit")); if (strcasecmp($myrow["user_id"], $_SESSION["wa_current_user"]->username) && $_SESSION["wa_current_user"]->access == 2) edit_button_cell("Delete".$myrow["user_id"], _("Delete")); else label_cell(''); end_row(); } //END WHILE LIST LOOP end_table(); end_form(); echo '
'; //------------------------------------------------------------------------------------------------- start_form(); start_table($table_style2); if ($selected_id != '') { if ($Mode == 'Edit') { //editing an existing User $myrow = get_user($selected_id); $_POST['user_id'] = $myrow["user_id"]; $_POST['real_name'] = $myrow["real_name"]; $_POST['phone'] = $myrow["phone"]; $_POST['email'] = $myrow["email"]; $_POST['Access'] = $myrow["full_access"]; $_POST['language'] = $myrow["language"]; } hidden('selected_id', $selected_id); hidden('user_id'); start_row(); label_row(_("User login:"), $_POST['user_id']); } else { //end of if $selected_id only do the else when a new record is being entered text_row(_("User Login:"), "user_id", null, 22, 20); } $_POST['password'] = ""; start_row(); label_cell(_("Password:")); label_cell(""); end_row(); if ($selected_id != '') { table_section_title(_("Enter a new password to change, leave empty to keep current.")); } text_row_ex(_("Full Name").":", 'real_name', 50); text_row_ex(_("Telephone No.:"), 'phone', 30); text_row_ex(_("Email Address:"), 'email', 50); security_headings_list_row(_("Access Level:"), 'Access', null); languages_list_row(_("Language:"), 'language', null); end_table(1); submit_add_or_update_center($selected_id == '', '', true); end_form(); end_page(); ?>