Subversion Repositories cheapmusic

Rev

Rev 107 | Rev 115 | 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">
107 - 37
							<h1>Edit Account</h1> </div>
71 - 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
										<div class="custom-file frm-input">
47
											<input type="file" class="custom-file-input file-in border" id="customFile" name="picture">
48
											<label class="custom-file-label" for="customFile"><img src="assets/images/uimg.png" alt="Default User Image"> Optional user image</label>
49
										</div>
50
										<div class="frm-input <?php echo !empty($fieldError['first_name']) ? 'error' : ''; ?>">
107 - 51
											<input type="text" name="first_name" class="user-in" placeholder="First name" aria-label="First Name" value="<?php echo !empty($userData['first_name']) ? $userData['first_name'] : ''; ?>" required="">
71 - 52
											<?php echo !empty($fieldError['first_name']) ? '<p>' . $fieldError['first_name'] . '</p>' : ''; ?>
53
										</div>
54
										<div class="frm-input <?php echo !empty($fieldError['last_name']) ? 'error' : ''; ?>">
107 - 55
											<input type="text" name="last_name" class="user-in" placeholder="Last name" aria-label="Last Name" value="<?php echo !empty($userData['last_name']) ? $userData['last_name'] : ''; ?>">
71 - 56
											<?php echo !empty($fieldError['last_name']) ? '<p>' . $fieldError['last_name'] . '</p>' : ''; ?>
57
										</div>
58
										<div class="frm-input <?php echo !empty($sessData['field_error']['email']) ? 'error' : ''; ?>">
107 - 59
											<input type="email" name="email" class="email-in" placeholder="Email" aria-label="Email Address" value="<?php echo !empty($userData['email']) ? $userData['email'] : ''; ?>" required="">
71 - 60
											<?php echo !empty($fieldError['email']) ? '<p>' . $fieldError['email'] . '</p>' : ''; ?>
61
										</div>
62
										<div class="frm-input">
107 - 63
											<input type="text" name="zip" class="addr-in" placeholder="Zip" aria-label="Zip Code" value="<?php echo !empty($userData['zip']) ? $userData['zip'] : ''; ?>"> </div>
71 - 64
								</div>
65
							</div>
66
							<div class="clearfix"></div>
67
							<div class="bg-dark text-light menu-tle my-3">
107 - 68
								<h3>Layout</h3> </div>
71 - 69
							<div class="text-center m-2">
70
								<label>Color Theme:</label>
107 - 71
								<select class="form-control" id="theme" name="theme" aria-label="Select color theme">
71 - 72
									<?php
65 - 73
$themes = scandir("../css");
74
foreach ($themes as $themeLong) {
75
    $themeLong = strtolower($themeLong);
76
    if (strpos($themeLong, "theme-") === 0) {
77
        $theme = substr($themeLong, 6, strlen($themeLong) - 10);
78
        echo "<option";
79
        if (!empty($userData['theme']) && $userData['theme'] == $theme) {
80
            echo " selected";
81
        }
82
        echo ">";
83
        echo ucwords($theme);
84
        echo "</option>";
85
    }
86
}
57 - 87
?>
71 - 88
								</select>
89
								<div class="mt-3"> <span class="pr-2">Result View:</span>
90
									<div class="form-check-inline">
91
										<label class="form-check-label">
92
											<input type="radio" class="form-check-input" name="cardView" value="0" <?php echo $userData['cardView'] ? "" : "checked"; ?>>Table </label>
93
									</div>
94
									<div class="form-check-inline">
95
										<label class="form-check-label">
96
											<input type="radio" class="form-check-input" name="cardView" value="1" <?php echo $userData['cardView'] ? "checked" : ""; ?>>Cards </label>
97
									</div>
98
								</div>
99
							</div>
100
							<div class="bg-dark text-light menu-tle my-3">
107 - 101
								<h3>Search Filter Preferences</h3> </div>
71 - 102
							<div class="card-group">
103
								<div class="card m-2">
104
									<div class="card-header font-weight-bold">Condition</div>
105
									<div class="card-body ac-info">
106
										<div class="form-check">
107
											<label class="form-check-label">
108
												<input name="filterConditionNew" type="checkbox" class="form-check-input" value="New" <?php echo ($userData["conditionNew"] ? "checked" : ""); ?>>New </label>
109
										</div>
110
										<div class="form-check">
111
											<label class="form-check-label">
