Exemplo n.º 1
0
 public function changeShareTemplateStatus()
 {
     $result = 0;
     if ($_POST['status'] == 2 || $_POST['status'] == 3) {
         $id_array = explode(",", $_POST['ids']);
         foreach ($id_array as $id) {
             $sql = "select SKU from share_template where Id = " . $id;
             $result = mysql_query($sql, eBayListing::$database_connect);
             $row = mysql_fetch_assoc($result);
             $json_object = eBayListing::getInventoryServiceS("?action=getSkuStatus&data=" . $row['SKU']);
             //print_r($json_object);
             if ($json_object->status == "active" || $json_object->status == "out of stock") {
                 $sql = "update share_template set status = " . $_POST['status'] . " where Id = " . $id;
                 //echo $sql."\n";
                 $result = mysql_query($sql, eBayListing::$database_connect);
             }
         }
     } else {
         $sql = "update share_template set status = " . $_POST['status'] . " where Id in (" . $_POST['ids'] . ")";
         //echo $sql."\n";
         $result = mysql_query($sql, eBayListing::$database_connect);
     }
     echo $result;
 }
Exemplo n.º 2
0
 public static function getSkuLowPriceS($sku = '', $currency = '', $location = '', $site = '')
 {
     $rate = eBayListing::getExchangeRateS($currency);
     $json_object = eBayListing::getInventoryServiceS("?action=getSkuLowestPrice&sku=" . $sku . "&location=" . $location . "&site=" . $site);
     $l_price = $json_object->L / $rate;
     //echo round($l_price, 2);
     return round($l_price, 2);
 }