-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-old-member-info-exec.php
78 lines (65 loc) · 2.4 KB
/
get-old-member-info-exec.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
//Run the authentication script
require_once('auth.php');
//To handle output buffer
ob_start();
//Start session
session_start();
//Include database connection details
require_once('config.php');
//Include functions
require_once('functions.php');
//Array to store validation errors
$errmsg_arr = array();
//Validation error flag
$errflag = false;
//Connect to mysql server
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {
die('Failed to connect to server: ' . mysql_error());
}
//Select database
$db = mysql_select_db(DB_DATABASE);
if(!$db) {
die("Unable to select database");
}
//Query to get all information about a member
$qry = "SELECT * FROM crew WHERE crew_id='".clean($_POST['activeOldMemberSelect'])."'";
$result = @mysql_query($qry);
if($result) {
$member = mysql_fetch_assoc($result);
//Array to store new member form data in
$member_data['fname'] = $member['firstname'];
$member_data['lname'] = $member['lastname'];
$member_data['year'] = substr($member['dob'],-10,4);
$member_data['month'] = substr($member['dob'],-5,2);
$member_data['day'] = substr($member['dob'],-2,2);
$member_data['phone'] = $member['phone'];
$member_data['nameice'] = $member['nameice'];
$member_data['ice'] = $member['ice'];
$member_data['email'] = $member['email'];
$member_data['started'] = $member['started'];
$member_data['board'] = $member['board'];
$member_data['boardrole'] = $member['boardrole'];
$member_data['assignment_in_trust'] = $member['assignmentintrust'];
$member_data['other_firedept'] = $member['otherfiredept'];
$member_data['other_education'] = $member['othereducation'];
$member_data['senior_education'] = $member['senioredusummary'];
$member_data['junior_education'] = $member['junioredusummary'];
$member_data['five_year_pin'] = $member['fiveyearpin'];
$member_data['ten_year_pin'] = $member['tenyearpin'];
$member_data['twenty_year_pin'] = $member['twentyyearpin'];
$member_data['thirty_year_pin'] = $member['thirtyyearpin'];
$member_data['special_pin'] = $member['specialpin'];
$member_data['other_award'] = $member['otheraward'];
$member_data['selected_member'] = $_POST['activeOldMemberSelect'];
//Store new member data array as Session
$_SESSION['MEMBER_DATA'] = $member_data;
session_write_close();
ob_clean();
header("location: edit-old-member.php");
exit();
} else {
die(mysql_error());
}
?>