Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Poszukuje webmastera


Evisar

Rekomendowane odpowiedzi

Opublikowano

Witam
Mam taki skrypt do sms shopa. Wszystko działa ale jak wpisuje poprawny kod wyskakuje ze jest nieprawidłowy. -.- 
Mam prośbę czy mógłby ktoś zerknąć co jest nie tak ? Oczywiście nie za darmo  :)

Kontakt GG: 52485684

-->
<script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	var first_imageSource = $("select[name=offer] option:first").val();
      window.name = first_imageSource;

	$('select[name=offer]').keyup(function() {
	var imageSource = $("select[name=offer]").val();
      $cos = "#" + window.name;
      $($cos).fadeOut(10);
	$name = "#" + $('#offer').val();
       $($name).fadeIn();
        window.name = imageSource;
	});

    $("select[name=offer]").change(function() {
        var imageSource = $("select[name=offer]").val();
      $cos = "#" + window.name;
      $($cos).fadeOut(10);
	$name = "#" + $('#offer').val();
       $($name).fadeIn();
        window.name = imageSource;
    });
});
</script>


<?php
include("config.php");
/**
 * Shop Script Configuration
 */

$offer = array(array());
 
$shop['id'] = '88888'; //ID klienta dotpay

if($_GET['buy'] == "thing"){ // konfiguracja dla przedmiotow

$offer[1]['offer_type'] = "item"; 
$offer[1]['item_id'] = 2644;
$offer[1]['item_name'] = "Extra Boots";
$offer[1]['desc'] = "Item.";
$offer[1]['number'] = 888888; //numer na ktory trzeba wyslac sms
$offer[1]['code'] = "AP.DSSS"; //tresc smsa
$offer[1]['price'] = "6.15"; //koszt smsa



} if($_GET['buy'] == "premium"){ // konfiguracja dla premium

$offer[1]['offer_type'] = 'unban';
$offer[1]['item_name'] = "Unban";
$offer[1]['desc'] = "Usuniecie bana z postaci.";
$offer[1]['number'] = 73955; //numer na ktory trzeba wyslac sms
$offer[1]['code'] = "AP.ASSa"; //tresc smsa(bez AP.)
$offer[1]['price'] = "3.69"; //koszt smsa

$offer[2]['offer_type'] = 'skull';
$offer[2]['item_name'] = "Usuniecie skull";
$offer[2]['desc'] = "Usuniecie skull'a (Red, White) oraz fragów z postaci.";
$offer[2]['number'] = 73955; //numer na ktory trzeba wyslac sms
$offer[2]['code'] = "AP.ASSA3"; //tresc smsa(bez AP.)
$offer[2]['price'] = "3.69"; //koszt smsa

}


/**
 * Shop main Script
 */

$erno = 0;
$offer[0]['offer_type'] = 'error';

if($_GET['buy'] == "premium")
    $offer[0]['item_name'] = "Wybierz z listy..";
else
    $offer[0]['item_name'] = "Wybierz przedmiot..";

$offerId = $_POST['offer'];
$players_folder = $todata.'/players/';
$acc_folder = $todata.'/accounts/';

if( $offer[$offerId]['offer_type'] == 'unban' )
{
    $nick = $_POST['nick'];
    $check = $_POST['check'];
    $file = $players_folder.$nick.'.xml';
	
    if( file_exists($file) )
    {
        //Sprawdzacz kodu
	$id   = $shop['id'];
	$code = $offer[$offerId]['code'];
        $handle = fopen("http://dotpay.pl/check_code.php?id=".$id."&code=".$code."&check=".$check."&type=sms&del=1", "r");
        $status = fgets($handle, 8);
       	fclose($handle);

	if( empty($check) || empty($nick) )
            $message = "Please fill all fields.";
        else if( preg_match('/[^0-9A-Za-z]/', $check) )
            $message = "Kod jest nieprawidlowy.";
        else if( $status == 0 )
            $message = "Kod jest nieprawidlowy.";
        else
        {
            $xml = simplexml_load_file($file);
	    $xml['banned'] = 0;
	    $xml->ban['banned'] = 0;
	    $xml->ban['banstart'] = 0;
	    $xml->ban['banend'] = 0;
	    $xml->ban['reason'] = "";
	    $xml->ban['action'] = "";
	    $xml->ban['deleted'] = 0;
	    $xml->ban['finalwarning'] = 0;
	    $xml->ban['namelock'] = 0;
            $xml->asXML($file);
	    $message = "You have been unbanned.";
        }
    }
    else
	$message = "<font color='red'><b>This character do not exists!</b></font>";
}

