-
Notifications
You must be signed in to change notification settings - Fork 0
/
member_contact_to_edit.php
44 lines (35 loc) · 1.37 KB
/
member_contact_to_edit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
include_once("includes/inc.global.php");
$p->site_section = SITE_SECTION_OFFER_LIST;
$cUser->MustBeLevel(1);
include("includes/inc.forms.php");
$form->addElement("header", null, "Choose Joint Member to Edit");
$form->addElement("html", "<TR></TR>");
$sel =& $form->addElement("hierselect", "member", "Choose Member and Person");
$items = new cMemberGroupMenu;
$items->LoadMemberGroup();
$items->MakeMenuArrays();
$sel->setMainOptions($items->id);
$sel->setSecOptions($items->name);
$form->addElement("static", null, null, null);
$buttons[] = &HTML_QuickForm::createElement('submit', 'btnEdit', 'Edit');
$buttons[] = &HTML_QuickForm::createElement('submit', 'btnDelete', 'Delete');
$form->addGroup($buttons, null, null, ' ');
if ($form->validate()) { // Form is validated so processes the data
$form->freeze();
$form->process("process_data", false);
} else { // Display the form
$p->DisplayPage($form->toHtml());
}
function process_data ($values) {
global $p, $items;
$member = $values["member"];
if(isset($values["btnDelete"])) {
header("location:http://".HTTP_BASE."/member_contact_delete.php?mode=admin&person_id=". $items->person_id[$member[0]][$member[1]]);
exit;
} else {
header("location:http://".HTTP_BASE."/member_contact_edit.php?mode=admin&member_id=".$items->id[$member[0]] ."&person_id=". $items->person_id[$member[0]][$member[1]]);
exit;
}
}
?>