Exemplo n.º 1
0
 $result2 = $client->call("GetBanners", array('params' => $params));
 err($client);
 foreach ($result2 as $character) {
     foreach ($character["Phrases"] as $character2) {
         if (!isset($character2["Prices"])) {
             continue;
         }
         $tmax = $character2["PremiumMax"];
         $tmin = $character2["PremiumMin"];
         $lmax = $character2["Max"];
         $lmin = $character2["Min"];
         if (isset($_POST['radio'][$character2["PhraseID"]])) {
             $newprice = strateg($_POST['radio'][$character2["PhraseID"]], $tmax, $tmin, $lmax, $lmin, $character2["Prices"], $_POST['price'][$character2["PhraseID"]]);
         }
         if (isset($_POST['save']) && $newprice != $character2["Price"]) {
             $newprice .= "(" . newprice($character2["CampaignID"], $character2["BannerID"], $character2["PhraseID"], $newprice) . ")";
         }
         echo '
           <tr>
             <td>' . $character2["Phrase"] . '</td>
             <td>цена 1-го спецразмещения <b>' . (isset($character2["PremiumMax"]) ? $character2["PremiumMax"] : "") . '</b><br/>
                 вход в спецразмещение <b>' . (isset($character2["PremiumMin"]) ? $character2["PremiumMin"] : "") . '</b><br/>
                 цена 1-го места <b>' . (isset($character2["Max"]) ? $character2["Max"] : "") . '</b><br/>
                 вход в гарантированные показы <b>' . (isset($character2["Min"]) ? $character2["Min"] : "") . '</b><br/></td>    
             <td>';
         $i = 0;
         foreach ($character2["Prices"] as $price) {
             echo "<span" . ($character2["Price"] == $price ? " style='color:red'" : "") . ">" . $price . "<b>";
             if ($price == $tmax) {
                 echo " 1 спец";
             } else {
Exemplo n.º 2
0
    err($client);
    foreach ($result2 as $character) {
        foreach ($character["Phrases"] as $character2) {
            if (!isset($character2["Prices"]) || !isset($_POST['radio'][$character2["PhraseID"]])) {
                continue;
            }
            $tmax = $character2["PremiumMax"];
            $tmin = $character2["PremiumMin"];
            $lmax = $character2["Max"];
            $lmin = $character2["Min"];
            if (isset($_POST['radio'][$character2["PhraseID"]])) {
                $newprice = strateg($_POST['radio'][$character2["PhraseID"]], $tmax, $tmin, $lmax, $lmin, $character2["Prices"], $_POST['price'][$character2["PhraseID"]]);
            }
            if ($newprice != $character2["Price"] && ($newprice != "" && $newprice != 0)) {
                echo "Новая цена " . $newprice . " на " . $character2["Phrase"] . " страрая - " . $character2["Price"] . "<br />";
                newprice($character2["CampaignID"], $character2["BannerID"], $character2["PhraseID"], $newprice);
                sleep(1);
            }
        }
    }
}
function err($client)
{
    $err_msg = $client->getError();
    if ($err_msg) {
        // print error msg
        echo 'Error: ' . $err_msg;
    }
}
function addkw($XML, $cid, $bid, $kid, $limit, $strateg)
{