<?php
session_start();
require_once('includes/init.php');

$reg_success = false;
$errors = array();

if(isset($_POST['reg_user']))
{
    $reg_name = compactify($conn, $_POST['name']);
    $reg_mobile = compactify($conn, $_POST['mobile']);
    $reg_password_1 = $_POST['password_1'];
    $reg_password_2 = $_POST['password_2'];
    $reg_ref = compactify($conn, $_POST['ref']);
    $reg_did = compactify($conn, $_POST['did']);
    
    $errors = array();
    
    # CHECK IF REGISTRATION AVAILABLE
    
    if (!$registration) {
        array_push($errors, "Registration Closed");
    }
    
    # CHECK DEVICE ID
    
    if (empty($reg_did)) {
        array_push($errors, "Unsupported device");
    }
    
    # CHECK IF DEVICE IS ALREADY REGISTERED
    
    $sql_check_did = "SELECT id FROM users WHERE did = '$reg_did'";
    $scd_result = mysqli_query($conn, $sql_check_did);
    if (mysqli_num_rows($scd_result) > 0) {
        array_push($errors, "Device already registered");
    }
    
    # CHECK IF MOBILE IS EMPTY
    
    if (empty($reg_mobile)) {
        array_push($errors, "Mobile is required");
    }
    
    # CHECK IF MOBILE IS VALID
    
    if (strlen($reg_mobile) <=>11) {
        array_push($errors, "Invalid Mobile");
    }
    
    # CHECK IF PASSWORD IS VALID
    
    if (strlen($reg_password_1) < 4) {
        array_push($errors, "Minimum Four Digit Password");
    }
    
    # CHECK IF USER EXIST
    
    $sql_check_user = "SELECT id FROM users WHERE mobile = '$reg_mobile'";
    $scu_result = mysqli_query($conn, $sql_check_user);
    if (mysqli_num_rows($scu_result) > 0) {
        array_push($errors, "User already exists");
    }
    
    # VALIDATE DATA
    
    if (empty($reg_name)) {
        array_push($errors, "Name is required");
    }
    
    if (empty($reg_password_1)) {
        array_push($errors, "Password is required");
    }
    
    if (empty($reg_ref)) {
        array_push($errors, "Refer Code is required");
    }
    
    # CHECK IF PASSWORDS ARE SAME
    
    if ($reg_password_1 !== $reg_password_2) {
        array_push($errors, "Passwords are not same");
    }
    
    # CHECK IF REFER CODE IS VALID
    
    if (!empty($reg_ref)) {
        $sql_check_ref = "SELECT id FROM users WHERE mobile=$reg_ref";
        $scr_result = mysqli_query($conn, $sql_check_ref);
        if (mysqli_num_rows($scr_result) == 0) {
            array_push($errors, "Invalid refer code");
        }
    }
    
    
    $errors = array_slice($errors, 0, 1);
    
    # ENCRYPT PASSWORD
    
    $password = md5($reg_password_1);
    
if (count($errors) == 0) {
     
            header('location: index.php?' . http_build_query($_GET));

        }
    
    
    $errors = array_slice($errors, 0, 2);

  if (count($errors) == 0) {

    $token = sha1($reg_mobile);
    $uniqid = uniqid();
    $sql = "INSERT INTO users (fname, mobile, password, ref, did, token, task_time, task_time1, task_time2, task_time3, task_time4, balance, api_task)
            VALUES ('$reg_name', '$reg_mobile', '$password', '$reg_ref', '$reg_did', '$token', NOW() - INTERVAL 720 MINUTE, NOW() - INTERVAL 720 MINUTE, NOW() - INTERVAL 720 MINUTE, NOW() - INTERVAL 720 MINUTE, NOW() - INTERVAL 720 MINUTE,'$signup_bonus', '$uniqid')";
    if ($conn->query($sql) === TRUE) {
      $sql = "UPDATE users SET t_ref = t_ref + 1 , balance = balance + $refer_points WHERE users.mobile = '$reg_ref'";
      mysqli_query($conn,"UPDATE users SET balance = balance + $signup_bonus_referer WHERE users.mobile = '$reg_ref'");
        if ($conn->query($sql) === TRUE) {
            $reg_success = true;
            
        } else {
            echo "Error: " . $sql . "<br>" . $conn->error;
        }
    } else {
        echo "Error: " . $sql . "<br>" . $conn->error;
        array_push($errors, "Registration failed");
    }
  }


}


