public static function register()
 {
     $email = Core::validate(self::getVar('email'));
     $pass = Core::validate(self::getVar('password'));
     $captcha = Core::validate(self::getVar('captcha'));
     if ($email == null || $pass == null || $captcha == null) {
         Core::printErrorJson('Incorrect data input');
         return;
     }
     $right_code = Session::getSessionVariable('security_code');
     Session::unsetSessionVariable('security_code');
     if ($captcha != $right_code) {
         Core::printErrorJson('Incorrect captcha');
         return;
     }
     if (!Core::isEmailAddress($email)) {
         Core::printErrorJson('Incorrect email');
         return;
     }
     if (User::isExist($email, $email)) {
         Core::printErrorJson('User ' . $email . ' is already registered.');
         return;
     }
     $usr = new User();
     $usr->setLogin($email);
     $usr->setEmail($email);
     $usr->setDate(date("Y-m-d H:i:s"));
     $usr->setActivation(0);
     $usr->setPassHash(Core::calculateHash($pass));
     $usr->insert();
     $activationCode = self::calcActivationCode($usr);
     $activationUrl = "http://" . $_SERVER['SERVER_NAME'] . "/usr/activation?login="******"&code=" . $activationCode;
     $subject = Core::translateToCurrentLocale("Registration confirmation") . ".";
     $header = '<h1>' . Core::translateToCurrentLocale("Hello") . ', </h1>
     <p class="lead">' . Core::translateToCurrentLocale("you have registered on the Bitmonex website") . '.</p>' . '<p>' . Core::translateToCurrentLocale("Your login is") . ': ' . $email . '</p><p>' . Core::translateToCurrentLocale("Your password is") . ': ' . $pass . '</p>';
     $body = '<p>' . Core::translateToCurrentLocale("To confirm your registration, please click on this link") . '. <a href="' . $activationUrl . '">' . Core::translateToCurrentLocale("Activate") . '!</a></p>';
     $message = self::getMessage($header, $body);
     if (!Core::send_mail($email, $subject, $message)) {
         $usr->delete();
         Core::printErrorJson('Notification email is not send.');
         return;
     }
     $result['success'] = 1;
     print json_encode($result);
 }
        ?>
            </td>
            <td>
                <?php 
        print $value['Part'];
        ?>
            </td>
            <td>
            <?php 
        if ($value['Status'] == 'Active') {
            ?>
                <input class="btn" type="button" onclick="orders.CancelFromHistory('<?php 
            print $value['id'];
            ?>
');" value="<?php 
            print Core::translateToCurrentLocale('Cancel');
            ?>
">
            <?php 
        }
        ?>
            </td>
        </tr>
        <?php 
        if (count($value['deals']) > 0) {
            ?>
            <?php 
            foreach ($value['deals'] as $deal) {
                ?>
                <tr class="deal" style="display: none; position:relative;">
                    <td></td>
        print $lang;
        ?>
" type="text" name="<?php 
        print $lang;
        ?>
" placeholder="<?php 
        print $lang;
        ?>
"">
                            </td>
                        <?php 
    }
    ?>
                        <td>
                            <input id="submit" type="submit" value="<?php 
    print Core::translateToCurrentLocale('Add');
    ?>
">
                        </td>
                    </form>
                </tr>
                <?php 
    foreach ($data['localizationList'] as $value) {
        ?>
                    <tr id='<?php 
        print $value['id'];
        ?>
'>
                        <?php 
        foreach ($data['languages'] as $lang) {
            ?>
Пример #4
0
                amount: amount
            },
            dataType: 'json',
            success: function(result) {
                window.location = result.location;
            }
        });
    }
</script>

<form method="get" class="form-money form-horizontal in" role="form" name="LTC_in" style="display: none" action="/money/LTC_transaction">
    <div id="ltc-code"><pre> </pre></div>
    <input class="btn" onclick="generateLTCCode(this);" type="button" value="<?php 
print Core::translateToCurrentLocale('Get code');
?>
">
</form>

<form onsubmit="submitLTCOutput(this);" method="post" class="form-money form-horizontal" role="form" name="LTC_out" style="display: none" action="/money/LTC_transaction_o">
    <div class="submit-dialog-captions"><?php 
print Core::translateToCurrentLocale("Address");
?>
:</div>
    <input type="text" name="address"><br>
    <div class="submit-dialog-captions"><?php 
