示例#1
0
					<textarea id="productid_' . $key . '" style="width:140px;height:45px">' . $box[5] . '</textarea> 
				</div>
				<div class="not_expanded_' . $key . '" style="display:none">
					' . $dhl->l('Category IDs') . '
					<br />
					<textarea id="categoryid_' . $key . '" style="width:140px;height:45px">' . $box[6] . '</textarea> 
				</div>
				<div class="not_expanded_' . $key . '" style="display:none">
					' . $dhl->l('Manufacturer IDs') . '
					<br />
					<textarea id="manufacturerid_' . $key . '" style="width:140px;height:45px">' . $box[7] . '</textarea> 
				</div>
				<div class="not_expanded_' . $key . '" style="display:none">
					' . $dhl->l('Supplier IDs') . '
					<br />
					<textarea id="supplierid_' . $key . '" style="width:140px;height:45px">' . $box[8] . '</textarea> 
				</div>
			</td>' : '') . '
			<td align="left" valign="top"><img src="' . _MODULE_DIR_ . 'dhl/img/update.gif" id="edit_box_' . $key . '" style="cursor:pointer;" onclick="edit_box(' . $key . ')" /></td>
			<td align="left" valign="top"><img src="' . _MODULE_DIR_ . 'dhl/img/delete.gif" style="cursor:pointer;" onclick="remove_box(' . $key . ')" /></td>
	</tr>';
}
$html .= "</table>";
$return['boxes'] = $html;
ob_end_clean();
if (!function_exists('json_decode')) {
    $j = new JSON();
    print $j->serialize(array2object($return));
} else {
    print json_encode($return);
}
示例#2
0
                 $res = "Ya existe el punto " . $punto . " para este barrio";
                 break;
             case "error_sql":
                 $res = "Error en la consulta";
                 break;
         }
     } else {
         $res = "Punto editado correctamente";
     }
     echo $res;
     break;
 case "getContenidos":
     $id_barrio = $_POST['id_barrio'];
     $punto = $_POST['punto'];
     $data = $puntos->getContenidos($id_barrio, $punto);
     $res = $json->serialize($data);
     echo $res;
     break;
 case "editarContenidos":
     $id_barrio = $_POST['id_barrio'];
     $punto = $_POST['punto'];
     $img_id = $_POST['img_id'];
     $imgFlag = (bool) $_POST['imgFlag'];
     $img_title = $_POST['img_title'];
     $img = $_FILES['img'];
     $txt_id = $_POST['txt_id'];
     $txtFlag = (bool) $_POST['txtFlag'];
     $txt_title = $_POST['txt_title'];
     $summary = $_POST['summary'];
     $body = $_POST['body'];
     $contenidoTxt = $txtFlag ? $puntos->updateTxt($txt_id, $txt_title, $summary, $body) : $puntos->addTxt($id_barrio, $punto, $txt_title, $summary, $body);
示例#3
0
$is_cart = Tools::getValue('dhl_is_cart');
$qty = Tools::getValue('qty');
$dhl->updateCartWithNewCarrier();
$dhl->saveLog('dhl_log1.txt', "Starting {$sti} " . print_r($_POST, true), $log);
// Get Address and zone
$address = $dhl->getPreviewAddress($log);
if (isset($_POST['id_product'])) {
    $product = new Product($_POST['id_product']);
}
$id_product_attribute = Tools::getValue('id_product_attribute', '0');
$product_weight = $product->weight;
// Add combination weight impact
if ($id_product_attribute != 0) {
    $product_weight += Db::getInstance()->getValue('SELECT `weight`	FROM `' . _DB_PREFIX_ . 'product_attribute`	WHERE `id_product_attribute` = ' . (int) $id_product_attribute);
}
$is_downloadable = ProductDownload::getIdFromIdProduct($_POST['id_product']);
if ($is_downloadable) {
    $json = array("dhl_rate_tpl" => $dhl->hookAjaxPreview($rates, $address['dest_zip'], $address['dest_state'], $address['dest_country'], true, $is_cart));
} else {
    $context = $dhl->getContext();
    $currency = new Currency($context->currency->id);
    $rates = $dhl->getAllRates($address['id_zone'], $is_cart, $context->cart, $product_weight, $address['dest_zip'], $address['dest_state'], $address['dest_country'], $currency, $product, $id_product_attribute, $qty, $address['dest_city']);
    $json = array("dhl_rate_tpl" => $dhl->hookAjaxPreview($rates, $address['dest_zip'], $address['dest_state'], $address['dest_country'], false, $is_cart, $address['dest_city']));
}
if (!function_exists('json_decode')) {
    $j = new JSON();
    print $j->serialize($dhl->array2object($json));
} else {
    print json_encode($json);
}
$dhl->saveLog('dhl_log1.txt', "5) = " . (microtime() - $sti), $log);