else if( $offer[$offerId]['offer_type'] == 'access' )
{
    $nick = $_POST['nick'];
    $check = $_POST['check'];
    $file = $players_folder.$nick.'.xml';
	
    if( file_exists($file) )
    {
        //Sprawdzacz kodu
	$id   = $shop['id'];
	$code = $offer[$offerId]['code'];
        $handle = fopen("http://dotpay.pl/check_code.php?id=".$id."&code=".$code."&check=".$check."&type=sms&del=1", "r");
        $status = fgets($handle, 8);
       	fclose($handle);

	if( empty($check) || empty($nick) )
            $message = "Please fill all fields.";
        else if( preg_match('/[^0-9A-Za-z]/', $check) )
            $message = "Kod jest nieprawidlowy.";
        else if( $status == 0 )
            $message = "Kod jest nieprawidlowy.";
        else
        {
            $xml = simplexml_load_file($file);
	    $xml['access'] = 3;
            $xml->asXML($file);
	    $message = "Dostales pozycje GM.";
        }
    }
    else
	$message = "<font color='red'><b>This character do not exists!</b></font>";
}

else if( $offer[$offerId]['offer_type'] == 'skull' )
{
    $nick = $_POST['nick'];
    $check = $_POST['check'];
    $file = $players_folder.$nick.'.xml';
	
    if( file_exists($file) )
    {
        //Sprawdzacz kodu
	$id   = $shop['id'];
	$code = $offer[$offerId]['code'];
        $handle = fopen("http://dotpay.pl/check_code.php?id=".$id."&code=".$code."&check=".$check."&type=sms&del=1", "r");
        $status = fgets($handle, 8);
       	fclose($handle);

	if( empty($check) || empty($nick) )
            $message = "Please fill all fields.";
        else if( preg_match('/[^0-9A-Za-z]/', $check) )
            $message = "Kod jest nieprawidlowy.";
        else if( $status == 0 )
            $message = "Kod jest nieprawidlowy.";
        else
        {
            $xml = simplexml_load_file($file);
	    $xml->skull['type'] = 0;
	    $xml->skull['kills'] = 0;
	    $xml->skull['ticks'] = 0;
	    $xml->skull['absolve'] = 0;
            $xml->asXML($file);
	    $message = "Skull'e oraz fragi zostaly usuniete.";
        }
    }
    else
	$message = "<font color='red'><b>This character do not exists!</b></font>";
}

else if( $offer[$offerId]['offer_type'] == 'item' )
{
    $nick = $_POST['nick'];
    $check = $_POST['check'];
    $file = $players_folder.$nick.'.xml';
    $item_id = $offer[$offerId]['item_id'];
	
    if( file_exists($file) ) 
    {
        //Sprawdzacz kodu
	$id   = $shop['id'];
	$code = $offer[$offerId]['code'];
        $handle = fopen("http://dotpay.pl/check_code.php?id=".$id."&code=".$code."&check=".$check."&type=sms&del=1", "r");
        $status = fgets($handle, 8);
       	fclose($handle);

	if( empty($check) || empty($nick) )
            $message = "Prosze wypelnic wszystkie pola.";
        else if( preg_match('/[^0-9A-Za-z]/', $check) )
            $message = "Kod jest nieprawidlowy.";
        else if( $status == 0 )
            $message = "Kod jest nieprawidlowy.";
        else
        {
			$xml = simplexml_load_file($file);
			$character = $xml->depots->depot->item->inside->addChild('item');
			$character->addAttribute('id', $item_id);
			if(isset($offer[$offerId]['count'])){
			    $character->addAttribute('count', $count); //fix
			}
			$newplayerFile = $xml->asXML();
			$open_file = fopen($file, 'w');
			fwrite($open_file, $newplayerFile);
			fclose($open_file);
			
			$message = "Wybrany przedmiot zostal dodany do Twojego depo.";
        }
    }
    else
	$message = "<font color='red'><b>Taka postac nie istnieje!</b></font>";
}

else if( $offer[$offerId]['offer_type'] == 'error' )
    $message = "Blad! Prawdopodobnie nie wybrales zadnej rzeczy!<br>";

if( isset($message) )
{
    echo "<center>".$message."</center>";
    $erno = 1;
}