$string = file_get_contents("../This_is_Admin_/app-data.json");
$json_a = json_decode($string, true);

mysqli_close($conn);

?>
<!DOCTYPE html>
<html>
<head>
    <title>Sign Up</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=false">
    <link rel="stylesheet" href="css/style.css">
    <link defer rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
 <link href="https://fonts.googleapis.com/css?family=Nunito:600,700,900" rel="stylesheet">
    <style>
        <?php include 'css/custom-style.php' ?>
        #body {
  font-family: 'Nunito';
background-color:  #5d8fc9;
}
#login-card{
    width:350px;
    border-radius: 25px;
    margin:150px auto;
  
}

#email{
    border-radius:50px;
    background-color: #ebf0fc;
    border-color: #ebf0fc;
    color: #9da3b0;
    width: 70%;
}

#button{
    border-radius:30px;
    width: 60%;
    color:white;

}

#btn{
   position: absolute; 
   bottom: -35px; 
   padding: 5px;
   margin: 0px 55px;
   align-items: center;
   border-radius: 5px;
}
#container{
    margin-top:25px;
}

.btn-circle.btn-sm { 
            width: 40px; 
            height: 40px; 
            padding: 2px 0px; 
            border-radius: 25px; 
            font-size: 14px; 
            text-align: center;
            
            margin: 8px;
        }
.logoicon{
    position: absolute; 
   top: -50px; 
   margin: 0;
   align-items: center;
   display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}    
.logoicon img{
   margin: 0;
   align-items: center;
   border-radius: 50%;
   border: 3px solid white;
   display: flex;
    justify-content: center;
    align-items: center;
}


.bg-accountcreated {
    background: red;
}

.bg-main {background: linear-gradient(<?= $json_a['color_primary']  ?>, <?= $json_a['color_secondary']  ?>) !important}body.bg-main {background: linear-gradient(<?= $json_a['color_primary']  ?>, <?= $json_a['color_secondary']  ?>) !important}main.bg-main {background: linear-gradient(<?= $json_a['color_primary']  ?>, <?= $json_a['color_secondary']  ?>) !important}section.bg-main {background: linear-gradient(<?= $json_a['color_primary']  ?>, <?= $json_a['color_secondary']  ?>) !important}div.bg-main {background: linear-gradient(<?= $json_a['color_primary']  ?>, <?= $json_a['color_secondary']  ?>) !important}button.bg-main {background: linear-gradient(<?= $json_a['color_primary']  ?>, <?= $json_a['color_secondary']  ?>) !important}a.bg-main {background: linear-gradient(<?= $json_a['color_primary']  ?>, <?= $json_a['color_secondary']  ?>) !important}.border-pr {border-top: 3.5px solid <?= $json_a['color_primary']  ?> !important}.color-pr {background: <?= $json_a['color_primary']  ?> !important}.text-main {color: <?= $json_a['color_primary']  ?> !important}



 .from-imp {
        padding:14px;
        border-radius:5px;
        width:90%;
        margin:20px;
        background: #f1f1f1;
    }
        
    .form-imp2 { 
      width: 100%;
      height: $input-height;
      padding: $input-padding-y $input-padding-x;
      font-size: $font-size-base;
      line-height: $input-line-height;
    }

.login-btn {
	background-color: red;
}

.register-btn {
	background-color: #16C2F2;
}

.bg-sigin{
    border-radius: 5px;
    width: 120px;
    height: 45px;
    margin-bottom: 15px;
    color: white;
    background: #fe1a19;
}

.bg-siginup{
    border-radius: 5px;
    border-radius: 5px;
    width: 300px;
    height: 48px;
    color: white;
    background: #2fc8f2;
}


.bg-signup{
    border-radius: 5px;
    border-radius: 5px;
    width: 300px;
    height: 48px;
    color: white;
    background: #2fc8f2;
}
    </style>
</head>

