Subversion Repositories cheapmusic

Rev

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