<html>
    <head>
        <meta content="text/html; charset=utf-8" />
    </head>
    <body>
        <div>
            <h3>API клиента Pumpit</h3>
            <a href="http://1685544596.pumpit.ru/">Тестовая зона</a>
        </div>
        <br/>
        <div>
            <fieldset>
                <legend><b>Данные для приложения</b></legend>
                APP_ID = <?php echo $pumpit->app_id; ?><br/>
                KEY_API = <?php echo $pumpit->key_api; ?><br/>
                KEY_BILLING = <?php echo $pumpit->key_billing; ?><br/>
            </fieldset>
        </div>
        <br/>
        <div>
            <fieldset>
                <legend><b>Проксирование</b></legend>
                HTTP_X_HOST <?php if (isset($_SESSION['x_host'])) echo $_SESSION['x_host']; ?> <br/>
                HTTP_X_PARTNER <?php if (isset($_SESSION['x_partner'])) echo $_SESSION['x_partner']; ?> <br/>
            </fieldset>
        </div>
        <br/>
        <div>
            <fieldset>
                <legend><b>Виджеты</b></legend>
                <?php
                $widgets = $pumpit->getWidgets($_SESSION['p_sid']);
                echo "Хедер" . "<br/>";
                echo $widgets['header'];
                echo "Футер" . "<br/>";
                echo $widgets['footer'];
                ?>
            </fieldset>
        </div>
        <br/>
        <div>
            <fieldset>
                <legend><b>Сессия</b></legend>
                <?php
                echo "Pumpit ID  - " . $_SESSION['pumpit_id'] . "<br/>";
                echo "Pumpit SID - " . $_SESSION['p_sid'] . "<br/><br/>";
                echo '<a href="?logout=1">Сбросить сессию</a>';
                ?>
            </fieldset>
        </div>
        <br/>
        <div>
            <fieldset>
                <legend><b>Информация по профилю абонента</b></legend>
                <?php
                if ($_SESSION['p_sid']) {
                    $status = $_SESSION['p_user_info']['status'];
                    if (empty($status)) {
                        $sex = $_SESSION['p_user_info']['sex'];
                        if ($sex == 1) {
                            $sex = 'мужской';
                        } elseif ($sex == 2) {
                            $sex = 'женский';
                        } else {
                            $sex = 'не указан';
                        }
                        echo "Логин: " . $_SESSION['p_user_info']['login'] . "<br/>";
                        echo "Ник: " . $_SESSION['p_user_info']['nick'] . "<br/>";
                        echo "Время регистрации: " . $_SESSION['p_user_info']['reg_time'] . "<br/>";
                        echo "Число монет: " . $_SESSION['p_user_info']['coin'] . "<br/>";
                        echo "Пол: " . $sex . "<br/>";
                        if (isset($_SESSION['p_user_info']['avatar'])) {
                            echo "<img src=\"" . $_SESSION['p_user_info']['avatar'] . "\" alt=\"аватар\" />" . "<br/>";
                        }
                    } elseif ($status == 21) {
                        echo "Пользователь не найден";
                    }
                } else {
                    echo "<p>Пользователь не авторизован</p>";
                    echo '<form action="">';
                    echo '<input type="hidden" value="auth" name="action" />';
                    echo '<input name="button" value="Авторизоваться" type="submit" onclick=""/>';
                    echo '</form>';
                }
                ?>
            </fieldset>
        </div>
        <br/>
                <?php
                if ($_SESSION['p_sid']) {
                    ?>
            <div>
                <fieldset>
                    <legend><b>Кнопки</b></legend>
                    <form action="">
                        <input type="hidden" value="wallet" name="action" />
                        <input name="button" value="Кошелек" type="submit" onclick=""/>
                    </form>
                    <form action="">
                        <input type="hidden" value="back" name="action" />
                        <input name="button" value="Вернуться" type="submit" onclick=""/>
                    </form>
                </fieldset>
                <br/>
                <form action="">
                    <fieldset>
                        <legend><b>Покупка чего-либо</b></legend>

                        <input type="hidden" value="1" name="coin" />
                        <input type="hidden" value="pay" name="action" />
                        <span>Купить за <span><input name="button" value="1 монета" type="submit" onclick=""/>
                                </fieldset>
                                </form>
                                </div>
    <?php
}
?>

                            </body>
                            </html>