<!--<?php if($json_a['app_theme']=='Elegant Pro') {?>-->

<!--<body class="bg-main" style="margin-top:15px;"> -->
<!--<div>-->

<!--  <div>-->
<!--     <center>-->
<!--    <form action="" autocomplete="off" method="POST">-->
<!--<?php foreach ($errors as $error) : ?>-->
<!--            <p class="alert alert-danger"><?php echo $error ?></p>-->
<!--<?php endforeach ?>-->
<!--        <input type="hidden" id="did" name="did">-->
<!--        <script type="text/javascript">-->
<!--            var did_app = Android.getDeviceId();-->
<!--            document.getElementById("did").value = did_app;-->
<!--        </script>-->
        


 
<!--        <div class="from-imp">-->
<!--            <input style="color:black; font-size:15px; background: #f1f1f1;" type="text" placeholder="Enter your name" value="<?= $_POST['name'] ?? ''?>" name="name">-->
<!--        </div>-->
<!--        <?php if ($json_a['user_account_type']==0) {?>-->
<!--        <div class="from-imp">-->
<!--            <input style="color:black; font-size:15px; background: #f1f1f1;" type="Mobile" placeholder="Email" value="<?= $_POST['mobile'] ?? ''?>" name="mobile">-->
<!--        </div> -->
<!--        <?php }else{  ?>-->
<!--          <div class="from-imp">-->
<!--            <input style="color:black; font-size:15px; background: #f1f1f1;" type="number" placeholder="Mobile" value="<?= $_POST['mobile'] ?? ''?>" name="mobile">-->
<!--        </div>-->
<!--        <?php } ?>-->
<!--        <div class="from-imp">-->
<!--            <input style="color:black; font-size:15px; background: #f1f1f1;" type="password" placeholder="Create a password" name="password_1">-->
<!--        </div>-->
<!--        <div class="from-imp">-->
<!--            <input style="color:black; font-size:15px; background: #f1f1f1;"style="color:black; font-size:15px; background: #f1f1f1;" type="password" placeholder="Confirm password" name="password_2">-->
<!--        </div>-->
<!--        <div class="from-imp">-->
<!--            <input style="color:black; font-size:15px; background: #f1f1f1;" type="text" placeholder="Referral Code" value="<?= $_POST['ref'] ?? '1234'?>" name="ref">-->
<!--        </div>-->
        
<!--<?php if ($reg_success) : ?>-->
<!--                <button disabled type="submit" style="color:white;" class="btn bg-accountareated deep-purple btn-block">Account Created</button>-->
<!--             <script>-->
<!--                    Android.successAlert("Registration Successful!", false)-->
            
<!--                </script>-->
                
                
               
         
                
          
                
                
                
<!--<?php elseif ($registration) : ?>-->
<!--                <button type="submit" name="reg_user"  style="width: 92%; margin-bottom:15px; height: 45px;" class="btn bg-signup deep-purple btn-block">Sign Up</button>-->
<!--<?php else : ?>-->
<!--                <button disabled style="width: 92%; margin-bottom:15px; height: 45px;" class="btn bg-signup deep-purple btn-block">Registration Closed</button>-->
<!--<?php  endif ?>-->
<!--    </form>-->
<!--      <br>-->
<!--  </center></div>-->
<!-- </div>-->

<!--       </section>   -->
<!--</section>   -->
<!--</body>-->
<!--<?php } ?>-->



