Location: PHPKode > projects > Homeless Mangement Information System > hmis/add_groups.php
<?php
//*Client Data System, Copyright (C) 2000, 2001 Tedd Kelleher.  This is free software, subject to the 
//*GNU GENERAL PUBLIC LICENSE, Version 2, June 1991 (in file named gpl.txt), which should accompany 
//*any distribution of this file.  Tedd Kelleher can be contacted at hide@address.com

//Used by "authenticate.inc" to check against the user session variable $access_level 
$page_access_levels = ":10:";

////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 Included"; exit; };

////Variables used to set-up the page
//Used by "head()" and "page_title_table"
$page_title = "Add ".$group_term;
//Used by many elements, including the questions in general, "menu()", and help links
$page_id = "add_groups";
//Used by "head()" to list instructions for using the page
$instructions .= "Add \"".$group_term."\" to the system by inputting their info below. ";


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."Insert_setup_group_class.inc");
include ( $include_root.'passwords_class.inc' );
include($include_root."user_info_functions.inc");
include($include_root."questions_into_tags_function.inc");
include($include_root."page_elements_display.inc");

$quest = new Load_new_entity_questions();
$quest->load_new_group_questions(TRUE);

//If a form is submitted from a page with the same $page_id, process it
if ( $_POST['form_submitted'] == $page_id ){

    //Validate the answers against the questions attributes pulled into an array above
	$validation = new Questions_answers_validation($quest->questions, $quest->question_elements, $form_answer);
	
	//If no basic errors, run the page specific insert date class
	if (!$question_validation_error)	{
		$insert_login = new Insert_setup_group ($quest->questions, $validation->vetted_value, "20" );
		//If no page-specific validation from above function, 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 ".$group_term." 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();

//Convert the page-specific database questions into HTML, and assign them to "$tag_values" 
questions_into_tags ($quest->questions, $quest->question_elements, $validation->vetted_form_answer);

//Parse the template for this page, replacing the tags with the HTML defined above.
template_parser ($page_id.".html", $tag_values);
?>
Return current item: Homeless Mangement Information System