Exemplo n.º 1
0
${$rnxrpiazvd} = intval(Tools::getValue("id_product"));
${"GLOBALS"}["okfswszsrpim"] = "action";
$kjbefxe = "action";
if (${${"GLOBALS"}["lfghcw"]} > 0 and ${${"GLOBALS"}["dwydims"]} > 0 and ${${"GLOBALS"}["lzguktzczwfp"]} != AgileSellerManager::getObjectOwnerID("product", ${${"GLOBALS"}["dwydims"]})) {
    die(Tools::jsonEncode(array("status" => "error", "message" => Tools::displayError("Permission denied"))));
}
${${"GLOBALS"}["okfswszsrpim"]} = Tools::getValue("action");
$strbdkmkszb = "action";
if (${$ntguafqd} == "updateImagePosition") {
    die(ajaxProcessUpdateImagePosition());
}
if (${${"GLOBALS"}["kfciqhovvbq"]} == "deleteProductImage") {
    die(ajaxProcessDeleteProductImage());
}
if (${${"GLOBALS"}["kfciqhovvbq"]} == "UpdateCover") {
    die(ajaxProcessUpdateCover());
}
if (${$kjbefxe} == "UpdateProductImageShopAsso") {
    die(ajaxProcessUpdateProductImageShopAsso());
}
if (${${"GLOBALS"}["kfciqhovvbq"]} == "DeleteSpecificPrice") {
    die(ajaxProcessDeleteSpecificPrice());
}
if (${$strbdkmkszb} == "productQuantity") {
    die(ajaxProcessProductQuantity());
}
if (${$tsxqgqfuyd} == "deleteProductAttribute") {
    die(ajaxProcessDeleteProductAttribute());
}
if (${${"GLOBALS"}["kfciqhovvbq"]} == "defaultProductAttribute") {
    die(ajaxProcessDefaultProductAttribute());
Exemplo n.º 2
0
<?php

include_once dirname(__FILE__) . "/../config/init.php";
if (Tools::getRequest('action') == 'addImage') {
    ajaxProcessAddImage();
} elseif (Tools::getRequest('action') == 'deleteProductImage') {
    ajaxProcessDeleteProductImage();
} elseif (Tools::getRequest('action') == 'UpdateCover') {
    ajaxProcessUpdateCover();
} elseif (Tools::getRequest('action') == 'updateImagePosition') {
    ajaxProcessUpdatePosition();
}
/**
 * 上传图片并更新排序
 */
function ajaxProcessAddImage()
{
    // max file size in bytes
    $uploader = new FileUploader();
    $result = $uploader->handleUpload(ImageType::IMAGE_PRDOCUT);
    if (isset($result['success'])) {
        $image = $result['success'];
        $row['id_product'] = Tools::Q('id_product');
        $row['id_image'] = (int) $image['id_image'];
        $row['position'] = (int) Product::getImageLastPosition($row['id_product']);
        if ($row['position'] == 1) {
            $row['cover'] = 1;
        } else {
            $row['cover'] = 0;
        }
        Db::getInstance()->insert(DB_PREFIX . 'product_to_image', $row);