<!--<?php if($json_a['app_theme']=='Simple') {?>-->

<!--<!DOCTYPE html>-->
<!--<html>-->

<!--<head>-->
<!--    <title>Sign Up</title>-->
<!--    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">-->
<!--    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">-->
<!--    <link rel="stylesheet" href="css/style.classic.css">-->
<!--    <style>-->
<!--    .bg-primary {background: linear-gradient(#480048, #C04848) !important}body.bg-primary {background: linear-gradient(#480048, #C04848) !important}main.bg-primary {background: linear-gradient(#480048, #C04848) !important}section.bg-primary {background: linear-gradient(#480048, #C04848) !important}div.bg-primary {background: linear-gradient(#480048, #C04848) !important}button.bg-primary {background: linear-gradient(#480048, #C04848) !important}a.bg-primary {background: linear-gradient(#480048, #C04848) !important}.border-pr {border-top: 3.5px solid #480048 !important}.color-pr {background: #480048 !important}.text-primary {color: #480048 !important}    </style>-->
<!--</head>-->

<!--<body class="bg-main">-->
<!--    <form action="" autocomplete="off" method="POST">-->
<!--        <?php foreach ($errors as $error) : ?>-->
<!--            <p class="alert alert-danger"><?php echo $error ?></p>-->
<!--<?php endforeach ?>-->
<!--        <input type="hidden" id="did" name="did">-->
<!--        <script type="text/javascript">-->
<!--            var did_app = Android.getDeviceId();-->
<!--            document.getElementById("did").value = did_app;-->
<!--            </script>-->
            
<!--        <h2>Create Account</h2>-->
<!--        <div class="input-container">-->
<!--            <i>person</i>-->
<!--            <input class="input-field masque" type="text" placeholder="Enter your name"-->
<!--                value="" name="name">-->
<!--        </div>-->
<!--<?php if ($json_a['user_account_type']==0) {?>-->
        
<!--        <div class="input-container">-->
<!--            <i>email</i>-->
<!--            <input class="input-field no-font" type="Email" value=""-->
<!--                placeholder="Enter your Email" name="mobile">-->
<!--        </div>-->
<!--         <?php }else{  ?>-->
<!--             <div class="input-container">-->
<!--            <i>phone_android</i>-->
<!--            <input class="input-field no-font" type="number" value=""-->
<!--                placeholder="Enter your mobile" name="mobile">-->
<!--        </div>-->
<!--    <?php } ?>-->
        
<!--        <div class="input-container">-->
<!--            <i>security</i>-->
<!--            <input class="input-field masque" type="password" placeholder="Create a password" name="password_1">-->
<!--        </div>-->

<!--        <div class="input-container">-->
<!--            <i>security</i>-->
<!--            <input class="input-field masque" type="password" placeholder="Confirm password" name="password_2">-->
<!--        </div>-->

<!--        <div class="input-container">-->
<!--            <i>person_add</i>-->
<!--            <input class="input-field no-font" type="text" placeholder="Referral Code (Optional)"-->
<!--                value="1234" name="ref">-->
<!--        </div>-->
<!--<?php if ($reg_success) : ?>-->
<!--                <button disabled type="submit" class="exodus">Account Created</button>-->
<!--             <script>-->
<!--                    Android.successAlert("Registration Successful!", false)-->
            
<!--                </script>-->
<!--<?php elseif ($registration) : ?>-->
<!--                <button type="submit" name="reg_user" class="exodus">Sign Up</button>-->
<!--<?php else : ?>-->
<!--                <button disabled  class="exodus">Registration Closed</button>-->
<!--<?php  endif ?>-->
<!--    </form>-->
<!--      <br>-->
<!--  </center></div>-->
<!-- </div>-->

<!--       </section>   -->
<!--</section>   -->
<!--</body>-->
<!--<?php } ?>-->



<!--<?php if($json_a['app_theme']=='Classic') {?>-->
<!--<style>-->
    
<!--    .topbar { -->
<!--      background: <?= $bg_top ?> !important;-->
<!--      border-radius:0px 0px 60px 60px;-->
<!--      padding: 10px;-->
      
<!--}-->
<!--    .bg_top{-->
<!--    background: <?= $bg_top ?> !important;-->
<!--}-->


<!--#button1{-->
<!--    border-radius:5px;-->
<!--    width: 65%;-->
<!--    height:65px;-->
<!--    color:white;-->

<!--}-->

<!--#btn{-->
<!--   position: absolute; -->
<!--   bottom: -35px; -->
<!--   padding: 5px;-->
<!--   margin: 0px 55px;-->
<!--   align-items: center;-->
<!--   border-radius: 5px;-->
<!--}-->
<!--#container{-->
<!--    margin-top:25px;-->
<!--}-->

<!--.bg-accountcreated{-->
<!--    background: #3B2361;-->
<!--}-->

<!--</style>-->
<!--<body class="bg-white">  -->
<!--<section class="topbar">-->
<!--   <br><br><br><br><br><br>-->
<!--</section>-->
<!--<div class="notice-bg">-->
<!--<div class="notice-block">-->
<!--  <div class="logoicon">-->
<!--                   <img src="https://appslabbdinfo.com/image/avatar.png" height="100px" width="100px"/>-->
<!--               </div>-->

<!--  <br><br><br><div class="box">-->
<!--     <center>-->
<!--    <form action="" autocomplete="off" method="POST">-->
<!--<?php foreach ($errors as $error) : ?>-->
<!--            <p class="kalpurush gray"><?php echo $error ?></p>-->
<!--<?php endforeach ?>-->
<!--        <input type="hidden" id="did" name="did">-->
<!--        <script type="text/javascript">-->
<!--            var did_app = Android.getDeviceId();-->
<!--            document.getElementById("did").value = did_app;-->
<!--        </script>-->
        
