<?php
error_reporting(0);
session_start();

$emptyPhoneNumber       = false;
$emptyName              = false;
$registrationSuccess    = false;
$registrationFailed     = false;
$registrationFailedMsg  = '';

if( $_POST['action'] == 'register' ) {
    if( $_POST['verifycode'] == $_SESSION['login'] ) {

        // Check if phoneNumber and name is empty or not
        $phoneNumber    =   htmlentities($_POST['phoneNumber']);
        //$name           =   htmlentities($_POST['name']);

        if($phoneNumber == '') {
            $emptyPhoneNumber   =   true;
        }

		/*
        if($name == '') {
            $emptyName   =   true;   
        }
		*/

        //if($phoneNumber != '' && $name != '') {
		if($phoneNumber != '') {

            // Call API here
            $registerUrl    = 'http://www.on9888.com/API/appstoreapi/api/register_baru';
            $secret         = 'kdnNuAaKCtxe6AUx';
            $source         = 'LUCKYWUKONG888 Landing Page';
            $agent          = '310';
            $headerValue    = 'pZUWNsPm8IsViPCTvsub';

            $postFields = array(
                'phoneNumber' => $phoneNumber,
                'secret'      => $secret,
                'source'      => $source,
                'agent'       => $agent
                );

            $curlInit = curl_init();
            curl_setopt($curlInit, CURLOPT_HTTPHEADER, array('Authorization: '.$headerValue));
            curl_setopt($curlInit, CURLOPT_URL, $registerUrl);
            curl_setopt($curlInit, CURLOPT_RETURNTRANSFER, true);   
            curl_setopt($curlInit, CURLOPT_SSL_VERIFYPEER, false);
            curl_setopt($curlInit, CURLOPT_POST, true);
            curl_setopt($curlInit, CURLOPT_POSTFIELDS, $postFields);

            $curlResponse = curl_exec($curlInit);
            curl_close ($curlInit); 

            $returnValue = json_decode($curlResponse);

            if($returnValue->status === 'SUCCESS') {
                $registrationSuccess    = true;
            } else {
                $registrationFailed     = true;
                $registrationFailedMsg  = $returnValue->message;
            }
        }

    }

}
?>
<!DOCTYPE html>
<html lang="en">
<head>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="LUCKY WUKONG Official"/>
    <meta name="author" content="" />

    <title>LuckyWukong | SCR888 | ROLLEX | JOKER | 3WIN8 | LPE</title>

    <!-- Canonical Links -->
    <link rel="canonical" href="http://luckywukong.com/" />

    <!-- FavIcon -->
    <link rel="Shortcut Icon" href="images/favicon.jpg" /> 

    <!-- Bootstrap Core CSS -->
    <link href="css/landing/bootstrap.min.css" rel="stylesheet"/>

    <!-- Custom CSS -->
    <link href="css/landing/landing-page.css?version=2" rel="stylesheet"/>

    <!-- Custom Fonts -->
    <link href="css/landing/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css" />

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries // -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif] // -->
	
	<style>
	.cuci_form {

	  margin:0 auto;
	  display:block;
	  margin-bottom: 16px;
	  width: 320px;
	  height: 41px;
	  padding: 6px 12px;
	  font-size: 14px;
	  line-height: 1.42857143;
	  color: #555;
	  background-color: #fff;
	  background-image: none;
	  border: 1px solid #ccc;
	  border-radius: 4px;
	  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
			  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
	  -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
		   -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
			  transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
	  text-align: center;
	}

	.cuci_form_background {
		background-color: rgba(0, 0, 0, 0.5);
		padding: 10px;
		margin:0 auto;
		display: inline-block;
		border-radius: 16px;
	}

	.cuci_h4 {
		color: #E7BB36;
	}

	.cuci_h2 {
		text-align: center;
		color: #E7BB36;
	}

	.cuci_center_image {
		margin: auto;
		margin-top: 30px;
		width: 50%;
		border: 3px solid green;
		padding: 10px;
	}

	.cuci_contact_number {
		margin-top: 36px;
	}

	</style>	
	
	
    <!-- Google Analytics -->
	<script>
	  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

	  ga('create', 'UA-103942713-1', 'auto');
	  ga('send', 'pageview');

	</script>
</head>

