Subversion Repositories cheapmusic

Rev

Rev 66 | Rev 105 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
25 - 1
<?php
31 - 2
// Include Session Handling
65 - 3
require_once ('includes/session.php');
66 - 4
global $mediaTypeTextArr;
5
global $mediaTypeIconArr;
31 - 6
 
25 - 7
// Include config & login validate file
8
require_once 'includes/validateUser.php';
9
 
65 - 10
if (isset($_SESSION['sessData']['field_error'])) {
11
    // Get form field error from session
12
    $fieldError = $_SESSION['sessData']['field_error'];
57 - 13
 
65 - 14
    // Remove field error data from session
15
    unset($_SESSION['field_error']['sessData']);
25 - 16
}
17
 
18
?>
71 - 19
	<!DOCTYPE html>
20
	<html lang="en-US">
57 - 21
 
71 - 22
	<head>
23
		<!--head-->
24
		<?php include_once 'elements/head.php'; ?>
25
			<!--//head-->
26
	</head>
57 - 27
 
71 - 28
	<body>
29
		<div class="main">
30
			<!--header-->
31
			<?php include_once 'elements/header.php'; ?>
32
				<!--//header-->
33
				<!--main-->
34
				<div class="main-content">
35
					<div class="wrapper-frm bg-light text-dark border shadow">
36
						<div class="head-menu bg-primary menu-tle">
37
							<h2>Edit Account</h2> </div>
38
						<form action="<?php echo BASE_URL; ?>userAccount.php" method="post" enctype="multipart/form-data">
39
							<div class="ucontent">
40
								<div class="left-pnl"> <img class="img-fluid upicture" src="<?php echo $userPicture; ?>" alt="<?php echo $userName; ?>">
41
									<h2><?php echo $userName; ?></h2> </div>
42
								<div class="right-pnl">
43
									<?php echo !empty($statusMsg) ? '<p class="status-msg ' . $statusMsgType . '">' . $statusMsg . '</p>' : ''; ?>
44
										<input type="hidden" name="sessionTab" value="<?php if (isset($_POST['sessionTab'])) echo $_POST['sessionTab']; ?>">
45
										<input type="hidden" name="searchTerm" value="<?php if (isset($_POST['searchTerm'])) echo $_POST['searchTerm']; ?>">
46
										<input type="hidden" name="buyerZip" value="<?php if (isset($_POST['buyerZip'])) echo $_POST['buyerZip']; ?>">
47
										<div class="custom-file frm-input">
48
											<input type="file" class="custom-file-input file-in border" id="customFile" name="picture">
49
											<label class="custom-file-label" for="customFile"><img src="assets/images/uimg.png" alt="Default User Image"> Optional user image</label>
50
										</div>
51
										<div class="frm-input <?php echo !empty($fieldError['first_name']) ? 'error' : ''; ?>">
52
											<input type="text" name="first_name" class="user-in" placeholder="First name" value="<?php echo !empty($userData['first_name']) ? $userData['first_name'] : ''; ?>" required="">
53
											<?php echo !empty($fieldError['first_name']) ? '<p>' . $fieldError['first_name'] . '</p>' : ''; ?>
54
										</div>
55
										<div class="frm-input <?php echo !empty($fieldError['last_name']) ? 'error' : ''; ?>">
56
											<input type="text" name="last_name" class="user-in" placeholder="Last name" value="<?php echo !empty($userData['last_name']) ? $userData['last_name'] : ''; ?>">
57
											<?php echo !empty($fieldError['last_name']) ? '<p>' . $fieldError['last_name'] . '</p>' : ''; ?>
58
										</div>
59
										<div class="frm-input <?php echo !empty($sessData['field_error']['email']) ? 'error' : ''; ?>">
60
											<input type="email" name="email" class="email-in" placeholder="Email" value="<?php echo !empty($userData['email']) ? $userData['email'] : ''; ?>" required="">
61
											<?php echo !empty($fieldError['email']) ? '<p>' . $fieldError['email'] . '</p>' : ''; ?>
62
										</div>
63
										<div class="frm-input">
64
											<input type="text" name="zip" class="addr-in" placeholder="Zip" value="<?php echo !empty($userData['zip']) ? $userData['zip'] : ''; ?>"> </div>
65
								</div>
66
							</div>
67
							<div class="clearfix"></div>
68
							<div class="bg-dark text-light menu-tle my-3">
69
								<h5>Layout</h5> </div>
70
							<div class="text-center m-2">
71
								<label>Color Theme:</label>
72
								<select class="form-control" id="theme" name="theme">
73
									<?php
65 - 74
$themes = scandir("../css");
75
foreach ($themes as $themeLong) {
76
    $themeLong = strtolower($themeLong);
77
    if (strpos($themeLong, "theme-") === 0) {
78
        $theme = substr($themeLong, 6, strlen($themeLong) - 10);
79
        echo "<option";
80
        if (!empty($userData['theme']) && $userData['theme'] == $theme) {
81
            echo " selected";
82
        }
83
        echo ">";
84
        echo ucwords($theme);
85
        echo "</option>";
86
    }
87
}
57 - 88
?>
71 - 89
								</select>
90
								<div class="mt-3"> <span class="pr-2">Result View:</span>
91
									<div class="form-check-inline">
92
										<label class="form-check-label">
93
											<input type="radio" class="form-check-input" name="cardView" value="0" <?php echo $userData['cardView'] ? "" : "checked"; ?>>Table </label>
