                                <?
                                 
                                if (!isset($isubsezione))
                                    $isubsezione = 0;
                                
                                if($azione=="delOrder")
                                {
                                     $sql = "DELETE FROM items_orders WHERE id=$id";
                                    $mydb->ExecSql($sql);
                                    
                                    $isubsezione = 0;
                                }
                                /*
                                $json="{'symbol': 'SHIBEUR', 'orderId': 129176884, 'orderListId': -1, 'clientOrderId': 'fyrYuybPLrT0b2w9cgiMgZ', 'transactTime': 1651511965782, 'price': '0.00000000', 'origQty': '1026695.00', 'executedQty': '1026695.00', 'cummulativeQuoteQty': '20.01028555', 'status': 'FILLED', 'timeInForce': 'GTC', 'type': 'MARKET', 'side': 'BUY', 'fills': [{'price': '0.00001949', 'qty': '1026695.00', 'commission': '1026.70', 'commissionAsset': 'SHIB', 'tradeId': 10667117}]}";
;
                                $obj1 = json_decode(str_replace("'","\"",$json));
                               // var_dump($obj1);
                                $fills = $obj1->fills[0];
                                var_dump($fills);
                                echo "<br/>\n";
                                echo $fills->qty;
                                */
                                
                                if($azione=="insOrder"){
                                    
                                    $sql = "SELECT id FROM items_orders WHERE _key='$key'";
                                    $mydb->DoSelect($sql);
                                    if($mydb->NrRecord==0)
                                    {
                                    
                                        $sql = "INSERT INTO items_orders (provider, asset, symbol, qnt, importo, data_ins, tipo, dir,_key) VALUES (";
                                        echo $sql .= "$provider, '$assetToTrade', '$symbol','$qnt','$importo',NOW(), 'MARKET', 'BUY','$key' )";
                                        $mydb->ExecSql($sql);
                                        $idOrd=$mydb->LastInsertedId;
                                        
                                        echo $res1 = createOrderMarketBuy($provider,$symbol,$qnt);
                                        $obj1 = json_decode(trim(str_replace("'","\"",$res1))); 
                                        echo "<br/>\n";
                                        var_dump($obj1);
                                        echo "<br/>\n";
                                        
                                        $fills = $obj1->fills[0];
                                        $buyed = $qty = $fills->qty;
                                        $price = $fills->price;
                                        $importo = $obj1->cummulativeQuoteQty;
                                        
                                        if($fills->commissionAsset == $assetToTrade) $buyed = $buyed - $fills->commission;
                                        $commission = $fills->commissionAsset." ".$fills->commission;
                                        
                                       # object(stdClass)#7 (14) { ["symbol"]=> string(7) "SHIBEUR" ["orderId"]=> int(129176884) ["orderListId"]=> int(-1) ["clientOrderId"]=> string(22) "fyrYuybPLrT0b2w9cgiMgZ" ["transactTime"]=> int(1651511965782) ["price"]=> string(10) "0.00000000" ["origQty"]=> string(10) "1026695.00" ["executedQty"]=> string(10) "1026695.00" ["cummulativeQuoteQty"]=> string(11) "20.01028555" ["status"]=> string(6) "FILLED" ["timeInForce"]=> string(3) "GTC" ["type"]=> string(6) "MARKET" ["side"]=> string(3) "BUY" ["fills"]=> array(1) { [0]=> object(stdClass)#8 (5) { ["price"]=> string(10) "0.00001949" ["qty"]=> string(10) "1026695.00" ["commission"]=> string(7) "1026.70" ["commissionAsset"]=> string(4) "SHIB" ["tradeId"]=> int(10667117) } } }

                                       echo  $sql = "UPDATE items_orders SET buyed=$buyed,qnt=$qty, commission='$commission', price=$price, importo=$importo WHERE id=$idOrd";// NON E' BUYED: LEGGERE DAL JSON
                                        $mydb->ExecSql($sql);

                                        $res = getWalletBalance('SPOT',$assetRif,$provider);
                                        $obj = json_decode(trim(str_replace("'","\"",$res)));                                       
                                        $residuo = $obj->free;
                                        
                                        $befVal = getAmountFromLastSnap($assetRif);
                                        
                                        $sql = "UPDATE `items_orders` SET valore=`importo`/`buyed` WHERE id=$idOrd";
                                        $mydb->ExecSql($sql);//LEGGERE DAL JSON: confrontare con price
                                        
                                     $ida1 = getIdAsset($assetRif,$provider);
                                     $ida2 = getIdAsset($assetToTrade,$provider);
                                     
                                     $res1 = getWalletBalance('SPOT',$assetRif,$provider);
                                     $obj1 = json_decode(trim(str_replace("'","\"",$res1)));
                                     $bal1 = $obj1->free;
                                     $lock1= $obj1->locked;
                                     
                                     $res2 = getWalletBalance('SPOT',$assetToTrade,$provider);
                                     $obj2 = json_decode(trim(str_replace("'","\"",$res2)));
                                     $bal2 = $obj2->free;
                                     $lock2= $obj2->locked;
                                     
                                     $sql = "INSERT INTO items_snapshots (data_snap, id_utente, provider, tipo) VALUES (NOW(),$_idutente,$provider, 'P')";
                                     $mydb->ExecSql($sql);
                                     $id_snap = $mydb->LastInsertedId;
                                     $sql = "INSERT INTO items_snapshots_records (id_snap, asset, free, locked) VALUES ($id_snap, $ida1, $bal1,$lock1)";
                                     $mydb->ExecSql($sql);
                                     $sql = "INSERT INTO items_snapshots_records (id_snap, asset, free, locked) VALUES ($id_snap, $ida2, $bal2,$lock2)";
                                     $mydb->ExecSql($sql);
                                        
                                    }
                                    
                                } 
                                ?>

                            <script>


                                function salva()
                                {
                                    waitpage();
                                    document.frmins.azione.value = 'save';
                                    document.frmins.submit();
                                }
                                
                                function editOrder(id)
                                {
                                    waitpage();
                                    document.frmins.azione.value = 'editOrder';
                                    document.frmins.id.value = id;
                                    document.frmins.sezione.value = 'mybinance,4';
                                    document.frmins.submit();
                                }
                                
                                function addOrder()
                                {
                                    waitpage();
                                    document.frmins.azione.value = 'addOrder';
                                    document.frmins.submit();
                                }
                                
                                function saveOrder()
                                {
                                    waitpage();
                                    document.frmins.azione.value = 'addOrder';
                                    document.frmins.sezione.value = 'mybinance,1';
                                    document.frmins.submit();
                                }
                                
                                function calcolaQnt()
                                {
                                    price = document.frmins.price.value;
                                    importo = document.frmins.importo.value;
                                    qnt = importo/price;
                                    document.frmins.qnt.value=qnt;
                                }
                                function calcolaImp()
                                {
                                    price = document.frmins.price.value;
                                    qnt = document.frmins.qnt.value;
                                    imp = qnt*price;
                                    document.frmins.importo.value=imp;
                                }
                                function insOrder()
                                {
                                    waitpage();
                                    document.frmins.azione.value = 'insOrder';
                                    document.frmins.sezione.value = 'mybinance,0';
                                    document.frmins.submit();
                                }
                                function delOrder(id)
                                {
                                    if(confirm('Confermi la cancellazione dell\'ordine?'))
                                    {
                                    waitpage();
                                    document.frmins.azione.value = 'delOrder';
                                    document.frmins.id.value = id;
                                    document.frmins.sezione.value = 'mybinance,0';
                                    document.frmins.submit();
                                    }
                                }

                            </script>

                            <form name="frmins" method="post" action="<? echo $action ?>" >
                                
                             <div style="text-align:left" class="box">
                            <?
                            if ($isubsezione == 0) {

                                $sql = "SELECT * FROM items_orders WHERE data_chiusura IS NULL ORDER BY data_ins DESC";
                                $a_orders = $mydb->DoSelect($sql);
                                ?>

                               
                                    <a href="javascript:addOrder()" ><img src="main/contents/icone/add.png" class="ico24" align="absmiddle" /> Aggiungi Ordine</a>
                                        <select name="snapProvider" class="medium" >
                                                    <option value="1">Binance</option>
                                        </select>
                                    <? if($azione=="addOrder"){?>
                                    <select name="assetToTrade" class="medium" >
                                                    <option value=""></option>
                                                    <?
                                                    $sql = "SELECT * FROM items WHERE tipo='C' AND provider=$snapProvider";
                                                    $a_ = $mydb->DoSelect($sql);
                                                    foreach($a_ as $k => $r)
                                                    {
                                                        ?>
                                                        <option value="<?=$r['asset']?>"><?=$r['asset']?></option>
                                                        <?
                                                    }
                                                    ?>
                                    </select>/<select name="assetRif" class="medium" >
                                                   <option value="EUR">EUR</option>
                                                   <option value="USDT">USDT</option>
                                                   <!--option value="USD">USD</option-->
                                    </select><br/>
                                    <span class="testosm"><input type="checkbox" name="takess" value="1" checked/>Crea snapshot</span>
                                    
                                    <div class="button2" onclick="saveOrder()"><div>Continua</div></div>
                                    <? } ?>  
                                    
                                    <div class="spessore"></div>
                                    <div class="spessore"></div>

                                    <table class="tablegrid3" cellpadding="6" cellspacing="0">
                                        <tr>
                                            <th></th>
                                            <th>ID</th>
                                            <th>Data</th>
                                            <th>Asset</th>
                                            <th>Trading</th>
                                            <th>Quantit&agrave;</th>
                                            <th>Importo</th>
                                            <th>Tipo</th>
                                            <th>Stato</th>
                                            <th style="min-width:200px">

                                            </th>

                                        </tr>

                                        <?
                                        if(is_array($a_orders))
                                        foreach($a_orders as $k => $r)
                                        {
                                            $stato = "";
                                            $diff = $r['actprice'] - $r['price'];
                                            $diffp = round(($diff/$r['price'])*1000)/10;
                                            $stato = "<b>$diffp %</b>";
                                            if($diffp>0) $clstato = "green"; else $clstato="red";
                                            ?>
                                            <tr>
                                                <td><?=$k+1?></td>
                                                <td><?=$r['id']?></td>
                                                <td><?=$r['data_ins']?></td>
                                                <td><?=$r['asset']?></td>
                                                <td><?=$r['symbol']?></td>
                                                <td><?=$r['qnt']?></td>
                                                <td><?=$r['importo']?></td>
                                                <td><?=$r['tipo']?> <?=$r['dir']?></td>
                                                <td class="<?=$clstato?>"><?=$stato?></td>
                                                <td>
                                                     <a href="javascript:editOrder(<?=$r['id']?>)"><img src="main/contents/icone/edit-icon.png" class="ico20 fleft imgcliccabile" /></a>
                                                      <a href="javascript:delOrder(<?=$r['id']?>)"><img src="main/contents/icone/cancel.png" class="ico20 fright imgcliccabile" /></a>
          
                                                </td>
                                            </tr>
                                            <?

                                        }

                                        ?>
                                    </table>
                               

                            <? } elseif ($isubsezione == 1) { ?>
                                    
                                    <?
                                    $symbol = $assetToTrade.$assetRif;
                                    $price = getPrice($symbol,$snapProvider);
                                    #$obj = json_decode(trim(str_replace("'","\"",$res)));
                                    #$price = $obj->price;
                                    
                                     $res1 = getWalletBalance('SPOT',$assetRif,$snapProvider);
                                     $obj1 = json_decode(trim(str_replace("'","\"",$res1)));
                                     $bal1 = $obj1->free;
                                     $lock1= $obj1->locked;
                                     
                                     $res2 = getWalletBalance('SPOT',$assetToTrade,$snapProvider);
                                     $obj2 = json_decode(trim(str_replace("'","\"",$res2)));
                                     $bal2 = $obj2->free;
                                     $lock2= $obj2->locked;
                                     
                                     $key = md5($symbol.time());
                                     
                                     $ida1 = getIdAsset($assetRif,$snapProvider);
                                     $ida2 = getIdAsset($assetToTrade,$snapProvider);
                                     
                                     if($takess=='1')
                                     {
                                        $sql = "INSERT INTO items_snapshots (data_snap, id_utente, provider, tipo) VALUES (NOW(),$_idutente,$snapProvider, 'P')";
                                        $mydb->ExecSql($sql);
                                        $id_snap = $mydb->LastInsertedId;
                                        $sql = "INSERT INTO items_snapshots_records (id_snap, asset, free, locked) VALUES ($id_snap, $ida1, $bal1,$lock1)";
                                        $mydb->ExecSql($sql);
                                        $sql = "INSERT INTO items_snapshots_records (id_snap, asset, free, locked) VALUES ($id_snap, $ida2, $bal2,$lock2)";
                                        $mydb->ExecSql($sql);
                                     }
                                    ?>
                                 
                                    <script>
                                    
                                    function refreshPrice()
                                    {
                                        
                                        switchImage("refresh-ico","main/contents/icone/loading3.gif");
                                        ajaxSrv('TRD.getPrice', 'assetToTrade=<?=$assetToTrade?>&assetRif=<?=$assetRif?>&provider=<?=$snapProvider?>', 'refreshPriceDone(res)', ''); 
                                    }
                                    
                                    function refreshPriceDone(res)
                                    {
                                        switchImage("refresh-ico","main/contents/icone/refresh-icon.png");
                                        setTextinDiv('price',res);
                                    }
                                    
                                    function setMax(bal)
                                    {
                                        document.frmins.importo.value=bal;
                                        calcolaQnt();
                                    }
                                    function setFloor()
                                    {
                                        val = document.frmins.qnt.value;
                                        a = val.split('.');
                                        document.frmins.qnt.value=a[0];
                                        calcolaImp();
                                    }
                                    
                                    </script>
                                
                                <div class="testo_evi">Creazione ordine <?=$_Providers[$snapProvider]?> <?=$assetToTrade?>/<?=$assetRif?>:</div>
                                
                                <input type="hidden" name="price" value="<?=$price?>" />
                                <input type="hidden" name="symbol" value="<?=$symbol?>" />
                                <input type="hidden" name="provider" value="<?=$snapProvider?>" />
                                <input type="hidden" name="assetToTrade" value="<?=$assetToTrade?>" />
                                <input type="hidden" name="assetRif" value="<?=$assetRif?>" />
                                <input type="hidden" name="key" value="<?=$key?>" />
                                <input type="hidden" name="takess" value="<?=$takess?>" />
                                
                                <div>
                                    <table>
                                        <tr>
                                            <td>Prezzo: </td><td>
                                                <div class="fleft" id="price"><?=$price?></div>
                                                <div class="fleft" style="margin-left:10px"><?=$assetRif?> 
                                                    <img id="refresh-ico" src="main/contents/icone/refresh-icon.png" class="ico18 imgcliccabile" onclick="refreshPrice()" align="absmiddle" />
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Importo: </td><td><input type="text" name="importo" value="" class="" onchange="calcolaQnt()" /> <?=$assetRif?> (<a href="javascript:setMax('<?=$bal1?>')" class="testosm">MAX <?=$bal?></a>)</td>
                                        </tr>
                                        <tr>
                                            <td>Quantit&agrave;: </td><td><input type="text" name="qnt" value="" class="" onchange="calcolaImp()" /> <?=$assetToTrade?>(<a href="javascript:setFloor()" class="testosm">arrotonda</a>) </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                <div class="button2" onclick="insOrder()"><div>Conferma</div></div>
                                            </td>
                                        </tr>
                                    </table>
                                </div>

                            <? } elseif ($isubsezione == 2) { ?>
                                
                                <? 
                                

                                ?>
                            <? } elseif($isubsezione==4){ ?>
                                
                                <?
                               
                                if($azione=="aggiornaOrdine")
                                {
                                    $sql = "UPDATE items_orders SET stopLoss='$SL' , takeProfit='$TP', SL_type='$SL_type', TP_type='$TP_type' WHERE id=$id";
                                    $mydb->ExecSql($sql);
                                }

                                if($azione=="archiviaOrdine")
                                {
                                    $sql = "UPDATE items_orders SET stato='AR' , data_chiusura=NOW() WHERE id=$id";
                                    $mydb->ExecSql($sql);
                                }
                                 if($azione=="delOrder")
                                {
                                     $sql = "DELETE FROM items_orders WHERE id=$id";
                                    $mydb->ExecSql($sql);
                                    
                                    $isubsezione = 0;
                                }
                                
                                $sql = "SELECT * FROM items_orders WHERE id=$id";
                                $mydb->DoSelect($sql);
                                $ro = $mydb->GetRow();
                                
                                $valuta = str_replace($ro['asset'],"",$ro['symbol']);
                                
                                if($ro['stato']=='') $stato = "APERTO";
                                elseif($ro['stato']=='AR') $stato = "ARCHIVIATO";
                                
                               
                                $price = getPrice($ro['symbol'],$ro['provider']);

                                $TP = $ro['takeProfit'];
                                if($ro['TP_type']=="PF" || $ro['TP_type']=="PD") $TP = number_format($ro['takeProfit'],2,",","");

                                $SL = $ro['stopLoss'];
                                if($ro['SL_type']=="PF") $SL = number_format($ro['stopLoss'],2,",","");
                                ?>
                                <script>
                                    
                                function refresh()
                                {
                                    waitpage();
                                    document.frmins.sezione.value='mybinance,4';
                                    document.frmins.submit();
                                }
                                
                                function archivia()
                                {
                                    document.frmins.azione.value='archiviaOrdine';
                                    document.frmins.sezione.value='mybinance,4';
                                    waitpage();
                                    document.frmins.submit();
                                }

                                function updOrder()
                                {
                                    document.frmins.azione.value='aggiornaOrdine';
                                    document.frmins.sezione.value='mybinance,4';
                                    waitpage();
                                    document.frmins.submit();
                                }
                                
                                
                                function refreshPrice()
                                {
                                    switchImage("refresh-ico", "main/contents/icone/loading3.gif");
                                    ajaxSrv('TRD.getPrice', 'symbol=<?=$ro['symbol']?>&provider=<?=$ro['provider']?>', 'refreshPriceDone(res)', '');
                                }

                                function refreshPriceDone(res)
                                {
                                    switchImage("refresh-ico","main/contents/icone/refresh-icon.png");
                                    setTextinDiv('price','<b>Attuale:</b> '+res);
                                    
                                }
                                </script>
                                
                                <div class="testo_evi">Ordine N. <?=$ro['id']?> (<?=$ro['data_ins']?> - <?=$_Providers[$ro['provider']]?> )</div>
                                <div class="fright " >
                                    <img src="main/contents/icone/refresh-icon.png" class="ico20 fleft imgcliccabile" onclick='refresh()' />
                                </div>    
                                 <div>
                                    <table>
                                        <tr>
                                            <th>Trading: </th><td><?=$ro['symbol']?></td><td colspan='3'></td>
                                        </tr>
                                        <tr>
                                            <th>Tipo: </th><td><?=$ro['tipo']?> <?=$ro['dir']?></td><td colspan='3'></td>
                                        </tr>
                                        <tr>
                                            <th>Prezzo: </th><td><?=$ro['valore']?> </td><td><?=$valuta?>/<?=$ro['asset']?></td>
                                            <td id="price"><b>Attuale:</b> <?=$price?></td><td><img src="main/contents/icone/refresh-icon.png" class="ico18 fleft imgcliccabile" onclick='refreshPrice()' id="refresh-ico" /></td>
                                        </tr>
                                        <tr>
                                            <th>Importo: </th><td><?=$ro['importo']?></td><td><?=$valuta?></td><td></td><td></td>
                                        </tr>
                                        <tr>
                                            <th>Quantit&agrave;: </th><td><?=$ro['qnt']?> </td><td><?=$ro['asset']?></td><td></td><td></td>
                                        </tr>
                                        <tr>
                                            <th>Stato: </th><td><?=$stato?> </td><td colspan='3'></td>
                                        </tr>
                                        <tr>
                                            <td colspan="5"><hr/></td>
                                        </tr>
                                        <tr>
                                            <th>TP: </th><td colspan='4'>
                                                <input type="text" name="TP" value="<?=$TP?>" class="" />
                                                <select name="TP_type" class="">
                                                    <option value="IF"  <? if($ro['TP_type']=="IF" ) echo "selected"?> >Importo</option>
                                                    <option value="ID"  <? if($ro['TP_type']=="ID" ) echo "selected"?> >Importo (dinamico)</option>
                                                    <option value="PF"  <? if($ro['TP_type']=="PF" ) echo "selected"?> >Percentuale</option>
                                                    <option value="PD"  <? if($ro['TP_type']=="PD" ) echo "selected"?> >Percentuale (dinamico)</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>SL: </th><td colspan='4'>
                                                <input type="text" name="SL" value="<?=$SL?>" class="" />
                                                <select name="SL_type" class="">
                                                    <option value="IF" <? if($ro['SL_type']=="IF" ) echo "selected"?> >Importo</option>
                                                    <option value="PF" <? if($ro['SL_type']=="PF" ) echo "selected"?> >Percentuale</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="5"></td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                <? if($ro['stato']=='') { ?>
                                                <div class="button4 fleft" onclick="updOrder()"><div>Salva</div></div>    
                                                <div class="button2 fleft" onclick="archivia()"   style='margin-left:16px'><div>Archivia</div></div>
                                                <div class="button4 fleft" onclick="insOrder__()" style='margin-left:16px'><div>Chiudi</div></div>
                                                <? } ?>
                                            </td>
                                        </tr>
                                        
                                       
                                    </table>
                                </div>
                            <? } ?>

                                <div class="spessore" style="height:20px"></div>    

                                <input type="hidden" name="MSID" value="<?= $MSID ?>" />
                                <input type="hidden" name="sezione" value="<?= $isezione ?>" />
                                <input type="hidden" name="azione" value="" />
                                <input type="hidden" name="id" value="<?= $id ?>" />
                                <input type="hidden" name="tab" value="<?= $tab ?>" />
                                <input type="hidden" name="tab2" value="<?= $tab2 ?>" />
                            </div>
                            </form>