112
												<input name="filterConditionUsed" type="checkbox" class="form-check-input" value="Used" <?php echo ($userData["conditionUsed"] ? "checked" : ""); ?>>Used </label>
113
										</div>
114
									</div>
115
								</div>
116
								<div class="card m-2">
117
									<div class="card-header font-weight-bold">Media Type</div>
118
									<div class="card-body ac-info">
119
										<div class="form-check">
120
											<label class="form-check-label">
105 - 121
												<input name="filterMediaTypeCD" type="checkbox" class="form-check-input" value="CD" <?php echo ($userData["mediaCD"] ? "checked" : ""); ?>><i class="<?php echo $mediaTypeIconArr["CD"]; ?>"></i>
71 - 122
												<?php echo $mediaTypeTextArr["CD"]; ?>
123
											</label>
124
										</div>
125
										<div class="form-check">
126
											<label class="form-check-label">
105 - 127
												<input name="filterMediaTypeRecord" type="checkbox" class="form-check-input" value="Record" <?php echo ($userData["mediaRecord"] ? "checked" : ""); ?>><i class="<?php echo $mediaTypeIconArr["Record"]; ?>"></i>
71 - 128
												<?php echo $mediaTypeTextArr["Record"]; ?>
129
											</label>
130
										</div>
131
										<div class="form-check">
132
											<label class="form-check-label">
105 - 133
												<input name="filterMediaTypeDigital" type="checkbox" class="form-check-input" value="Digital" <?php echo ($userData["mediaDigital"] ? "checked" : ""); ?>><i class="<?php echo $mediaTypeIconArr["Digital"]; ?>"></i>
71 - 134
												<?php echo $mediaTypeTextArr["Digital"]; ?>
135
											</label>
136
										</div>
137
										<div class="form-check">
138
											<label class="form-check-label">
105 - 139
												<input name="filterMediaTypeBook" type="checkbox" class="form-check-input" value="Books" <?php echo ($userData["mediaBook"] ? "checked" : ""); ?>><i class="<?php echo $mediaTypeIconArr["Book"]; ?>"></i>
71 - 140
												<?php echo $mediaTypeTextArr["Book"]; ?>
141
											</label>
142
										</div>
143
									</div>
144
								</div>
145
							</div>
146
							<div class="clearfix"></div>
147
							<div class="bg-dark text-light menu-tle my-3">
107 - 148
								<h3>Wishlist</h3> </div>
71 - 149
							<div class="text-center m-2">
150
								<div class="mt-3"> <span class="pr-2">Email Price Checks:</span>
151
									<div class="form-check-inline">
152
										<label class="form-check-label">
153
											<input type="radio" class="form-check-input" name="wlEmail" value="1" <?php echo $userData['wlEmailFlag'] ? "checked" : ""; ?>>Yes </label>
154
									</div>
155
									<div class="form-check-inline">
156
										<label class="form-check-label">
157
											<input type="radio" class="form-check-input" name="wlEmail" value="0" <?php echo $userData['wlEmailFlag'] ? "" : "checked"; ?>>No </label>
158
									</div>
159
								</div>
160
								<div class="mt-3">
161
									<label>Email Price Check Frequency:</label>
107 - 162
									<select class="form-control" id="wlFreq" name="wlFreq" aria-label="Select wishlist email frequency">
71 - 163
										<?php
164
$cnt = 0;
165
foreach ($wlFreqArr as $wlFreq) {
166
    echo "<option value=\"" . $cnt . "\"";
167
    if (!empty($userData['wlFreq']) && $userData['wlFreq'] == $cnt) {
168
        echo " selected";
169
    }
170
    echo ">";
171
    echo $wlFreq;
172
    echo "</option>";
173
    ++$cnt;
174
}
175
?>
176
									</select>
177
								</div>
178
							</div>
179
							<div class="clearfix"></div>
180
							<div class="mt-5">
181
								<div class="frm-btn text-center">
182
									<button type="submit" class="btn btn-success" name="updateProfile" value="Update">Update</button>
183
								</div>
184
							</div>
185
						</form>
186
					</div>
187
				</div>
188
				<!--//main-->
189
				<!--footer-->
190
				<?php include_once 'elements/footer.php'; ?>
191
					<!--//footer-->
192
		</div>
193
		<script>
194
		$(".custom-file-input").on("change", function() {
195
			var fileName = $(this).val().split("\\").pop();
196
			$(this).siblings(".custom-file-label").addClass("selected").html(fileName);
197
		});
198
		</script>
199
	</body>
59 - 200
 
71 - 201
	</html>