<?php
$page_title = "Add Users";
$page_id = "add_users";
$page_access_levels = ":30:";
$page_profile = "New User Information";
$instructions .= "Add \"users\" to the system by inputting their info below. ";
////Header for every page that finds the include directory, connects to db, authenticates user access
include("initialize_pointer.php");
if(!include($include_root."authenticate.inc")){echo "No Authentication"; exit; };
include($include_root."Questions_into_array_class.inc");
include($include_root."questions_display.inc");
include($include_root."Questions_answers_validation_class.inc");
include($include_root."head.inc");
include($include_root."template_parser.inc");
include($include_root."add_users_class.inc");
include($include_root."questions_into_tags_function.inc");
include($include_root."page_elements_display.inc");
include($include_root."user_info_functions.inc");
include ( $include_root.'passwords_class.inc' );
//Pull appropriate questions attributes into an array (based on page, user, org, and access level) for display
//$pull_questions_display = new Questions_into_array ("add_users", $access_level, $org_id, $group_id, "display");
//Put the relevant question attributes into an array
//$q = new Load_new_entity_questions;
//$pull_questions = array ( $q->questions["first_name"], $q->questions["last_name"], $q->questions["phone_number"], $q->questions["email_address"], $q->questions["login_user"], $q->questions["password_user"]);
$pull_questions = new Load_new_entity_questions();
$pull_questions->load_new_user_questions(TRUE);
//If a form is submitted from a page with the same $page_id, process it
if ( $_POST['form_submitted'] == $page_id) {
//Put the relevant question attributes into an array
//$pull_questions = new Questions_into_array ("add_users", $access_level, $org_id, $group_id, "display");
//Validate the answers against the questions attributes pulled into an array above
$validation = new Questions_answers_validation( $pull_questions->questions, $pull_questions->question_elements, $form_answer );
if (!$question_validation_error) {
$insert_login = new Add_user ($pull_questions->questions, $validation->form_answer, $group_id, $org_id);
//If no validation errors appeared in "Add_organization", reset the form
if (!$question_validation_error) {$validation->vetted_form_answer = "";}
}
}
//Define the values for tags contained in the html template
$tag_values["{FORM_START}"] = form_start ();
$tag_values["{FORM_END}"] = form_end ("Submit New User Info", 1);
$tag_values["{PAGE TITLE}"] = page_title_table();
$tag_values["{MENU}"] = menu();
$tag_values["{HEAD}"] = head ($page_title, $head_page_specific, $head_dynamic_style);
$tag_values["{FOOTER}"] = footer();
//var_dump ($pull_questions);
questions_into_tags ($pull_questions->questions, $pull_questions->question_elements, $validation->vetted_form_answer);
template_parser ("add_groups.html", $tag_values);
//template_parser ($page_id.".html", $pull_questions_display->questions, $pull_questions_display->question_elements, $tag_values, $validation->form_answer);
?>