print Core::translateToCurrentLocale("Amount");
?>
:</div>
    <input type="text" name="amount"><br>
    <input class="btn" type="submit" value="Submit">
</form>
        <li <?php 
    if ($activeMenu == 'Order settings') {
        print $activeClass;
    }
    ?>
><a href="/admin/order_settings"><?php 
    print Core::translateToCurrentLocale('Order settings');
    ?>
</a></li>
        <li <?php 
    if ($activeMenu == 'News') {
        print $activeClass;
    }
    ?>
><a href="/admin/news"><?php 
    print Core::translateToCurrentLocale('News');
    ?>
</a></li>
        <li <?php 
    if ($activeMenu == 'Order priority') {
        print $activeClass;
    }
    ?>
><a href="/admin/order_priority"><?php 
    print Core::translateToCurrentLocale('Order priority');
    ?>
</a></li>
    <?php 
}
?>
</ul>
Пример #6
0
    <input type="hidden" name="NOPAYMENT_URL" value="<?php 
print 'http://' . Core::server_url() . '/money/PM_transaction' . '_cancel';
?>
">
    <input type="hidden" name="NOPAYMENT_URL_METHOD" value="POST">
    <input class="btn" type="submit" value="<?php 
print Core::translateToCurrentLocale('In');
?>
">
</form>

<form onsubmit="submitPMOutput(this);" method="POST" class="form-money form-horizontal" role="form" name='PM_out' style="display: none" action="/money/PM_transaction_o">
    <input type="hidden" name="fiat" value="<?php 
print $data['CurName'];
?>
">
    <div class="submit-dialog-captions"><?php 
print Core::translateToCurrentLocale('Amount');
?>
:</div>
    <input type="text" name="amount" value=""><br>
    <div class="submit-dialog-captions"><?php 
print Core::translateToCurrentLocale('Account');
?>
:</div>
    <input type="text" name="account" value=""><br>
    <input class="btn" type="submit" value="<?php 
print Core::translateToCurrentLocale('Out');
?>
">
</form>
<div class="modal-dialog" style="width:300px;">
    <div class="modal-content">
        <div class="modal-header" style="text-align: center">
            <?php 
print Core::translateToCurrentLocale('Loading...');
?>
        </div>
        <div class="modal-body">
            <div style="height:100px">
                <span id="modalSpinner" style="position: absolute;display: block;top: 50%;left: 50%;"></span>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    $.fn.ready(function(){
        PopupLoader.show();
    });
</script>
                            <td>
                                <?php 
        print $value['amount'] * $value['rate'];
        ?>
 <?php 
        print $currentRate['secondCurrency'];
        ?>
                            </td>
                        </tr>
                    <?php 
    }
    ?>
                <?php 
} else {
    ?>
                    <tr>
                        <td colspan="5">
                            <?php 
    print Core::translateToCurrentLocale('No trades');
    ?>
.
                        </td>
                    </tr>
                <?php 
}
?>
                </tbody>
            </table>
        </div>
    </div>
</div>
    if (isset($_GET['Data'])) {
        $page = $_GET['Data'];
        if ($page != null) {
            $widgets = widgetControl::getPageWidgets($page);
        } else {
            $widgets = widgetControl::getPageWidgets(0);
        }
    }
}
?>

<!-- DashBoard -->
<div id="dashboard" class="dashboard col-xs-9">
    <div class="topHead" style="margin-bottom:0px;">
        <span class="greenMark"><?php 
print Core::translateToCurrentLocale("Dashboard");
?>
</span>
        <div class="line"></div>
    </div>
    <div class="widgetPager">
        <?php 
$data = $widgets[0]['rate'];
print Core::runView('Shared/widgetpager', $data);
$currentRate = $widgets[0]['rate'];
?>
    </div>
    <?php 
foreach ($widgets as $key => $value) {
    ?>
        <a name="<?php 
            <tr>
                <td>
                    <span class="greenMark"><?php 
    print Core::translateToCurrentLocale('Name');
    ?>
</span>
                </td>
                <td>
                    <span class="greenMark"><?php 
    print Core::translateToCurrentLocale('Full name');
    ?>
</span>
                </td>
                <td>
                    <span class="greenMark"><?php 
    print Core::translateToCurrentLocale('Min order amount');
    ?>
</span>
                </td>
            </tr>
            <?php 
    foreach ($data['currencies'] as $value) {
        ?>
                <tr id='<?php 
        print $value['id'];
        ?>
'>
                    <td>
                        <span class="greenMark"><?php 
        print $value['Name'];
        ?>
Пример #11
0
                address: address,
                amount: amount
            },
            dataType: 'json',
            success: function(result) {
                window.location = result.location;
            }
        });
    }
