-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathedit_profile.php
225 lines (200 loc) · 9.98 KB
/
edit_profile.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<?php
require('./inc/utilities.inc.php');
if (!$user || !$user->canEditOrg($_GET['id'])) {
header("Location: login.php");
}
require('../db.php');
require_once('./inc/header.php');
require('./inc/db_functions/org-main-queries.php');
$org_id = $_GET['id'];
$thisOrganization = getSingleOrganization($org_id);
$thisOrganizationContact = getContactInfo($org_id);
echo "<script type='text/javascript'>alert('test: " . $thisOrganization['orgName'] . ");</script>";
require('./inc/edit-profile-process.php');
?>
<script type="text/javascript" src="checkbox.js"></script>
<!-- *****************************************************************************************************************
CONTACT FORMS
***************************************************************************************************************** -->
<div class="container mtb">
<div class="row">
<div class="col-xs-0 col-lg-2"></div><!-- spacer to center form -->
<div class="col-lg-8">
<div class="row">
<h2>Edit Profile</h2>
<div class="hline"></div>
<p><?php echo $result; ?>
</div>
<form role="form" method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
<br/>
<!-- ORGANIZATION FORM INPUT -->
<div class="row">
<h4>Organization Information</h4>
<div class="hline"></div>
<div class="row">
<div class="form-group col-sm-6">
<label for="editOrganization">Organization Name*</label>
<input type="text" name="editOrganization" class="form-control" id="editOrganization" value="<?php echo $orgName; ?>">
<?php if($orgNameIsInvalid) printNameError(); ?>
</div>
<div class="form-group col-sm-6">
<label for="editPhone">Organization Phone Number*</label>
<input type="text" name="editPhone" class="form-control" id="editPhone" value="<?php echo $orgPhone; ?>">
<?php if($orgPhoneIsInvalid) printPhoneError(); ?>
</div>
</div>
<div class="row">
<div class="form-group col-xs-12">
<label for="editMission">Mission Statement*</label>
<textarea name="editMission" class="form-control" id="editMission" rows="4"
placeholder="What are the goals and values of your organization?"><?php echo $mission; ?></textarea>
<?php if($orgMissionIsInvalid) printMissionError(); ?>
</div>
</div>
<div class="row">
<div class="form-group col-sm-12">
<label for="editAddress">Address*</label>
<input type="text" name="editAddress" class="form-control" id="editAddress" value="<?php echo $address; ?>">
<?php if($orgAddressIsInvalid) printAddressError(); ?>
</div>
</div>
<div class="row">
<div class="form-group col-sm-6">
<label for="editWebsite">Website</label>
<input type="url" name="editWebsite" class="form-control" id="editWebsite" placeholder="Optional"
value="<?php if ($website) { echo $website; } ?>">
</div>
<div class="form-group col-sm-6">
<label for="editFacebook">Facebook</label>
<input type="url" name="editFacebook" class="form-control" id="editFacebook" placeholder="Optional"
value="<?php if ($facebook) { echo $facebook; } ?>">
</div>
</div>
<div class="row">
<div class="form-group col-sm-12">
<label for="editSelectService">Select area of service*</label>
<select class="form-control" id="editSelectService" name="editSelectService">
<option <?php if ($thisOrganization['service_area'] === 'Arts') { echo "selected='selected'"; } ?>>Arts</option>
<option <?php if ($thisOrganization['service_area'] === 'Seniors/Elderly') { echo "selected='selected'"; } ?>>Seniors/Elderly</option>
<option <?php if ($thisOrganization['service_area'] === 'Youth') { echo "selected='selected'"; } ?>>Youth</option>
<option <?php if ($thisOrganization['service_area'] === 'Education - Early Childhood') { echo "selected='selected'"; } ?>>Education - Early Childhood</option>
<option <?php if ($thisOrganization['service_area'] === 'Education - K-6') { echo "selected='selected'"; } ?>>Education - K-6</option>
<option <?php if ($thisOrganization['service_area'] === 'Education - 7-12') { echo "selected='selected'"; } ?>>Education - 7-12</option>
<option <?php if ($thisOrganization['service_area'] === 'Homelessness') { echo "selected='selected'"; } ?>>Homelessness</option>
<option <?php if ($thisOrganization['service_area'] === 'Immigrant/Refugee') { echo "selected='selected'"; } ?>>Immigrant/Refugee</option>
<option <?php if ($thisOrganization['service_area'] === 'Veterans') { echo "selected='selected'"; } ?>>Veterans</option>
<option <?php if ($thisOrganization['service_area'] === 'General Community') { echo "selected='selected'"; } ?>>General Community</option>
</select>
</div>
</div>
<div class="row">
<div class="form-group col-sm-12">
<label>Select organization needs</label>
<div class="checkbox">
<label>
<input type="checkbox" name="editVolunteerNeed" value="Volunteers" id="volunteers"
<?php if ($thisOrganization['volunteer_need'] == 'Y') { echo "checked"; } ?>> Volunteers
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="editBoardMemNeed" value="Board Members" id="boardMembers"
<?php if ($thisOrganization['board_mem_need'] == 'Y') { echo "checked"; } ?>> Board Members
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="editFundingNeed" value="Funding" id="funding"
<?php if ($thisOrganization['funding_need'] == 'Y') { echo "checked"; } ?>> Funding
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="editPartnershipsNeed" value="Partnerships / Collaboration" id="partnershipsCollaboration"
<?php if ($thisOrganization['partnerships_need'] == 'Y') { echo "checked"; } ?>> Partnerships / Collaboration
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="editSpaceNeed" value="Meeting Space" id="meetingSpace"
<?php if ($thisOrganization['space_need'] == 'Y') { echo "checked"; } ?>> Meeting Space
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="editOtherNeed" value="Other" id="other"
<?php if ($thisOrganization['other_need'] !== null) { echo "checked"; } ?>> Other
</label>
</div>
<div id="textbox">
<div class="form-group">
<label>
<textarea class="form-control" rows="5" name="editOtherNeedDetails" id="textArea"><?php
if ($thisOrganization['other_need'] !== null) { echo $thisOrganization['other_need']; } ?></textarea>
</label>
</div>
</div>
</div>
</div>
</div>
<!-- END ORGANIZATION FORM INPUT -->
<br/><br/>
<!-- MAIN CONTACT INPUT -->
<div class="row">
<h4>Main Contact Information</h4>
<div class="hline"></div>
<div class="row">
<div class="form-group col-sm-6 col-md-4">
<label for="editMainContact">Main Contact Name*</label>
<input type="text" name="editMainContact" class="form-control" id="editMainContact" value="<?php echo $mainContact; ?>">
<?php if($mainContactNameIsInvalid) printNameError(); ?>
</div>
<div class="form-group col-sm-6 col-md-4">
<label for="editMainContactEmail">Main Contact Email*</label>
<input type="email" name="editMainContactEmail" class="form-control" id="editMainContactEmail" value="<?php echo $mainContactEmail; ?>">
<?php if($mainContactEmailIsInvalid) printEmailError(); ?>
</div>
<div class="form-group col-sm-6 col-md-4">
<label for="editMainContactPhone">Main Contact Phone</label>
<input type="text" name="editMainContactPhone" class="form-control" id="editMainContactPhone" value="<?php echo $mainContactPhone; ?>" placeholder="Optional">
<?php if($mainContactPhoneIsInvalid) printPhoneError(); ?>
</div>
</div>
</div>
<!-- END MAIN CONTACT INPUT -->
<br/><br/>
<!-- ALTERNATIVE CONTACT INPUT -->
<div class="row">
<h4>Alternative Contact Information (Optional)</h4>
<div class="hline"></div>
<div class="row">
<div class="form-group col-sm-6 col-md-4">
<label for="editAlternativeContact">Alternative Contact Name</label>
<input type="text" name="editAlternativeContact" class="form-control" id="editAlternativeContact" placeholder="Optional"
value="<?php if ($alternativeContact) { echo $alternativeContact; } ?>">>
<?php if($alternativeContactNameIsInvalid) printNameError(); ?>
</div>
<div class="form-group col-sm-6 col-md-4">
<label for="editAlternativeContactEmail">Alternative Contact Email</label>
<input type="text" name="editAlternativeContactPhone" class="form-control" id="editAlternativeContactEmail" placeholder="Optional"
value="<?php if ($alternativeContactEmail) { echo $alternativeContactEmail; } ?>">
<?php if($alternativeContactEmailIsInvalid) printEmailError(); ?>
</div>
<div class="form-group col-sm-6 col-md-4">
<label for="editAlternativeContactPhone">Alternative Contact Phone</label>
<input type="text" name="editAlternativeContactPhone" class="form-control" id="editAlternativeContactPhone" placeholder="Optional"
value="<?php if ($alternativeContactPhone) { echo $alternativeContactPhone; } ?>">>
<?php if($alternativeContactPhoneIsInvalid) printPhoneError(); ?>
</div>
</div>
</div>
<!-- END ALTERNATIVE CONTACT INPUT -->
<br/>
<div class="col-xs-12 text-center">
<button name="submitChanges" type="submit" class="btn btn-primary">Submit Changes</button>
</div>
</form> <br />
</div><!-- /col-lg-8 -->
</div><!-- /row -->
</div><!-- /container -->
<?php require_once('./inc/footer.php');