Facebook
From Hot Mosquito, 9 Years ago, written in PHP.
Embed
Download Paste or View Raw
Hits: 858
  1. <?php
  2. #       Autor / Author = MYDESIGNER.PL
  3. #       Zakaz publikowania kodu źródłowego bez zgody autora
  4. #      
  5. #       Chciałbyś, mieć autorski system zarządzania stroną bądź sms shopa, strone itp...
  6. #       W takim celu zapraszam na WWW.MYDESIGNER.PL
  7. #
  8. #       Wszystkie skrypty zostały wykonane przezemnie
  9. #
  10. #       !!! --> Jeżeli w stopce nie będzie autora, oznacza to że złamałeś licencje oraz regulamin użtkowania.
  11. #       !!! --> Co grozi karą taką jak za złamanie praw autorskich
  12.  
  13.  
  14. include_once('__main.php');
  15. ?>
  16. <!DOCTYPE html>
  17. <html lang="pl">
  18. <head>
  19.         <meta charset="utf-8">
  20.         <meta http-equiv="X-UA-Compatible" content="IE=edge">
  21.         <meta name="viewport" content="width=device-width, initial-scale=1">
  22.         <meta name="description" content="<?php echo $config['description']; ?>">
  23.         <meta name="author" content="MYDESIGNER.PL >> BARTOSZ GRZEGORZ WALCZAK">
  24.         <link rel="shortcut icon" href="<?php echo $config['icon']; ?>">
  25.         <title><?php echo $config['nazwa_strony']; ?></title>
  26.         <link href="assest/css/bootstrap.min.css" rel="stylesheet">
  27.         <link href="assest/css/bootstrap-theme.min.css" rel="stylesheet">
  28.         <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
  29.         <link href="style.css" rel="stylesheet">
  30. </head>
  31. <body>
  32.     <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
  33.       <div class="container">
  34.         <div class="navbar-header">
  35.           <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
  36.             <span class="sr-only">Toggle navigation</span>
  37.             <span class="icon-bar"></span>
  38.             <span class="icon-bar"></span>
  39.             <span class="icon-bar"></span>
  40.           </button>
  41.           <a class="navbar-brand" href="#"><?php echo $config['nazwa_serwera']; ?></a>
  42.         </div>
  43.         <div class="navbar-collapse collapse">
  44.           <ul class="nav navbar-nav">
  45.                         <?php
  46.                         if(isset($_GET['shop'])){
  47.                         echo'
  48.            <li><a href="index.php"><i class="fa fa-home"></i> STRONA GŁÓWNA</a></li>
  49.            <li class="active"><a href="index.php?shop=show"><i class="fa fa-shopping-cart"></i> SKLEP</a></li>
  50.                         <li><a href="index.php?kontakt=show"><i class="fa fa-envelope"></i> KONTAKT</a></li>
  51.                         ';
  52.                         }elseif(isset($_GET['item'])){
  53.                         echo'
  54.            <li><a href="index.php"><i class="fa fa-home"></i> STRONA GŁÓWNA</a></li>
  55.            <li class="active"><a href="index.php?shop=show"><i class="fa fa-shopping-cart"></i> SKLEP</a></li>
  56.                         <li><a href="index.php?kontakt=show"><i class="fa fa-envelope"></i> KONTAKT</a></li>
  57.                         ';
  58.                         }elseif(isset($_GET['kontakt'])){
  59.                         echo'
  60.            <li><a href="index.php"><i class="fa fa-home"></i> STRONA GŁÓWNA</a></li>
  61.            <li><a href="index.php?shop=show"><i class="fa fa-shopping-cart"></i> SKLEP</a></li>
  62.                         <li class="active"><a href="index.php?kontakt=show"><i class="fa fa-envelope"></i> KONTAKT</a></li>
  63.                         ';
  64.                         }else{
  65.                         echo '
  66.            <li class="active"><a href="index.php"><i class="fa fa-home"></i> STRONA GŁÓWNA</a></li>
  67.            <li><a href="index.php?shop=show"><i class="fa fa-shopping-cart"></i> SKLEP</a></li>
  68.                         <li><a href="index.php?kontakt=show"><i class="fa fa-envelope"></i> KONTAKT</a></li>
  69.                         ';
  70.                         }
  71.                         ?>
  72.           </ul>
  73.         </div><!--/.nav-collapse -->
  74.       </div>
  75.     </div>
  76.  
  77.         <div class="container">
  78.                 <div class="row">
  79.                
  80.                         <div class="col-md-12">
  81.                                 <ol class="breadcrumb shadow">
  82.                                         <?php echo $config['nazwa_serwera']; ?>
  83.                                        
  84.                                         <span class="pull-right">
  85.                                                 IP: <?php echo $config['rcon_address']; ?>
  86.                                                 <a href="http://www.mydesigner.pl"><button type="button" class="btn btn-xs btn-primary">MYDESIGNER.PL</button></a>
  87.                                         </span>
  88.                                 </ol>
  89.                         </div>
  90.                
  91.                         <div class="col-md-12">
  92.                                 <div id="carousel-example-generic" class="shadow carousel slide" data-ride="carousel">
  93.                                
  94.                                   <!-- Indicators -->
  95.                                   <ol class="carousel-indicators">
  96.                                         <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
  97.                                         <li data-target="#carousel-example-generic" data-slide-to="1"></li>
  98.                                   </ol>
  99.  
  100.                                   <!-- Wrapper for slides -->
  101.                                   <div class="carousel-inner">
  102.                                         <div class="item active">
  103.                                           <img src="http://placehold.it/1240x420" alt="...">
  104.                                         </div>
  105.                                        
  106.                                         <div class="item">
  107.                                           <img src="http://placehold.it/1240x420" alt="...">
  108.                                         </div>
  109.                                   </div>
  110.  
  111.                                   <!-- Controls -->
  112.                                   <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
  113.                                         <span class="glyphicon glyphicon-chevron-left" style=""></span>
  114.                                   </a>
  115.                                   <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
  116.                                         <span class="glyphicon glyphicon-chevron-right"></span>
  117.                                   </a>
  118.                                 </div>
  119.                         </div>
  120.                        
  121.                         <div class="clear"></div>
  122.                        
  123.                         <?php
  124.                         if($_GET['shop'] == 'show'){
  125.                                 echo'<div class="col-md-12">';
  126.                                 foreach($config['offers'] as $id=>$offer):
  127.                                 if($offer['aktywna'] == TRUE){
  128.                                         echo '
  129.                                                 <div class="col-sm-4">
  130.                                                   <div class="panel panel-default shadow">
  131.                                                         <div class="panel-heading">
  132.                                                           <h3 class="panel-title"><a href="#">'.$offer['nazwa'].'</a></h3>
  133.                                                                 <span class="pull-right" style="margin-top: -21px;">
  134.                                                                         <button type="button" class="btn btn-xs btn-success"><i class="fa fa-check"></i></button>
  135.                                                                 </span>
  136.                                                         </div>
  137.                                                         <div class="panel-body">
  138.                                                           <img src="'.$offer['img_small'].'" width="32px" height="32px"/>
  139.                                                           '.$offer['opis_small'].'
  140.                                                           <div class="clear"></div>
  141.                                                                 <span class="pull-left" style="">
  142.                                                                         <button type="button" class="btn btn-xs btn-info">'.$offer['cena'].' zł + vat</button>
  143.                                                                 </span>
  144.                                                                 <span class="pull-right" style="">
  145.                                                                         <form method="POST" action="?item='.$id.'">
  146.                                                                                 <input name="cena" type="text" style="display:none;" value="'.$offer['cena'].'">
  147.                                                                                 <input name="nazwa" type="text" style="display:none;" value="'.$offer['nazwa'].'">
  148.                                                                                 <input name="opis" type="text" style="display:none;" value="'.$offer['opis'].'">
  149.                                                                                 <input name="ikona" type="text" style="display:none;" value="'.$offer['img_small'].'">
  150.                                                                                 <input name="komenda" type="text" style="display:none;" value="'.$offer['komenda'].'">
  151.                                                                                 <input name="numer" type="text" style="display:none;" value="'.$offer['numer'].'">
  152.                                                                                 <input name="tresc" type="text" style="display:none;" value="'.$offer['tresc'].'">
  153.                                                                                 <button type="submit" name="ok" class="btn btn-xs btn-info"><i class="fa fa-shopping-cart"></i></button>
  154.                                                                         </form>
  155.                                                                 </span>
  156.                                                         </div>
  157.                                                   </div>
  158.                                                 </div><!-- /.col-sm-4 -->
  159.                                         ';
  160.                                 }else{
  161.                                         echo '
  162.                                                 <div class="col-sm-4">
  163.                                                   <div class="panel panel-default shadow">
  164.                                                         <div class="panel-heading">
  165.                                                           <h3 class="panel-title"><a href="#">RANGA VIP</a></h3>
  166.                                                                 <span class="pull-right" style="margin-top: -21px;">
  167.                                                                         <button type="button" class="btn btn-xs btn-danger"><i class="fa fa-stop"></i></button>
  168.                                                                 </span>
  169.                                                         </div>
  170.                                                         <div class="panel-body">
  171.                                                           Ta usługa została wycofana z sklepu !
  172.                                                         </div>
  173.                                                   </div>
  174.                                                 </div><!-- /.col-sm-4 -->
  175.                                         ';
  176.                                 }                              
  177.                                 endforeach;                    
  178.                                 echo'</div>';
  179.                         }elseif(isset($_GET['item'])){
  180.                                 # Pobieranie danych z forumlarza, wybierania itemu z itemshopu :D
  181.                                 $cena = $_POST['cena'];
  182.                                 $nazwa = $_POST['nazwa'];
  183.                                 $opis = $_POST['opis'];
  184.                                 $img_small = $_POST['ikona'];
  185.                                 $komenda = $_POST['komenda'];
  186.                                 $id = $_GET['item'];
  187.                                 $numer = $_POST['numer'];
  188.                                 $tresc = $_POST['tresc'];
  189.                                
  190.                                         if(isset($_POST['ok'])){
  191.                                                 echo '
  192.                                                 <div class="col-md-12">
  193.                                                         <div class="itemshop">
  194.                                                                 <div class="col-md-6">
  195.                                                                         Wybrany Przedmiot: <strong>'.$nazwa.'</strong>
  196.                                                                         <hr>
  197.                                                                         <p>
  198.                                                                         '.$opis.'
  199.                                                                         </p>
  200.                                                                 </div>
  201.                                                                 <div class="col-md-2">
  202.                                                                 <strong>Jak zakupić ?</strong>
  203.                                                                 <hr>
  204.                                                                 Wyśli smsa na: <b>'.$numer.'</b>
  205.                                                                 <br>
  206.                                                                 O treści: <b>'.$tresc.'</b>
  207.                                                                 <Br>
  208.                                                                 Koszt: <b>'.$cena.' zł + vat</b>
  209.                                                                 <br>
  210.                                                                 <Br>
  211.                                                                 Wyśli smsa, z podanymi informacjami i przepisz kod zwrotny w odpowiednie pole !
  212.                                                                 </div>
  213.                                                                 <div class="col-md-4">
  214.                                                                         <form method="POST">
  215.                                                                           <div class="form-group">
  216.                                                                                 <label>Nazwa Użytkownika</label>
  217.                                                                                 <input name="nick" type="text" class="form-control" placeholder="Nazwa użytkownika">
  218.                                                                           </div>
  219.                                                                          
  220.                                                                           <div class="form-group">
  221.                                                                                 <label>Kod Zwrotny</label>
  222.                                                                                 <input name="kod" type="text" class="form-control" placeholder="Kod zwrotny z smsa">
  223.                                                                           </div>
  224.                                                                          
  225.                                                                           <button name="SMS_SHOP" type="submit" class="btn btn-default">Kupuje</button>
  226.                                                                         </form>
  227.                                                                 </div>
  228.                                                         </div>
  229.                                                 </div>
  230.                                                 ';
  231.                                         }elseif(isset($_POST['SMS_SHOP'])){
  232.                                                 $nick = $_POST['nick'];
  233.                                                 $kod = $_POST['kod'];
  234.                                                 if($nick != '') {
  235.                                                         define( 'MQ_SERVER_ADDR', '212.91.26.68' ) ; // adres IP Twojego Serwera  
  236.                                                         define( 'MQ_SERVER_PORT', '25725' ); // Port rcon który ustawiłeś/aś w pliku serwer.properties
  237.                                                         define( 'MQ_SERVER_PASS', '96031303993' ); // hasło które ustawiłeś/aś w pliku ser
  238.                                                                 define( 'MQ_TIMEOUT', 2 );
  239.                                                                         include('_include/MinecraftRcon.class.php');                                                           
  240.                                                                         echo '<div id="Wrap">';
  241.                                                                         $handle = fopen("http://homepay.pl/sms/check_code.php?usr_id=".$config['user_id']."&acc_id=".$config['sms_id']."&code=".$kod, "r");
  242.                                                                         $status = fgets($handle, 8);
  243.                                                                         fclose($handle);
  244.  
  245.                                                                         if(empty($nick) || empty($kod))
  246.                                                                         {
  247.                                                                                 $message = "Wypełnij wszystkie pola.";
  248.                                                                         }
  249.                                                                         else if($status == 3 || preg_match('/[^0-9A-Za-z]/', $kod) )
  250.                                                                         {
  251.                                                                                 $message = "Nieprawidlowy kod.";
  252.                                                                         }
  253.                                                                         else if($status == 0)
  254.                                                                         {
  255.                                                                                 try{
  256.                                                                                        
  257.                                                                                         $Rcon = new MinecraftRcon;                             
  258.                                                                                         $Rcon->Connect( MQ_SERVER_ADDR, MQ_SERVER_PORT, MQ_SERVER_PASS, MQ_TIMEOUT );                                                                                  
  259.                                                                                         $zmiana = str_replace('{PLAYER}', ''.$nick.'', $komenda);                                                                                                              
  260.                                                                                         $Data = $Rcon->Command( ''.$zmiana.'' );
  261.                                                                                                                                
  262.                                                                                         if( $Data === false ){
  263.                                                                                                 throw new MinecraftRconException( "Brak odpowiedzi." );
  264.                                                                                         }
  265.                                                                                         else if( StrLen( $Data ) == 0 )
  266.                                                                                         {
  267.                                                                                         throw new MinecraftRconException( "Komenda jest pusta." );
  268.                                                                                         }
  269.                                                                                                                                
  270.                                                                                          HTMLSpecialChars( $Data );
  271.                                                                                         }
  272.                                                                                         catch( MinecraftRconException $e )
  273.                                                                                         {
  274.                                                                                                 echo $e->getMessage( );
  275.                                                                                         }
  276.                                                                                        
  277.                                                                                         $Rcon->Disconnect( );
  278.                                                                                        
  279.                                                                                         echo'
  280.                                                                                                 <div class="col-md-12">
  281.                                                                                                   <div class="alert alert-success">
  282.                                                                                                         <strong>GRATULACJE !</strong> Zakupiono usługe w itemshopie ! '.$zmiana.'
  283.                                                                                                   </div>
  284.                                                                                                 </div>
  285.                                                                                         ';
  286.                                                                                 }
  287.                                                                                 else
  288.                                                                                 {
  289.                                                                                         $message = "Błąd w połączeniu z operatorem.";
  290.                                                                                 }
  291.                                                                                
  292.                                                                                 if( isset($message) )
  293.                                                                                 {
  294.                                                                                         echo '
  295.                                                                                         <div class="col-md-12">
  296.                                                                                           <div class="alert alert-danger">
  297.                                                                                                 <strong>ERROR !</strong> '.$message.'
  298.                                                                                           </div>
  299.                                                                                         </div>
  300.                                                                                         ';
  301.                                                                                         $erno = 1;
  302.                                                                                 }
  303.                                                 }else{
  304.                                                         echo '
  305.                                                         <div class="col-md-12">
  306.                                                           <div class="alert alert-danger">
  307.                                                                 <strong>ERROR !</strong> Brak nazwy użytkownika
  308.                                                           </div>
  309.                                                         </div>
  310.                                                         ';
  311.                                                 }
  312.                                         }else{
  313.                                         echo '
  314.                                         <div class="col-md-12">
  315.                                           <div class="alert alert-danger">
  316.                                                 <strong>ERROR !</strong> Aby zobaczyć podgląd usługi proszę wejść przez SKLEP !
  317.                                           </div>
  318.                                         </div>
  319.                                         ';
  320.                                         }
  321.                         }else{
  322.                         ?>
  323.                        
  324.                         <?php
  325.                         }
  326.                         ?>
  327.                         <div class="clear" style="height:50px;"></div>
  328.                         <footer>
  329.                         <?php footer(); ?>
  330.                         </footer>
  331.                 </div>
  332.         </div>
  333.        
  334. </body>
  335. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  336. <script src="assest/js/bootstrap.min.js"></script>
  337. <script src="assest/js/docs.min.js"></script>
  338. </html>