</script>
<form method="get" class="form-money in" name="BTC_in" style="display: none" action="/money/BTC_transaction">
    <div id="btc-code"><pre> </pre></div>
    <input class="btn" onclick="generateBTCCode(this);" type="button" value="<?php 
print Core::translateToCurrentLocale('Get code');
?>
">
</form>

<form role="form" onsubmit="submitBTCOutput(this);" method="post" class="form-money form-horizontal" name="BTC_out" style="display: none" action="/money/BTC_transaction_o">
    <div class="submit-dialog-captions"><?php 
print Core::translateToCurrentLocale("Address");
?>
:</div>
    <input type="text" name="address"><br>
    <div class="submit-dialog-captions"><?php 
print Core::translateToCurrentLocale('Amount');
?>
:</div>
    <input type="text" name="amount"><br>
    <input class="btn" type="submit" value="Submit">
</form>
Пример #12
0
$newsItem['date'] = new DateTime($newsItem['date']);
$newsItem['date'] = $newsItem['date']->format('y/m/d');
$wordsArray = explode(' ', $newsItem['full']);
if (count($wordsArray) >= 50) {
    $firstPiece = array_slice($wordsArray, 0, 50);
    $secondPiece = array_slice($wordsArray, 50, count($wordsArray));
    $moreLabel = '<span id="widgetNewsMoreLabel" class="widgetNewsMoreLabel">... <a>' . Core::translateToCurrentLocale('Read more') . '</a></span>';
    $result = implode($firstPiece, ' ') . $moreLabel . '<div id="widgetNewsItemFull" class="widgetNewsItemFull">' . implode($secondPiece, ' ') . '</div>';
} else {
    $result = $newsItem['full'];
}
?>

<div class="widgetNews clearfix">
    <h3 class="widgetName"><?php 
print Core::translateToCurrentLocale('News');
?>
</h3>
    <div class="widgetNewsContainer">
        <div class="widgetNewsItem">
            <div class="widgetNewsItemTop clearfix">
                <strong class="widgetNewsItemDate left"><?php 
print $newsItem['date'];
?>
</strong>
                <h4 class="widgetNewsItemTitle left"><?php 
print $newsItem['title'];
?>
</h4>
            </div>
            <div class="widgetNewsItemContent">
            <tr>
                <td>
                    <span class="greenMark"><?php 
    print Core::translateToCurrentLocale('First Currency');
    ?>
</span>
                </td>
                <td>
                    <span class="greenMark"><?php 
    print Core::translateToCurrentLocale('Second Currency');
    ?>
</span>
                </td>
                <td>
                    <span class="greenMark"><?php 
    print Core::translateToCurrentLocale('Fee');
    ?>
</span>
                </td>
            </tr>
            <?php 
    foreach ($data['rates'] as $value) {
        ?>
                <tr id='<?php 
        print $value['id'];
        ?>
'>
                    <td>
                        <span class="greenMark"><?php 
        print $value['firstCurrency'];
        ?>
    ?>
</span></td>
                <td><span class="greenMark"><?php 
    print Core::translateToCurrentLocale('Input max');
    ?>
</span></td>
                <td><span class="greenMark"><?php 
    print Core::translateToCurrentLocale('Output fee');
    ?>
</span></td>
                <td><span class="greenMark"><?php 
    print Core::translateToCurrentLocale('Output min');
    ?>
</span></td>
                <td><span class="greenMark"><?php 
    print Core::translateToCurrentLocale('Output max');
    ?>
</span></td>
            </tr>
            <?php 
    foreach ($data['io_fees'] as $value) {
        ?>
                <tr id='<?php 
        print $value['id'];
        ?>
'>
                    <td><span class="greenMark"><?php 
        print $value['currencyName'];
        ?>
</span></td>
                    <td><span class="greenMark"><?php 
Пример #15
0
                                        <form accept-charset="UTF-8" role="form" method="post" action="/usr/login">
                                            <fieldset>
                                                <div class="form-group">
                                                    <input class="form-control" placeholder="<?php 
    print Core::translateToCurrentLocale('Login');
    ?>
" name="login" type="text">
                                                </div>
                                                <div class="form-group">
                                                    <input class="form-control" placeholder="<?php 
    print Core::translateToCurrentLocale('Password');
    ?>
" name="pass" type="password" value="">
                                                </div>
                                                <input class="btn btn-lg btn-success btn-block" type="submit" value="<?php 
    print Core::translateToCurrentLocale('Login');
    ?>
" style="">
                                            </fieldset>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </ul>
                </li>
            <?php 
}
?>
        </ul>
    </div><!--/.navbar-collapse -->
                "high":
                "low":
                "avg":
                "first":
                "last":
                "vol":
                "vol_cur":
                "time": (unix-time)
                "ask":
                "bid":
                ]
*/
?>

<div class="title greenMark"><?php 
print Core::translateToCurrentLocale('Price graph');
?>
</div>
<div class="right"><img id="barsMe" src="/public/img/other/circleness.png"/></div>
<div id="graphicRender" class="graphicRender"></div>


<script>
        graphParams.params = jQuery.parseJSON('{ "firstCurrency": "' + "<?php 
print $currentRate['firstCurrency'];
?>
" +
        '","secondCurrency": "' + "<?php 
print $currentRate['secondCurrency'];
?>
" + '", "period": "' + graphParams.period + '", "interval": "'+ graphParams.interval + '"}');
:</label>
        <img src="/api/captcha"><input type="text" name="captcha" class="form-control" id="InputCaptcha" placeholder="<?php 
print Core::translateToCurrentLocale('Captcha');
?>
:">
    </div>
    <div class="form-group">
        <input type="submit" class="btn btn-blue" value="<?php 
print Core::translateToCurrentLocale('Send a report');
?>
">
    </div>
  </form>
<div id="after-form-block">
    <?php 
print Core::translateToCurrentLocale('Thank you for you feedback!');
?>
</div>
<script>
    $.fn.ready(function(){
        $('#feedback-form').submit(function(e){
            var url = "/usr/submitFeedback?" + $(this).serialize();

            $.ajax({
                type: "GET",
                url: url,
                dataType: "json",
                success: function (response) {
                    if(response.success == '0')
                    {
                        alert(response.error);
 private static function get_notification_message($link)
 {
     $header = '<h1>' . Core::translateToCurrentLocale("Hello") . ', </h1>
     <p class="lead">' . Core::translateToCurrentLocale("you have registered money withdraw from the Bitmonex exchange") . '.</p>';
     $body = '<p>' . Core::translateToCurrentLocale("To confirm your withdrawing, please click on this link") . '. <a href="' . $link . '">' . Core::translateToCurrentLocale("Withdraw money") . '!</a></p>';
     return usr::getMessage($header, $body);
 }
Пример #19
0
                <label for="account"><?php 
print Core::translateToCurrentLocale('Type account');
?>
</label>
                <input id="account" type="text" name="ACCOUNT">
            </div>
            <div class="form-group">
                <label for="share"><?php 
print Core::translateToCurrentLocale('Type share');
?>
 (%):</label>
                <input id="share" type="text" name="SHARE">
            </div>
            <div class="form-group">
                <button type="submit" class="btn btn-default input-sm"><?php 
print Core::translateToCurrentLocale('Add wallet');
?>
</button>
            </div>
        </form>
    </div>
    <div class="YMWalletsList">
        <?php 
if (count($wallets) > 0) {
    ?>
            <?php 
    foreach ($wallets as $key => $value) {
        ?>
                <div class="YMWallet">
                    Account: <?php 
        print $value['account'];
Пример #20
0
                            <table class="row">
                                <tr>
                                    <td class="wrapper last">

                                        <table class="twelve columns">
                                            <tr>
                                                <td align="center">
                                                    <center>
                                                        <p style="text-align:center;"><a href="#"><?php 
echo Core::translateToCurrentLocale("Terms");
?>
</a> | <a href="#"><?php 
echo Core::translateToCurrentLocale("Privacy");
?>
</a> | <a href="#"><?php 
echo Core::translateToCurrentLocale("Unsubscribe");
?>
</a></p>
                                                    </center>
                                                </td>
                                                <td class="expander"></td>
                                            </tr>
                                        </table>

                                    </td>
                                </tr>
                            </table>

                            <!-- container end below -->
                        </td>
                    </tr>
        print $value['order_id'];
        ?>
');" value="<?php 
        print Core::translateToCurrentLocale('Cancel');
        ?>
">
                            </td>
                        </tr>
                    <?php 
    }
    ?>
                <?php 
} else {
    ?>
                    <tr>
                        <td colspan="6" class="greenMark" style="text-align: left; padding-left: 31px;">
                            <img src="public/img/other/not.png">
                            <?php 
    print Core::translateToCurrentLocale('No active orders at the moment');
    ?>
.
                        </td>
                    </tr>
                <?php 
}
?>
                </tbody>
            </table>
        </div>
    </div>
</div>
if (isset($data['firstCurrency'])) {
    $currentRate = $data;
} else {
    if (isset($_GET['Data'])) {
        $currentRate = $_GET['Data'];
    }
}
if (isset($currentRate['firstCurrency'])) {
    $rateInfo = api::rateInfo($currentRate['firstCurrency'], $currentRate['secondCurrency']);
    $maxPrice = $rateInfo['bid'];
    $minPrice = $rateInfo['ask'];
}
$id = $currentRate['firstCurrency'] . $currentRate['secondCurrency'];
?>
<div class="title greenMark"><?php 
print Core::translateToCurrentLocale('Special kinds of deals');
?>
:</div>
<form class="specialtrade">
    <input type="hidden" name="firstCurrency" value="<?php 
print $currentRate['firstCurrency'];
?>
">
    <input type="hidden" name="secondCurrency" value="<?php 
print $currentRate['secondCurrency'];
?>
">
    <span class="trade-radio">
        <label><input name="type" class="buy" type="radio" value="buy" checked="checked" onclick='(function(obj){$(obj).closest("div").children().find(".Limit").val("BuyLimit"); $(obj).closest("div").children().find(".Stop").val("BuyStop"); $(obj).closest("div").children().find(".price").attr("placeholder","<?php 
print $maxPrice;
?>
    ?>
<div id="anchorList" class="anchorList">
    <div id="anchor" class="anchor"></div>
    <ul>
    <a href="#topBar"><li onclick="selectAnchor(this);"><?php 
    print Core::translateToCurrentLocale("Dashboard");
    ?>
</li></a>
        <?php 
    foreach ($data as $key => $value) {
        ?>
        <?php 
        if (isset($value['widget_info']['widget_name'])) {
            ?>
            <a href="#<?php 
            print $value['widget_info']['widget_name'];
            ?>
"><li onclick="selectAnchor(this);"><?php 
            print Core::translateToCurrentLocale($value['widget_info']['official_name']);
            ?>
</li></a>
        <?php 
        }
        ?>
    <?php 
    }
    ?>
    </ul>
</div>
<?php 
}
Пример #24
0
<form method="get" class="form-money form-horizontal in" role="form" name='YM_in' style="display: none" action="/money/YM_transaction">
    <div class="submit-dialog-captions"><?php 
print Core::translateToCurrentLocale("Value");
?>
:</div>
    <input type="text" name="value"><br>
    <input type="submit" value="Submit">
</form>

<form method="get" class="form-money form-horizontal" role="form" name='YM_out' style="display: none" action="/money/YM_transaction_o">
    <div class="submit-dialog-captions"><?php 
print Core::translateToCurrentLocale("Value");
?>
:</div>
    <input type="text" name="value"><br>
    <div class="submit-dialog-captions">To:</div>
    <input type="text" id="yp" name="yar_path"><br>
    <input class="btn" type="submit" value="Submit">
</form>
            $("#submit").removeAttr('disabled');
        };

        var method = ($("#pass1").val()!=$("#pass2").val() ? success : error);
        method();
    }
    function send()
    {
        var formid = "#registerform";
        var url = "usr/register";
        var data = $(formid).serialize();
        Ajax.exec(url, data, function(result)
        {
            var success = function(){
                alert("<?php 
print Core::translateToCurrentLocale('You have successfully registered! Please, enter into your email to confirm');
?>
.");
                hideLoader();
            };
            var error = function(){
                alert(result.error);
                $("#captchaImg").attr("src","/api/captcha");
                $("#captcha").val("");
            };

            var method = (result.success ? success : error);
            method();
        });
    }
</script>