94
									</div>
95
									<div class="form-check-inline">
96
										<label class="form-check-label">
97
											<input type="radio" class="form-check-input" name="cardView" value="1" <?php echo $userData['cardView'] ? "checked" : ""; ?>>Cards </label>
98
									</div>
99
								</div>
100
							</div>
101
							<div class="bg-dark text-light menu-tle my-3">
102
								<h5>Search Filter Preferences</h5> </div>
103
							<div class="card-group">
104
								<div class="card m-2">
105
									<div class="card-header font-weight-bold">Condition</div>
106
									<div class="card-body ac-info">
107
										<div class="form-check">
108
											<label class="form-check-label">
109
												<input name="filterConditionNew" type="checkbox" class="form-check-input" value="New" <?php echo ($userData["conditionNew"] ? "checked" : ""); ?>>New </label>
110
										</div>
111
										<div class="form-check">
112
											<label class="form-check-label">
113
												<input name="filterConditionUsed" type="checkbox" class="form-check-input" value="Used" <?php echo ($userData["conditionUsed"] ? "checked" : ""); ?>>Used </label>
114
										</div>
115
									</div>
116
								</div>
117
								<div class="card m-2">
118
									<div class="card-header font-weight-bold">Media Type</div>
119
									<div class="card-body ac-info">
120
										<div class="form-check">
121
											<label class="form-check-label">
122
												<input name="filterMediaTypeCD" type="checkbox" class="form-check-input" value="CD" <?php echo ($userData["mediaCD"] ? "checked" : ""); ?>><i class="<?php echo $mediaTypeIconArr[" CD "]; ?>"></i>
123
												<?php echo $mediaTypeTextArr["CD"]; ?>
124
											</label>
125
										</div>
126
										<div class="form-check">
127
											<label class="form-check-label">
128
												<input name="filterMediaTypeRecord" type="checkbox" class="form-check-input" value="Record" <?php echo ($userData["mediaRecord"] ? "checked" : ""); ?>><i class="<?php echo $mediaTypeIconArr[" Record "]; ?>"></i>
129
												<?php echo $mediaTypeTextArr["Record"]; ?>
130
											</label>
131
										</div>
132
										<div class="form-check">
133
											<label class="form-check-label">
134
												<input name="filterMediaTypeDigital" type="checkbox" class="form-check-input" value="Digital" <?php echo ($userData["mediaDigital"] ? "checked" : ""); ?>><i class="<?php echo $mediaTypeIconArr[" Digital "]; ?>"></i>
135
												<?php echo $mediaTypeTextArr["Digital"]; ?>
136
											</label>
137
										</div>
138
										<div class="form-check">
139
											<label class="form-check-label">
140
												<input name="filterMediaTypeBook" type="checkbox" class="form-check-input" value="Books" <?php echo ($userData["mediaBook"] ? "checked" : ""); ?>><i class="<?php echo $mediaTypeIconArr[" Book "]; ?>"></i>
141
												<?php echo $mediaTypeTextArr["Book"]; ?>
142
											</label>
143
										</div>
144
									</div>
145
								</div>
146
							</div>
147
							<div class="clearfix"></div>
148
							<div class="bg-dark text-light menu-tle my-3">
149
								<h5>Wishlist</h5> </div>
150
							<div class="text-center m-2">
151
								<div class="mt-3"> <span class="pr-2">Email Price Checks:</span>
152
									<div class="form-check-inline">
153
										<label class="form-check-label">
154
											<input type="radio" class="form-check-input" name="wlEmail" value="1" <?php echo $userData['wlEmailFlag'] ? "checked" : ""; ?>>Yes </label>
155
									</div>
156
									<div class="form-check-inline">
157
										<label class="form-check-label">
158
											<input type="radio" class="form-check-input" name="wlEmail" value="0" <?php echo $userData['wlEmailFlag'] ? "" : "checked"; ?>>No </label>
159
									</div>
160
								</div>
161
								<div class="mt-3">
162
									<label>Email Price Check Frequency:</label>
163
									<select class="form-control" id="wlFreq" name="wlFreq">
164
										<?php
165
$cnt = 0;
166
foreach ($wlFreqArr as $wlFreq) {
167
    echo "<option value=\"" . $cnt . "\"";
168
    if (!empty($userData['wlFreq']) && $userData['wlFreq'] == $cnt) {
169
        echo " selected";
170
    }
171
    echo ">";
172
    echo $wlFreq;
173
    echo "</option>";
174
    ++$cnt;
175
}
176
?>
177
									</select>
178
								</div>
179
							</div>
180
							<div class="clearfix"></div>
181
							<div class="mt-5">
182
								<div class="frm-btn text-center">
183
									<button type="submit" class="btn btn-success" name="updateProfile" value="Update">Update</button>
184
								</div>
185
							</div>
186
						</form>
187
					</div>
188
				</div>
189
				<!--//main-->
190
				<!--footer-->
191
				<?php include_once 'elements/footer.php'; ?>
192
					<!--//footer-->
193
		</div>
194
		<script>
195
		$(".custom-file-input").on("change", function() {
196
			var fileName = $(this).val().split("\\").pop();
197
			$(this).siblings(".custom-file-label").addClass("selected").html(fileName);
198
		});
199
		</script>
200
	</body>
59 - 201
 
71 - 202
	</html>