echo "<H2>$alert</H2>";
	die();	
}
if(isset($_POST["authenticate_ip_ttl"])){authenticate_ip_ttl_save();exit;}
if(isset($_POST["RAD_SERVER"])){items_radius_save();exit;}
if(isset($_POST["AD_LDAP_PORT"])){items_radius_save();exit;}
if(isset($_POST["OPENLDAP_PASSWORD_ATTRIBUTE"])){items_radius_save();exit;}
if(isset($_POST["TimeSave"])){item_date_save();exit;}
if(isset($_GET["js"])){js();exit;}
if(isset($_GET["groups-list"])){group_list();exit;}
if(isset($_GET["AddGroup-js"])){AddGroup_js();exit;}
if(isset($_GET["EditGroup-popup"])){EditGroup_popup();exit;}
if(isset($_GET["EditGroup-events"])){EditGroup_events();exit;}
if(isset($_GET["EditGroup-events-search"])){EditGroup_events_search();exit;}
if(isset($_POST["GroupName"])){EditGroup_save();exit;}
if(isset($_POST["DeleteTimeRule"])){EditTimeRule_delete();exit;}
if(isset($_POST["EnableGroup"])){EditGroup_enable();exit;}
if(isset($_POST["DeleteGroup"])){EditGroup_delete();exit;}
if(isset($_GET["acl-dynamic-virtual-form"])){item_acldyn_member();exit;}
if(isset($_GET["dynamic-acls-params"])){item_acldyn_params();exit;}
if(isset($_GET["authenticate_ip_ttl_form"])){authenticate_ip_ttl_form();exit;}


if(isset($_GET["items"])){items_js();exit;}
if(isset($_GET["items-list"])){items_list();exit;}
if(isset($_GET["AddItem-tab"])){item_tab();exit;}
if(isset($_GET["AddItem-js"])){item_popup_js();exit;}
if(isset($_GET["AddItem-popup"])){item_form();exit;}
if(isset($_GET["AddItem-import"])){item_form_import();exit;}
if(isset($_POST["item-import"])){item_import();exit;}
if(isset($_POST["item-pattern"])){item_save();exit;}
    exit;
}
if (isset($_GET["AddGroup-js"])) {
    AddGroup_js();
    exit;
}
if (isset($_GET["EditGroup-popup"])) {
    EditGroup_popup();
    exit;
}
if (isset($_POST["GroupName"])) {
    EditGroup_save();
    exit;
}
if (isset($_POST["DeleteTimeRule"])) {
    EditTimeRule_delete();
    exit;
}
if (isset($_POST["EnableGroup"])) {
    EditGroup_enable();
    exit;
}
if (isset($_POST["DeleteGroup"])) {
    EditGroup_delete();
    exit;
}
if (isset($_GET["items"])) {
    items_js();
    exit;
}
if (isset($_GET["items-list"])) {
	$tpl=new templates();
	$alert=$tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}');
	echo "alert('$alert');";
	die();	
}
if(isset($_GET["timerules-list"])){timerules_list();exit;}
if(isset($_GET["EditTimeRule-js"])){EditTimeRule_js();exit;}
if(isset($_GET["EditTimeRule-popup"])){EditTimeRule_popup();exit;}
if(isset($_GET["EditTimeRule-template"])){EditTimeRule_template();exit;}



if(isset($_POST["EditTimeRule-template"])){EditTimeRule_template();exit;}
if(isset($_POST["EditTimeRule"])){EditTimeRule_save();exit;}
if(isset($_POST["EnbleTimeRule"])){EditTimeRule_enable();exit;}
if(isset($_POST["EditTimeRule-delete"])){EditTimeRule_delete();exit;}
if(isset($_POST["EditTimeTemplate"])){EditTimeRule_template_save();exit;}


if(isset($_GET["EditTimeRule-groups"])){EditTimeRule_groups();exit;}
if(isset($_GET["EditTimeRule-groups-list"])){EditTimeRule_groups_list();exit;}
if(isset($_POST["EditTimeRule-groups-add"])){EditTimeRule_groups_add();exit;}
if(isset($_POST["EditTimeRule-groups-delete"])){EditTimeRule_groups_delete();exit;}


rules();


function EditTimeRule_js(){
	$page=CurrentPageName();
	$tpl=new templates();