Problems with dynamic php DIV programming

Asked

Viewed 38 times

1

Good afternoon!

I am working on a project that involves building a website about a very popular game. This same website will have a "coinflip" This feature consists of a betting system where:

  1. The first player indicates to choose the CT or T option (Counter-Terrorist/Terrorist) and choose the skins (which has a certain value)
  2. The second player also chooses the CT or T option, but has to choose skins that are among the value of player skins 1

A brief example:

  1. The first player chooses to be CT and chooses skins whose price is 50€
  2. The second player chooses to be T and has to choose skins never less than 45 € and never more than 60 €

The problem lies precisely in the skins part, and is more than a problem:

  1. The system presents me the skins and shows me the values of them, but I was also supposed to be able to see the skins (the image itself). How can I change in order to achieve this?

  2. I can’t select any skin I have. I’ve seen this "post" and I am in doubt if it is a good solution because ahead I have a script, which I also do not understand well.

  3. As I said in the previous point, I have a script just below that, but I’m a little confused. I don’t really know what this script does, nor do I see it helping with the system. I’m almost sure it comes into action when I press a button that exists, called "deposit", which should deposit the skins.

I now present the php code and the script:

PHP

<?
    $steamid=$_SESSION['steamid'];
            echo '<div class="container1">';
            //$prices1 = file_get_contents('prices.txt');
            $prices = file_get_contents('https://api.csgofast.com/price/all'); // php check conn
            $parsedPrices = json_decode($prices);
            $get_content = file_get_contents("http://steamcommunity.com/profiles/$steamid/inventory/json/730/2/"); // check conn
            $parsedInv = json_decode($get_content);
            $parsedInvT = json_decode($get_content);
            $counter = 0;
            $mindeposit = 0.03;
            echo '<span id="noitems"></span>';
            foreach($parsedInv->rgInventory as $k => $v){
                $id = $v->id;
                $iid = $v->instanceid;
                $cid = $v->classid;
                $key = $cid."_".$iid;
                $t = $parsedInvT->rgDescriptions->$key->tradable;
                if($t==1)
                {               
                $name = $parsedInvT->rgDescriptions->$key->market_hash_name;
                $price = $parsedPrices->$name;
                $img = $parsedInvT->rgDescriptions->$key->icon_url;
                if($t && $price && $price >= $mindeposit) 
                {
                        echo $img;

                        echo'<div class="item-card__wrapper item '.$id.'">


                        <div class=" item-card steam-quality-baseGrade steam-appid-730">
                            <div class="item-card__header">
                                <h4 class="item-card__title_main steam-category-normal name">'.$name.'</h4>

                                <small class="item-card__title_opt">

                                </small>
                            </div>
                            <div class="item-card__image-wrapper item-card__image-wrapper--alfa">
                               <img class="item-card__image item-card__image--zoom" src="http://steamcommunity-a.akamaihd.net/economy/image/'.$img.'" alt="'.$name.'">
                            </div>
                            <div class="item-card__footer">
                                <small>$<span class="val">'.$price.'</span></small>
                            </div>
                        </div>
                </div>';
                    }

                }
            }

echo"</div>";
        echo"<br>
        <input onclick=\"check()\" type=\"checkbox\" name=\"accepted\" id=\"myCheck\" value=\"checkbox\"> Confirm items & proceed</input>
        <br>
        <br>    
        <button class=\"accept show\" id=\"submit\" type=\"submit\" enable>Deposit</button>
        </center>

        ";
        ?>

Script (Javascript):

<script>

    eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$(".J").X(f(){g a=0;g b=0;b=a+"="+$(\'.I\').r();a++;b=b+"&"+a+"="+$(\'#A\').r();a++;g c=0;$("2.K .9").F(f(){3($(7).1(\'2\').Z("13")){3(a==0){b=a+"="+$(7).1("2").1(\'2.9-o\').1(\'.p\').e();c=c+h($(7).1("2").1(\'2.9-i\').1(\'j\').1(\'k\').e());a++}1h{b=b+"&"+a+"="+$(7).1("2").1(\'2.9-o\').1(\'.p\').e();c=c+h($(7).1("2").1(\'2.9-i\').1(\'j\').1(\'k\').e());a++}}});c=h(c);b=b+"&"+"1o="+c;3(a!=0){$.1C({1D:"1I",y:\'z.l\',B:b,C:D,E:f(a){a=a.m(\'\\n\',\'\');a=a.m(\'    \',\'\');3(a==\'G\'||a==\'H\'){6.4(\'8!\',\'<b>L M N O P Q, R S a U V</b>.\')}3(a==\'W\'){6.4(\'8!\',\'<b>q Y d 10 11 12 s 14 (15: $0.16 | 17: 18 19)</b>.\')}3(a==\'1a\'){6.4(\'8!\',\'<b>1b 1c: $0.1d</b>.\')}3(a==\'1e\'){6.4(\'8!\',\'<b>q 1f d 1g t T 1i</b>.\')}3(a==\'1j\'){6.4(\'8!\',\'<b>1k 1l 1m 1n s v <a 1p="1q.l">1r 1s</a></b>.\')}3(a.1t>5){6.4(\'1u!\',\'1v v 1w 1x 1y 1z 1A d 1B: <b>\'+a+\'</b><w><w><u>1E 1F 1G a 1H x 1J x d 1K t 1L 1M</u>.\');1N.1O(\'1P\',a)}}})}});',62,114,'|children|div|if|alert||alertify|this|Error|item||||the|html|function|var|parseFloat|card__footer|small|span|php|replace||card__header|name|Please|val|your|or||Trade|br|to|url|processhost|Text2|data|processData|false|success|each|err1|err4|side|show|container1|Our|Pricing|API|is|having|issues|try|again||bit|later|err2|click|fix|hasClass|Gap|value|of|checked|lobby|Min|05|Max|displayed|above|err2b|Minimum|Deposit|20|err3|choose|CT|else|Coin|err5|Make|sure|you|set|sum|href|usersettings|URL|HERE|length|Success|Your|Offer|has|been|sent|with|hash|ajax|type|You|have|about|minute|POST|respond|offer|it|expires|socket|emit|sendoffer'.split('|'),0,{}))

</script>

I think the problem is clear to all viewers. I am available to collaborate more if necessary.

Thank you for your attention!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.