Subversion Repositories cheapmusic

Rev

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