<!--        <div class="form-group">-->
<!--            <input class="form-control" id="email" type="text" placeholder="Enter your name" value="<?= $_POST['name'] ?? ''?>" name="name"> </div>-->
<!--         <?php if ($json_a['user_account_type']==0) {?>-->
<!--        <div class="form-group">-->
<!--<input class="form-control" id="email" type="number" placeholder="Mobile" value="<?= $_POST['mobile'] ?? ''?>" name="mobile">-->
<!--        </div>            <?php }else{  ?>-->
<!--            <div class="form-group">-->
<!--           <input class="form-control" id="email" type="number" placeholder="Mobile" value="<?= $_POST['mobile'] ?? ''?>" name="mobile">-->
<!--        </div>-->
<!--        <?php } ?>-->
<!--        <div class="form-group">-->
<!--            <input class="form-control" id="email" type="password" placeholder="Enter password" name="password_1">-->
<!--        </div>-->
<!--        <div class="form-group">-->
<!--            <input class="form-control" id="email" type="password" placeholder="Confirm password" name="password_2">-->
<!--        </div>-->
<!--        <div class="form-group">-->
<!--             <input class="form-control" id="email" type="text" placeholder="Referral Code" value="<?= $_POST['ref'] ?? ''?>" name="ref">-->
<!--        </div>-->
        
<!--<?php if ($reg_success) : ?>-->
<!--                <button disabled type="submit" id="button1" class="btn bg-accountcreated deep-purple btn-block">Account Created Success</button>-->
<!--             <script>-->
<!--                    Android.successAlert("Registration Successful!", true)-->
<!--                </script>-->
<!--<?php elseif ($registration) : ?>-->
<!--                <button type="submit" name="reg_user" id="button" class="btn bg_top deep-purple btn-block">Sign Up</button>-->
<!--<?php else : ?>-->
<!--                <button disabled id="button" class="btn bg-main deep-purple btn-block">Registration Closed</button>-->
<!--<?php  endif ?>-->
<!--    </form>-->
<!--  <br>-->
<!--  </center></div>-->
<!-- </div>-->

<!--       </section>   -->

<!--</body>-->
<!--<?php } ?>-->

<!--</html>-->









<!DOCTYPE html>
<html>
<head>
    <title>Log In</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
        <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">
		<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css" >
		<link rel="stylesheet" href="css/bg.css" >
    <style>
		


i, .material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  
}
.icons:active {
	transform: scale(0.8);
}
.icons {
    margin:6px;
    color: <?php echo($app_data['color_primary']);?>  !important;
    font-size: 22px;
    background: lavender ;
    border-radius: 50% ;
    padding: 6px;
    transition: all 0.1s ease-in-out;
}		#body {
  font-family: 'Nunito';
background-color:  #5d8fc9;
}
#login-card{
    width:350px;
    border-radius: 25px;
    margin:150px auto;
  
}

#email{
    border-radius:5px;
    background-color: #ffffff;
    border-color: #ebf0fc;
    color: #9da3b0;
}

div1:hover{
    border-color:red;
}
.rainbow-divider {
	outline: none;
	border: none;
    height: 3px;
    background:#dcdcdc;
}

#button{
    border-radius:5px;
    width: 120px;
    height:48px;
    margin-right:12px;
    margin-bottom:18px;
    float: right;
    color:white;
    background:#5e72e3;

}
.bg-signup {
    background: #C04848;
}
#btn{
   bottom: -35px; 
   padding: 5px;
   margin: 0px 55px;
   align-items: center;
   border-radius: 5px"
}
#container{
    margin-top:25px;
}

.btn-circle.btn-sm { 
            width: 40px; 
            height: 40px; 
            padding: 2px 0px; 
            border-radius: 25px; 
            font-size: 14px; 
            text-align: center;
            
            margin: 8px;
        }
.logoicon{ 
   top: -50px; 
   margin: 0;
   align-items: center;
   display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}  
