Last active
April 27, 2018 20:38
-
-
Save Wohaho/41f7f4911553e624fe377a3524259351 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
date_default_timezone_set('Europe/Sofia'); //Задаваме времева зона | |
$starttime = explode(' ', microtime()); //Стартираме | |
$starttime = $starttime[1] + $starttime[0]; //Микротаймера | |
// Websend настройки | |
include_once 'Websend.php'; | |
// Websend api | |
$ws = new Websend("164.132.29.142"); //IP на сървъра | |
$ws->password = "123456"; //Паролата от config файла на сървъра | |
$errormsg = ''; //Да има... (Не попълвай.) | |
// Настройки | |
$siteTitle = "Сайт име"; //Име на сайта | |
$siteDescription = "Сайт описание"; //Description | |
$siteNavTextTitle = "BG MC"; //Текста на шапката | |
// ---/ | |
$smsSendInfo = "Изпрати смс на номер <b>1974</b> с текст <b>bgmc</b> цена на смс 4.80лв с ДДС!(Общо 4,80 Лева!) <p>ВАЖНО! Преди да закупите bedrock трябва да сте в сървъра! </p> <p>ВАЖНО! Преди да закупите bedrock трябва да сте в сървъра! </p> <p>ВАЖНО! Преди да закупите bedrock трябва да сте в сървъра! </p>"; //Информация за изпращане на смс-а | |
// Функция за връзка с mobio.bg | |
function mobio_checkcode($servID, $code, $debug = 0) | |
{ | |
$res_lines = file("http://admin.telebid.org/campaign/check-code?service=PbjKcP9BywYGmqSyYLFovYK_zXFViXr-&code=$code"); | |
$ret = 0; | |
if ($res_lines) | |
{ | |
if (strstr("PAYBG=OK", $res_lines[0])) | |
{ | |
$ret = 1; | |
} | |
else | |
{ | |
if ($debug) echo $line . "\n"; | |
} | |
} | |
else | |
{ | |
if ($debug) echo "Unable to connect to mobio.bg server.\n"; | |
$ret = 0; | |
} | |
return $ret; | |
} | |
// Заявката | |
if (isset($_POST['submit'])) | |
{ | |
$code = htmlspecialchars(addslashes(trim($_POST['code']))); | |
$playername = htmlspecialchars(addslashes($_POST['playername'])); | |
if ($ws->connect()) | |
{ //проверяваме дали сървъра е пуснат... | |
if ($playername == NULL | $code == NULL) | |
{ //Проверяваме дали полетата са попълнени | |
$errormsg = '<center><div class="alert alert-danger" role="alert">Попълнете всички полета!</div></center>'; //Ако полетата са празни изписва това. | |
} | |
else | |
{ | |
if (mobio_checkcode($servID, $code, 0) == 1) | |
{ //Проверяваме мобио кода | |
$ws->doCommandAsConsole("bd $playername"); //Съответно ако искаш за един месец можеш да видиш в wiki-то на pex за lifetime | |
$ws->disconnect(); | |
$errormsg = '<center><div class="alert alert-success" role="alert">Ти закупи 32 Bedrock!</div></center>'; //Съобщение за Активирана група... | |
} | |
else | |
{ | |
$errormsg = '<center><div class="alert alert-danger" role="alert">СМС КОДА Е ГРЕШЕН! Опитай отново!</div></center>'; //Ако кода е грешен изписва това. | |
} | |
} | |
} | |
else | |
{ | |
$errormsg = '<center><div class="alert alert-danger" role="alert">Сървъра е офлайн, моля ела отново когато е пуснат!</div></center>'; //Ако сървъра е спрян изписва това.. | |
} | |
} | |
?> | |
<!DOCTYPE html> | |
<html lang="bg"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content="<?php echo $siteDescription; ?>"> | |
<link rel="icon" href="http://getbootstrap.com/favicon.ico"> | |
<title><?php echo $siteTitle; ?></title> | |
<!-- Bootstrap core CSS --> | |
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet"> | |
<!-- Custom styles for this template --> | |
<link href="http://getbootstrap.com/examples/jumbotron-narrow/jumbotron-narrow.css" rel="stylesheet"> | |
<!-- Just for debugging purposes. Don't actually copy these 2 lines! --> | |
<!--[if lt IE 9]><script src="http://getbootstrap.com/assets/js/ie8-responsive-file-warning.js"></script><![endif]--> | |
<script src="http://getbootstrap.com/assets/js/ie-emulation-modes-warning.js"></script> | |
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> | |
<!--[if lt IE 9]> | |
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> | |
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> | |
<![endif]--> | |
</head> | |
<body> | |
<div class="container"> | |
<?php echo $errormsg; //shows erros ?> | |
<div class="row marketing"> | |
<div class="alert alert-warning" role="alert"><?php echo $smsSendInfo; ?></div> | |
<form method="post" action=""> | |
<div class="form-group"> | |
<label for="playername"><font color="black">Minecraft име <font color="red">*</font></label> | |
<input type="text" class="form-control" name="playername" placeholder="Въведи точно името си от сървъра!"> | |
</div> | |
<div class="form-group"> | |
<label for="smscode"><font color="black">СМС Код <font color="red">*</font></label> | |
<input type="text" class="form-control" name="code" placeholder="Въведи смс кода който получи!"> | |
</div> | |
<input type="submit" class="btn btn-success" name="submit" value="Изпълни" /> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment