File "elimina_bulto.php"

Full path: /home/dsvchile/public_html/equote/Cotizacion/transacciones/elimina_bulto.php
File size: 1.2 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php

	header('Content-type: text/xml');

	include ("../../Utilidades/parse_vars.php");
	include ('../../Utilidades/Funciones.php');


	dbquery("DELETE FROM
				 DetalleBultoCotizacion
			WHERE
				det_bul_cot_id = '$IdBulto'");


	$SqlS = dbquery("SELECT SUM(det_bul_cot_largo),SUM(det_bul_cot_ancho),SUM(det_bul_cot_alto),SUM(det_bul_cot_kg)  FROM DetalleBultoCotizacion WHERE det_bul_cot_id = '$IdBulto'");
	$ArrayS = mysql_fetch_array($SqlS);

	$SCBM = ($ArrayS[0]/100) * ($ArrayS[1]/100) * ($ArrayS[2]/100);
	$SKG = $ArrayS[3];

	$KGVOL = $SCBM*333;

	$SCBM=number_format($SCBM,2);
	$SKG=number_format($SKG,2);
	$KGVOL=number_format($KGVOL,2);


	$dom = new DOMDocument();

	$data = $dom->createElement('data');
	$dom->appendChild($data);


	$CBM = $dom->createElement('CBM');
	$CBMText = $dom->createTextNode($SCBM);
	$CBM->appendChild($CBMText);

	$SPeso = $dom->createElement('SumaPeso');
	$SPesoText = $dom->createTextNode($SKG);
	$SPeso->appendChild($SPesoText);

	$KVol = $dom->createElement('KiloVol');
	$KVolText = $dom->createTextNode($KGVOL);
	$KVol->appendChild($KVolText);

	$data->appendChild($CBM);
	$data->appendChild($SPeso);
	$data->appendChild($KVol);


	$xmlString = $dom->saveXML();

	echo $xmlString;

?>