<?php
	include("db.php");
	if (isset($_GET["usuario"]) && !empty($_GET["usuario"]) && $_GET["usuario"]=="admin" && isset($_GET["password"]) && !empty($_GET["password"]) && $_GET["password"]=="1234") {
			$test_array = array();
			$rs = mysql_query("SELECT * FROM jos_vm_manufacturer ORDER BY mf_name ASC");		
			$total = mysql_num_rows($rs);
			if ($total>0) {
				$i=0;
				while ($marca = mysql_fetch_assoc($rs)) {
					$item_properties = @array(
						'nombre'               => utf8_encode($marca["mf_name"]),
						'id'               => $marca["manufacturer_id"]
					);
					$test_array["marca".$i] = $item_properties;
					$i++;
				}
			}else{
				$test_array = array ('error' => 'marcas no encontradas');
			}
	}else{
		$test_array = array ('error' => 'usuario y/o contraseña inválidos ó vacios');
	}
	header('Content-type: text/xml');
	echo @array_to_xml($test_array, new SimpleXMLElement('<marcas/>'))->asXML();
?>