Subversion Repositories cheapmusic

Rev

Rev 116 | 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['signup_post_data'])) {
9
    // Get not submitted form data from session
10
    $signup_post_data = $_SESSION['signup_post_data'];
11
 
12
    // Remove post data from session
13
    unset($_SESSION['signup_post_data']);
25 - 14
}
15
 
65 - 16
if (isset($_SESSION['sessData']['field_error'])) {
17
    // Get form field error from session
18
    $fieldError = $_SESSION['sessData']['field_error'];
19
 
20
    // Remove field error data from session
21
    unset($_SESSION['field_error']['sessData']);
25 - 22
}
23
?>
24
<!DOCTYPE html>
25
<html lang="en-US">
26
<head>
27
	<!--head-->
28
	<?php include_once 'elements/head.php'; ?>
120 - 29
    <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback" nonce="<?php echo base64_encode($_SESSION["nonce"]); ?>" async defer></script>
30
    <script src="<?php echo PUBLIC_URL . "js/recaptcha.js?" . filemtime("assets/js/recaptcha.js"); ?>" async defer integrity="sha384-<?php echo base64_encode(hash_file("sha384", "assets/js/recaptcha.js", true)); ?>" crossorigin="anonymous"></script>
31
    <script src="<?php echo PUBLIC_URL . "js/policies.js?" . filemtime("assets/js/policies.js"); ?>" async defer integrity="sha384-<?php echo base64_encode(hash_file("sha384", "assets/js/policies.js", true)); ?>" crossorigin="anonymous"></script>
25 - 32
	<!--//head-->
33
</head>
34
<body>
43 - 35
<div class="main">
25 - 36
    <!--header-->
37
    <?php include_once 'elements/header.php'; ?>
38
    <!--//header-->
107 - 39
 
25 - 40
    <!--main-->
41
	<div class="main-content">
57 - 42
          <div class="wrapper-frm bg-light text-dark border shadow text-center">
43
    	    <div>
107 - 44
               <h1>Create a New Account</h1>
57 - 45
            </div>
25 - 46
            <div class="top">
65 - 47
				<?php echo !empty($statusMsg) ? '<p class="status-msg ' . $statusMsgType . '">' . $statusMsg . '</p>' : ''; ?>
25 - 48
                <form action="<?php echo BASE_URL; ?>userAccount.php" method="post">
65 - 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($signup_post_data['first_name']) ? $signup_post_data['first_name'] : ''; ?>" required="" />
65 - 51
                        <?php echo !empty($fieldError['first_name']) ? '<p>' . $fieldError['first_name'] . '</p>' : ''; ?>
25 - 52
                    </div>
65 - 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($signup_post_data['last_name']) ? $signup_post_data['last_name'] : ''; ?>" />
65 - 55
						<?php echo !empty($fieldError['last_name']) ? '<p>' . $fieldError['last_name'] . '</p>' : ''; ?>
25 - 56
                    </div>
57
                    <div class="frm-input">
116 - 58
                        <input type="text" name="zip" class="addr-in" placeholder="Zip" aria-label="Zip Code" value="<?php echo !empty($signup_post_data['zip']) ? $signup_post_data['zip'] : ''; ?>" />
25 - 59
                    </div>
65 - 60
                    <div class="frm-input <?php echo !empty($fieldError['email']) ? 'error' : ''; ?>">
116 - 61
                        <input type="email" name="email" class="email-in" placeholder="Email" aria-label="Email Address" value="<?php echo !empty($signup_post_data['email']) ? $signup_post_data['email'] : ''; ?>" required="" autocomplete="username" />
65 - 62
						<?php echo !empty($fieldError['email']) ? '<p>' . $fieldError['email'] . '</p>' : ''; ?>
25 - 63
                    </div>
65 - 64
                    <div class="frm-input <?php echo !empty($fieldError['password']) ? 'error' : ''; ?>">
116 - 65
                        <input type="password" name="password" class="pass-in" placeholder="Password" aria-label="Password" required="" autocomplete="new-password" />
65 - 66
						<?php echo !empty($fieldError['password']) ? '<p>' . $fieldError['password'] . '</p>' : ''; ?>
25 - 67
                    </div>
65 - 68
                    <div class="frm-input <?php echo !empty($fieldError['confirm_password']) ? 'error' : ''; ?>">
116 - 69
                        <input type="password" name="confirm_password" class="pass-in" placeholder="Confirm Password" aria-label="Confirm Password" required="" autocomplete="new-password" />
65 - 70
						<?php echo !empty($fieldError['confirm_password']) ? '<p>' . $fieldError['confirm_password'] . '</p>' : ''; ?>
25 - 71
                    </div>
42 - 72
                    <div class="check pb-3 pt-2">
73
                        <p id="acceptPoliciesMsg"></p>
116 - 74
                        <input type="checkbox" id="acceptPolicies" name="acceptPolicies" value="1" required="" />
42 - 75
                        <label for="acceptPolicies"><span></span>I agree to the <a href="../terms.php" target="_blank">Terms of Service</a> and I accept the <a href="../privacy.php" target="_blank">Privacy Policy</a>.</label>
41 - 76
                    </div>
77
                    <div class="pb-3">
78
                        <div class="g-recaptcha" data-sitekey="<?php echo GR_SITE_KEY; ?>" data-badge="inline" data-size="invisible" data-callback="setResponse"></div>
79
                    </div>
25 - 80
                    <div class="frm-btn">
120 - 81
                        <button id="signupBtn" class="btn btn-success" type="submit" name="signupSubmit" value="Sign Up">Sign Up</button>
82
                        <script nonce="<?php echo base64_encode($_SESSION["nonce"]) ?>">
83
                        document.addEventListener("DOMContentLoaded", function() {
84
                        	document.getElementById("signupBtn").addEventListener("click", function() {
85
                                return checkAcceptPolicies();
86
                        	});
87
                        });
88
                        </script>
25 - 89
                    </div>
90
                </form>
91
            </div>
92
            <div class="bottom">
30 - 93
                <p>Already Have an Account? <a href="<?php echo BASE_URL; ?>index.php">Login</a></p>
25 - 94
            </div>
57 - 95
          </div>
25 - 96
	</div>
97
	<!--//main-->
107 - 98
 
25 - 99
	<!--footer-->
100
	<?php include_once 'elements/footer.php'; ?>
101
	<!--//footer-->
102
</div>
103
</body>
26 - 104
</html>