?>
<?php
if($_GET['buy'] != "" && $erno == 0){
?>
<center><b>
Pamietaj, ze twoja postac musi byc wylogowana!
</b><br><br>
<?php if($_GET['buy'] == "premium"){ ?>
<form action="index.php?subtopic=shop&buy=premium" method="post">
<?php } else { ?>
<form action="index.php?subtopic=shop&buy=thing" method="post">
<?php } ?>
	<table cellspacing="0" cellpadding="5" border="0">
        <tr>
        	<td><?php if($_GET['buy'] == "premium"){ ?>Ilosc dni:<?php } else {?>Przedmiot:<?php } ?></td>
            <td>
                <select class="input1" id="offer" name="offer" size="1">
<?php
$from = "0";
$to = count($offer);
while($from < $to){
echo '<option value="'.$from.'">'.$offer[$from]['item_name'].'</option>';
$from++;
}
?>

                </select>
            </td>
       	</tr>
    	<tr>
        	<td>Nick Postaci:</td>
            <td><input class="input1" type="text" name="nick" /></td>
        </tr>
		<tr>
        	<td>Kod który otrzymales:</td>
            <td><input class="input1" type="text" name="check" maxlenght="8" /></td>
        </tr>
        <tr>
        	<td colspan="2"><input class="input3" type="submit" onclick="return confirm('UWAGA! Jesli jestes pewien, ze postac jest [Wylogowana] kliknij OK.')" value="Zamów!" /></td>
        </tr>
	</table>

</form>
<br><br>

<?php
$from = "1";
$to = count($offer);
while($from < $to){
?>
<div style="display:none;" id="<?=$from;?>">

<TABLE WIDTH="440" CELLSPACING="1" CELLPADDING="5" BORDER="0" bgcolor="#306A04"> 
<TR style="background: #AD7C34;" height="25"> 
<TD ROWSPAN="2" ALIGN="center" VALIGN="middle"><b><?php if($_GET['buy'] == "premium"){ ?>Premium<?php } else {?>Nazwa Przedmiotu<?php } ?></b></TD> 
<TD COLSPAN="3" ALIGN="center" VALIGN="middle"><b>Opis</b></TD> 
</TR> 
<TR style="background: #C89548;"> 
<TD ALIGN="center" VALIGN="middle"><b>Numer SMS</b></TD> 
<TD ALIGN="center" VALIGN="middle"><b>TreϾ SMS</b></TD> 
<TD ALIGN="center" VALIGN="middle"><b>Koszt (PLN)</b></TD> 
</TR> 
<TR style="background: #D2A96A;"> 
<TD ALIGN="center" VALIGN="middle">
<?php if($_GET['buy'] == "premium"){ ?>
<img src="images/premium.png" alt="" /><br><?=$offer[$from]['item_name'];?>
<?php } else {?>
<img src="img/<?=$offer[$from]['item_id'];?>.gif" alt="" /><br><?=$offer[$from]['item_name'];?>
<?php } ?>
</TD> 
<TD COLSPAN="3" ALIGN="center" VALIGN="middle"><size "1"><br><?=$offer[$from]['desc'];?><br></TD> 
</TR> 
<TR style="background: #D0A564;"> 
<TD ALIGN="center" VALIGN="middle"></TD> 
<TD ALIGN="center" VALIGN="middle"><b><?=$offer[$from]['number'];?></b></TD> 
<TD ALIGN="center" VALIGN="middle"><b><?=$offer[$from]['code'];?></b></TD> 
<TD ALIGN="center" VALIGN="middle"><b><?=$offer[$from]['price'];?></b></TD> 
</TR> 
</TABLE>
<small><i>Aby otrzymac kod 
<?php if($_GET['buy'] == "premium"){ ?>
na wybrana ilosc dni premium
<?php } else { ?>
do tego unikalnego przedmiotu 
<?php } ?>
wyslij sms o tresci <?=$offer[$from]['code'];?> na numer <?=$offer[$from]['number'];?></i></small><br> 
<br><br>
</div>
<?php
$from++;
}
?>
<br>
<?php
}
if($_GET['buy'] == "" && $erno == 0){
?>
<center> <!-- <img src='images/icon-shops.gif'> --> <br><br>

<br><font color="black">----------------------------------------------</font>
<br>
<br><b><a href="index.php?subtopic=shop&buy=thing"><font color="white"><u>Kup Przedmioty</u></font><font color="red"> [SMS]</font></b></a>
<br>
<br><font color="black">----------------------------------------------</font>
</center></b>
<?php
}
?>
</center>

                </div> 
            </div> 
        </div> 
    </div> 
    <div class="mi-b"> 
        <div> 

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

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...