<?php

//classes & library refernces must be at the top before any if statements


include("dbcon.php");
error_reporting(~E_NOTICE);
if(isset($_POST["btn-sub"])){
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$password = $_POST['password'];
$lastwithdrawal = $_POST["lastwithdrawal"];
$lastdeposit = $_POST["lastdeposit"];
$profit = $_POST["profit"];

$re_password = $_POST["re_password"];

$sql = "SELECT * FROM user WHERE email='$email'";
  $res = mysqli_query($db, $sql);
  
  if(mysqli_num_rows($res) > 0){
    $emailmsg = "Sorry... email already taken"; 
  }

else if($password!==$re_password){
$errMsg ="Password not the same";
}else{
    
$sql ="INSERT INTO user (firstname,lastname,email,password,currentbalance,currentprofit,lastwithdrawal,lastdeposit,profit) 
VALUES ('$firstname','$lastname','$email','$password','$currentbalance','$currentprofit','$lastwithdrawal','$lastdeposit','$profit')";
$result = mysqli_query($db,$sql);
}
if($result){
    
    $msg ="<p class='alert alert-success'>Successsfully Registered"." <a href='login.php'>login</a></p>";
}else {
    
    $msg ="<p class='alert alert-danger'>Error While registering</p>".mysqli_error($db);
}
}

?>  



<!DOCTYPE html>
<html lang="en" class="h-100">


<!-- Mirrored from kripton.dexignzone.com/xhtml/page-register.html by HTTrack Website Copier/3.x [XR&CO'2014], Sun, 26 Mar 2023 23:01:05 GMT -->
<head>
    <meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="keywords" content="admin, dashboard" />
	<meta name="author" content="DexignZone" />
	<meta name="robots" content="index, follow" />
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="Kripton : Crypto Admin Dashboard  Bootstrap 5 Template" />
	<meta property="og:title" content="Kripton : Crypto Admin Dashboard  Bootstrap 5 Template" />
	<meta property="og:description" content="Kripton : Crypto Admin Dashboard  Bootstrap 5 Template" />
	<meta property="og:image" content="social-image.png"/>
	<meta name="format-detection" content="telephone=no">
    <title>Rgister - BtcWithdrawValue</title>
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="images/favicon.png">
	<link href="users/vendor/bootstrap-select/dist/css/bootstrap-select.min.css" rel="stylesheet">
    <link href="users/css/style.css" rel="stylesheet">

</head>

<body class="vh-100">
    <div class="authincation h-100">
        <div class="container h-100">
            <div class="row justify-content-center h-100 align-items-center">
                <div class="col-md-6">
                    <div class="authincation-content">
                        <div class="row no-gutters">
                            <div class="col-xl-12">
                                <div class="auth-form">
									<div class="text-center mb-3">
										<a href="index.html"><img src="images/logo-full.png" alt=""></a>
									</div>
                                    <h4 class="text-center mb-4">BtcWithdrawValue</h4>
                                    <form method ="POST" action="">
                                        <p style ="color:green">	<?php echo $msg;?></p>
						<p style ="color:red">	<?php echo $errMsg;?></p><br>
							<p style ="color:red">	<?php echo $emailmsg;?></p>
                                        <div class="form-group">
                                            <label class="mb-1"><strong>First Name</strong></label>
                                            <input type="text" class="form-control" name="firstname" placeholder="firstname">
                                        </div>
                                        <div class="form-group">
                                            <label class="mb-1"><strong>Last Name</strong></label>
                                            <input type="text" class="form-control" name="lastname" placeholder="lastname">
                                    </div>
                                        <div class="form-group">
                                            <label class="mb-1"><strong>Email</strong></label>
                                            <input type="email" class="form-control" name="email" placeholder="hello@example.com">
                                        </div>
                                        <div class="form-group">
                                            <label class="mb-1"><strong>Password</strong></label>
                                            <input type="password" class="form-control"  name="password" value="Password">
                                        </div>

                                        <div class="form-group">
                                            <label class="mb-1"><strong>Confirm Password</strong></label>
                                            <input type="password" class="form-control"  name="re_password" value="Password">
                                        </div>
                                        <div class="text-center mt-4">
                                            <button type="submit" name="btn-sub" class="btn btn-primary btn-block">Sign me up</button>
                                        </div>

                                        <div class="form-group">
                            	<input type="hidden" name="currentbalance" value="0" placeholder="investment" class="form-control" required/>
                            </div>

							<div class="form-group">
                            	<input type="hidden" name="currentprofit" value="0"placeholder="currentprofit" class="form-control" required/>
                            </div>

							<div class="form-group">
                            	<input type="hidden" name="lastwithdrawal" value ="0" placeholder="growth" class="form-control" required/>
                            </div>
                            
                          
                            
                            <div class="form-group">
                            	<input type="hidden" name="lastdeposit" value ="0" placeholder="growth" class="form-control" required/>
                            </div>
                            
                              <div class="form-group">
                            	<input type="hidden" name="profit" value ="0" placeholder="growth" class="form-control" required/>
                            </div>

                                    </form>
                                    <div class="new-account mt-3">
                                        <p>Already have an account? <a class="text-primary" href="login.php">Login</a></p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

<!--**********************************
	Scripts
***********************************-->
<!-- Required vendors -->
<script src="users/vendor/global/global.min.js"></script>
<script src="users/vendor/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
<script src="users/js/custom.min.js"></script>
<script src="users/js/deznav-init.js"></script>
<script src="users/js/demo.js"></script>

</body>

<!-- Mirrored from kripton.dexignzone.com/xhtml/page-register.html by HTTrack Website Copier/3.x [XR&CO'2014], Sun, 26 Mar 2023 23:01:05 GMT -->
</html>




 