Subversion Repositories cheapmusic

Rev

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