<?/*
INSERT INTO items_orders (provider, asset, symbol, qnt, importo, data_ins, tipo, dir,_key) VALUES 
 * (1, 'TRX', 'TRXEUR','332','20.1192',NOW(), 'MARKET', 'BUY','d0d0b14955090133903157a1fbd5132c' )
 * {'symbol': 'TRXEUR', 'orderId': 30937836, 'orderListId': -1, 'clientOrderId': '8Q0jW8Sf41UDGkfhbRKKWE', 'transactTime': 1651318809041, 'price': '0.00000000', 'origQty': '332.00000000', 'executedQty': '332.00000000', 'cummulativeQuoteQty': '20.12584000', 'status': 'FILLED', 'timeInForce': 'GTC', 'type': 'MARKET', 'side': 'BUY', 'fills': [{'price': '0.06062000', 'qty': '332.00000000', 'commission': '0.33200000', 'commissionAsset': 'TRX', 'tradeId': 1293594}]}
UPDATE items_orders SET buyed=332.06500000 WHERE id=8
 * UPDATE items_orders SET importo=importo-65.35250495 WHERE id=8
UPDATE `items_orders` SET `valore`=`importo`/`qnt` WHERE id=8 
 * 
 * 
 *INSERT INTO items_orders (provider, asset, symbol, qnt, importo, data_ins, tipo, dir,_key) VALUES (1, 'SHIB', 'SHIBEUR','1026695','20.0000186',NOW(), 'MARKET', 'BUY','edc631e636ff8132a664fabf5a864423' )
 * {'symbol': 'SHIBEUR', 'orderId': 129176884, 'orderListId': -1, 'clientOrderId': 'fyrYuybPLrT0b2w9cgiMgZ', 'transactTime': 1651511965782, 'price': '0.00000000', 'origQty': '1026695.00', 'executedQty': '1026695.00', 'cummulativeQuoteQty': '20.01028555', 'status': 'FILLED', 'timeInForce': 'GTC', 'type': 'MARKET', 'side': 'BUY', 'fills': [{'price': '0.00001949', 'qty': '1026695.00', 'commission': '1026.70', 'commissionAsset': 'SHIB', 'tradeId': 10667117}]}
object(stdClass)#7 (14) { ["symbol"]=> string(7) "SHIBEUR" ["orderId"]=> int(129176884) ["orderListId"]=> int(-1) ["clientOrderId"]=> string(22) "fyrYuybPLrT0b2w9cgiMgZ" ["transactTime"]=> int(1651511965782) ["price"]=> string(10) "0.00000000" ["origQty"]=> string(10) "1026695.00" ["executedQty"]=> string(10) "1026695.00" ["cummulativeQuoteQty"]=> string(11) "20.01028555" ["status"]=> string(6) "FILLED" ["timeInForce"]=> string(3) "GTC" ["type"]=> string(6) "MARKET" ["side"]=> string(3) "BUY" ["fills"]=> array(1) { [0]=> object(stdClass)#8 (5) { ["price"]=> string(10) "0.00001949" ["qty"]=> string(10) "1026695.00" ["commission"]=> string(7) "1026.70" ["commissionAsset"]=> string(4) "SHIB" ["tradeId"]=> int(10667117) } } }
UPDATE items_orders SET buyed=2026014.95 WHERE id=13
 * UPDATE items_orders SET importo=-66.52253788 WHERE id=13
*/
