Subversion Repositories cheapmusic

Rev

Rev 124 | 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'; ?>
122 - 23
		<!--//head-->
71 - 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">
124 - 34
						<div class="head-menu bg-primary menu-tle header">
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']; ?>" />
122 - 44
										<input type="hidden" name="nonce" value="<?php if (isset($_SESSION['nonce'])) echo $_SESSION['nonce']; ?>" />
71 - 45
										<div class="custom-file frm-input">
116 - 46
											<input type="file" class="custom-file-input file-in border" id="customFile" name="picture" />
139 - 47
											<label class="custom-file-label" for="customFile"><img src='data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24" viewBox="0 0 24 24" width="24"><rect fill="none" height="24" width="24"/><path d="M3,4V1h2v3h3v2H5v3H3V6H0V4H3z M6,10V7h3V4h7l1.83,2H21c1.1,0,2,0.9,2,2v12c0,1.1-0.9,2-2,2H5c-1.1,0-2-0.9-2-2V10H6z M13,19c2.76,0,5-2.24,5-5s-2.24-5-5-5s-5,2.24-5,5S10.24,19,13,19z M9.8,14c0,1.77,1.43,3.2,3.2,3.2s3.2-1.43,3.2-3.2 s-1.43-3.2-3.2-3.2S9.8,12.23,9.8,14z"/></svg>' alt="Default User Image" /> Optional user image</label>										</div>
71 - 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
											</label>
121
										</div>
122
										<div class="form-check">
123
											<label class="form-check-label">
116 - 124
												<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 - 125
											</label>
126
										</div>
127
										<div class="form-check">
128
											<label class="form-check-label">
116 - 129
												<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 - 130
											</label>
131
										</div>
132
										<div class="form-check">
133
											<label class="form-check-label">
116 - 134
												<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 - 135
											</label>
136
										</div>
137
									</div>
138
								</div>
139
							</div>
140
							<div class="clearfix"></div>
141
							<div class="bg-dark text-light menu-tle my-3">
107 - 142
								<h3>Wishlist</h3> </div>
71 - 143
							<div class="text-center m-2">
144
								<div class="mt-3"> <span class="pr-2">Email Price Checks:</span>
145
									<div class="form-check-inline">
146
										<label class="form-check-label">
116 - 147
											<input type="radio" class="form-check-input" name="wlEmail" value="1" <?php echo $userData['wlEmailFlag'] ? "checked" : ""; ?> />Yes </label>
71 - 148
									</div>
149
									<div class="form-check-inline">
150
										<label class="form-check-label">
116 - 151
											<input type="radio" class="form-check-input" name="wlEmail" value="0" <?php echo $userData['wlEmailFlag'] ? "" : "checked"; ?> />No </label>
71 - 152
									</div>
153
								</div>
154
								<div class="mt-3">
155
									<label>Email Price Check Frequency:</label>
107 - 156
									<select class="form-control" id="wlFreq" name="wlFreq" aria-label="Select wishlist email frequency">
71 - 157
										<?php
158
$cnt = 0;
159
foreach ($wlFreqArr as $wlFreq) {
160
    echo "<option value=\"" . $cnt . "\"";
161
    if (!empty($userData['wlFreq']) && $userData['wlFreq'] == $cnt) {
162
        echo " selected";
163
    }
164
    echo ">";
165
    echo $wlFreq;
166
    echo "</option>";
167
    ++$cnt;
168
}
169
?>
170
									</select>
171
								</div>
172
							</div>
173
							<div class="clearfix"></div>
174
							<div class="mt-5">
175
								<div class="frm-btn text-center">
176
									<button type="submit" class="btn btn-success" name="updateProfile" value="Update">Update</button>
177
								</div>
178
							</div>
179
						</form>
180
					</div>
181
				</div>
182
				<!--//main-->
183
				<!--footer-->
184
				<?php include_once 'elements/footer.php'; ?>
185
					<!--//footer-->
186
		</div>
119 - 187
		<script nonce="<?php echo base64_encode($_SESSION["nonce"]); ?>">
71 - 188
		$(".custom-file-input").on("change", function() {
189
			var fileName = $(this).val().split("\\").pop();
190
			$(this).siblings(".custom-file-label").addClass("selected").html(fileName);
191
		});
192
		</script>
193
	</body>
59 - 194
 
71 - 195
	</html>