<body>

    <!-- Navigation -->
    <nav class="navbar navbar-default navbar-fixed-top topnav" role="navigation">
        <div class="container topnav">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <!--<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>-->
                <button class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <a href="http://luckywukong.com">Go to LUCKY WUKONG Page   <i class="fa fa-chevron-right"></i></a>
                </button>
                <a class="navbar-brand topnav" href="http://luckywukong.com/"><img src="images/logo-luckywukong.png" alt="LuckyWukong Online Casino Malaysia" height="40"/></a>

            </div>
            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a href="http://luckywukong.com/">Go to LUCKY WUKONG Page   <i class="fa fa-chevron-right"></i></a>
                    </li>
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container -->
    </nav>


    <!-- Header -->
    <form action="" method="post">
        <input type="hidden" name="action" value="register">
        <input type="hidden" name="verifycode" value="<?php echo $_SESSION['login'] = rand(123212,998789); ?>">
        <a name="about"></a>
        <div class="intro-header">
            <div class="container">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="intro-message">
                            <?php if($registrationSuccess){ ?>
								<h3>Thanks for registering on LUCKY WUKONG !</h3>
								<hr class="intro-divider">
								<div class="cuci_form_background">
								<a href="http://api.whatsapp.com/send?phone=601112866853"><img src="images/icon-whatsapp.png" alt="WhatsApp" /><h4> 0111-286-6853</h4></a>
								<img src="images/icon-wechat.png" alt="WeChat" /> <h4>ivyleong310</h4>
								<br>
								<h4 class="cuci_h4">Your account will be created shortly after registration.<br>In the meantime please visit our website for more information about our products and services.</h4>
								<br>
								<a href="http://luckywukong.com" class="lead"> >> Click to visit LUCKY WUKONG Official Website << </a>
								</div>
                            <?php }else{ ?>
								<!--<h2>LUCKY WUKONG Official Register</h2>-->
								<h3>Register now to enjoy welcome BONUS!</h3>
								<hr class="intro-divider">
								<div class="cuci_form_background">
								<a href="http://api.whatsapp.com/send?phone=601112866853"><img src="images/icon-whatsapp.png" alt="WhatsApp" /><h4> 0111-286-6853</h4></a>
								<img src="images/icon-wechat.png" alt="WeChat" /> <h4>ivyleong310</h4>
								<br>
								<h4 class="cuci_h4">Register &amp; Start WINNING!</h4>
								<br>
								<input class="cuci_form" type="text" name="phoneNumber" placeholder="Phone Number | eg: 0123456789">
								<?php if($emptyPhoneNumber):?>
									<?php echo '<p style="color: red;">Please fill in required fields!</p>';?>
								<?php endif;?>
								<!--
								<input class="cuci_form" type="text" name="name" placeholder="Name">
								//-->
								<?php //if($emptyName):?>
									<?php //echo '<p style="color: red;">Please fill in required fields!</p>';?>
								<?php //endif;?>
								<ul class="list-inline intro-social-buttons">
									<li>
										<button type="submit" class="btn btn-default btn-lg" id="registerBtn"><i class="fa fa-book fa-fw"></i><span class="network-name">Register</span></button>
									</li>
									<p style="margin-top: 8px;"> OR </p>
									<li>
										<a href="http://luckywukong888.com/dl" class="btn btn-default btn-lg"><i class="fa fa-download fa-fw"></i> <span class="network-name">Download NOW!</span></a>
									</li>
								</ul>
								<?php if($registrationFailed):?>
									<p style="color: red;">ERROR : <?php echo $registrationFailedMsg;?></p>
								<?php endif;?>
								</div>
                            <?php } ?>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /.container -->

        </div>
    </form>
    <!-- /.intro-header -->

    <!-- Page Content -->

	<a  name="services"></a>
    <!--div class="content-section-a">

        <!--div class="container">
            <div class="row">
                <div class="col-lg-5 col-sm-6">
                    <hr class="section-heading-spacer">
                    <div class="clearfix"></div>
                    <img class="img-responsive" style="display:inline-block" src="images/logo-luckywukong.png" alt="LUCKY WUKONG Online Casino Malaysia"/>
					<img class="img-responsive" style="display:inline-block" src="images/landing/logo_game_scr8881.png" alt="SCR888 Malaysia"/>
                    <h2 class="section-heading">Download LUCKY WUKONG Android</h2>
                    <p class="lead">LUCKY WUKONG Android Download will support all range of Android mobile smartphones. Scan the QR code and download LUCKY WUKONG APK now.</p>
                    <br>
                    <a href="http://luckywukong888.com/dl/" class="lead"> >> Click to download LUCKY WUKONG Android APK << </a>
                </div>
                <div class="col-lg-5 col-lg-offset-2 col-sm-6" style="min-height: 200px; text-align: center;">
                    <img class="cuci_center_image" src="https://api.qrserver.com/v1/create-qr-code/?size=180x1800&data=http://luckywukong888.com/dl/" alt="">
                </div>
            </div>

        </div-->

        <!--div class="container">
            <div class="row">
                <div class="col-lg-5 col-sm-6">
                    <hr class="section-heading-spacer">
                    <div class="clearfix"></div>
                    <img class="img-responsive" src="images/logo-luckywukong.png" alt="LUCKY WUKONG Online Casino Malaysia"/>
                    <h2 class="section-heading">Thanks for registering on LUCKY WUKONG !</h2>
                    <p class="lead">Your account will be created shortly after registration. In the meantime please visit our website for more information about our products and services.</p>
                    <br>
                    <a href="http://luckywukong.com" class="lead"> >> Click to visit LUCKY WUKONG Official Website << </a>
                </div>
                <div class="col-lg-5 col-lg-offset-2 col-sm-6" style="min-height: 200px; text-align: center;">
                    <img class="cuci_center_image" src="https://api.qrserver.com/v1/create-qr-code/?size=180x1800&data=http://luckywukong888.com/dl/" alt="">
                </div>
            </div>

        </div-->
        <!-- /.container -->

    </div-->
    <!-- /.content-section-a -->

	<a  name="contact"></a>
    <div class="banner" style="background-color: rgba(0, 0, 0, 0.8);">

        <div class="container">

            <div class="row">
                <div class="col-lg-12">
                    <h2 class="cuci_h2">Available Games</h2>
                    <ul class="cuci_h2" style="color: transparent; margin: 0px; padding: 0px;">
                        <li>
                            <a href="http://luckywukong.com/en/scr888-slot-games"><img src="/images/landing/logo_game_scr8881.png" alt="SCR888 Malaysia"/></a>
                        </li>
                        <li>
                            <a href="http://luckywukong.com/en/luckypalace-slot-games"><img src="/images/landing/logo_game_luckypalace1.png" alt="Lucky Palace Malaysia" /></a>
                        </li>
                        <li>
                            <a href="http://luckywukong.com/en/3win8-slot-games"><img src="/images/landing/logo_game_3win81.png" alt="3WIN8 Malaysia" /></a>
                        </li>
                        <li>
                            <a href="http://luckywukong.com/en/rollex-slot-games"><img src="/images/landing/logo_game_rollex1.png" alt="Rollex Casino Malaysia" /></a>
                        </li>
                        <li>
                            <a href="http://luckywukong.com/en/joker-slot-games"><img src="/images/landing/logo_game_joker1.png" alt="Joker Gaming Malaysia" /></a>
                        </li>
                        <li>
                            <a href="http://luckywukong.com/en/suncity-slot-games"><img src="/images/landing/logo_game_suncity1.png" alt="Club Suncity Malaysia" /></a>
                        </li>
                    </ul>
                </div>
            </div>

        </div>
        <!-- /.container -->

    </div>
    <!-- /.banner -->

    <!-- Footer -->
    <footer>
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <p class="copyright text-muted small">Copyright &copy; LUCKYWUKONG 2017. All Rights Reserved</p>
                </div>
            </div>
        </div>
    </footer>

    <!-- jQuery -->
    <script src="js/landing/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="js/landing/bootstrap.min.js"></script>

    <!-- Live Chat -->
    <!-- Start of LiveChat (www.livechatinc.com) code -->
	<script type="text/javascript">
		window.__lc = window.__lc || {};
		window.__lc.license = 8630444;
		(function() {
		  var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;
		  lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';
		  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lc, s);
		})();
	</script>
<!-- End of LiveChat code -->

</body>

</html>
