Subversion Repositories cheapmusic

Rev

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