.mmm{
   bottom: -20px; 
   margin: 0;
   align-items: center;
    justify-content: center;
    align-items: center;
    width: 100%;
}
#button2{
    border-radius:5px;
    border-radius:5px;
    width: 300px;
    height:48px;
    color:white;
    background: #5e72e3;

}
.logoicon img{
   margin: 0;
   align-items: center;
   border-radius: 50%;
   border: 3px solid white;
   display: flex;
    justify-content: center;
    align-items: center;
}
.div1 {
  width:86%;
  display: -ms-flexbox;
  display: flex;
  margin: 25px;
  padding:12px;
  background: white;
  border: 2px solid #d1cdcd;
  border-radius:3px;
  
}
.div1:hover{
  --c:  <?php echo($app_data['color_primary']);?> !important;
  border-color: <?php echo($app_data['color_primary']);?>  !important;
  border: 2px solid ;
}

.input-fields {
  width: 100%;
  padding: 15px;
  outline: none;
  border: none;
}

.no-fonts {
	font-family: 'Algerian';
}
.form-my { 
  width: 100%;
  height: $input-height;
  padding: $input-padding-y $input-padding-x;
  font-size: $font-size-base;
  line-height: $input-line-height;
  color: #000000;
  background-clip: padding-box;
  border: $input-border-width solid $input-border-color;
}
.ico {
    margin-left:5px;
    margin-right:10px;
    color: var(--c);
    font-size: 35px;
    border-radius: 50% ;
    transition: all 0.1s ease-in-out;
}
i, .material-ico {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  text-transform: none;
  display: inline-block;
  letter-spacing: normal;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-size: 24px;
}

.bg-Create-Account{
    background:#5e72e3;
}

</style>
</head>
<body class="bg-main" style="margin-top:15px;"> 
<div style="margin-right:15px; margin-left:15px; background:white ; color:black; border-radius: 3px; border: 1px solid #e8e8e8 ;">
  <center><div  style="margin-top:18px;">
                   <img src="img/profile.png" height="100px" width="100px"/>
               </div></center>

  <div>
     
   <form class="text-center" action="" autocomplete="off" method="POST">
<?php foreach ($errors as $error) : ?>
            <p class="message"><?php echo $error ?></p>
<?php endforeach ?>
        
       <center> 
        <input type="hidden" id="did" name="did">
        <script type="text/javascript">
            var did_app = Android.getDeviceId();
            document.getElementById("did").value = did_app;
        </script>
        
        <div class="div1">
	        <i class="material-ico ico">person</i>
            <input class="form-my" id="email" style="color:black; font-size:15px;" type="text" placeholder="Enter your name" value="" name="name">
        </div>
         <?php if ($json_a['user_account_type']==0) {?>
         <div class="div1">
	        <i class="material-ico ico">email</i>
            <input class="form-my" id="email" style="color:black; font-size:15px;" type="email" placeholder="Email" value="" name="mobile">
        </div>
         <?php }else{  ?>
        <div class="div1">
	        <i class="material-ico ico">phone_android</i>
            <input class="form-my" id="email" style="color:black; font-size:15px;" type="number" placeholder="Mobile" value="" name="mobile">
        </div>
        <?php } ?>
        <div class="div1">
	        <i class="material-ico ico">security</i>
            <input class="form-my" id="email" style="color:black; font-size:15px;" type="password" placeholder="Create a password" name="password_1">
        </div>
        <div class="div1">
	        <i class="material-ico ico">security</i>
            <input class="form-my" id="email" style="color:black; font-size:15px;" type="password" placeholder="Confirm password" name="password_2">
        </div>
        <div class="div1">
	        <i class="material-ico ico">person_add</i>
            <input class="form-my" id="email" style="color:black; font-size:15px;" type="text" placeholder="Referral Code" value="<?= $_POST['ref'] ?? ''?>" name="ref">
        </div>
        
        <?php if ($reg_success) : ?>
                <button disabled type="submit" id="button2" class="btn bg- Create-Account deep-purple btn-block">Account Created Success</button>
             <script>
                    Android.successAlert("Registration Successful!", true)
                </script>
<?php elseif ($registration) : ?>
                <button type="submit" name="reg_user" id="button2" class="btn bg- Create-Account deep-purple btn-block">Create Account</button>
<?php else : ?>
                <button disabled id="button2" class="btn bg- Create-Account deep-purple btn-block">Registration Closed</button>
<?php  endif ?>
        
        
        
		
    </form>
  <br>
  </center></div>
 </div>

</body>
</html>











