} else { //guardar union!! //var_dump($_POST);exit; $errores = array(); $sources = array(); if (!isset($_POST['sources'])) { $errores[] = "INVALID_SOURCES"; } else { foreach ($_POST['sources'] as $s) { $sources[] = new address_city($s); } //end foreach } $country = false; if (isset($_POST['address_country'][0]) && $_POST['address_country'][0] != "" && $_POST['address_country'][0] != ID_UNDEFINED) { $country = new address_country($_POST['address_country'][0]); //var_dump($country); $ari->t->assign("address_country_selected", $country->get("id")); } else { $errores[] = "NO_COUNTRY"; } $state = false; if (isset($_POST['address_state'][0]) && $_POST['address_state'][0] != "" && $_POST['address_state'][0] != ID_UNDEFINED) { $state = new address_state($_POST['address_state'][0]); $ari->t->assign("address_state_id", $state->get('id')); $ari->t->assign("address_state_name", $state->get('name')); } else { $errores[] = "NO_STATE"; } if (!isset($_POST['destiny'])) { $errores[] = "NO_DESTINY_OPTION";
} else { //guardar union!! //var_dump($_POST);exit; $errores = array(); $sources = array(); if (!isset($_POST['sources'])) { $errores[] = "INVALID_SOURCES"; } else { foreach ($_POST['sources'] as $s) { $sources[] = new address_state($s); } //end foreach } $country = false; if (isset($_POST['address_country'][0]) && $_POST['address_country'][0] != "" && $_POST['address_country'][0] != ID_UNDEFINED) { $country = new address_country($_POST['address_country'][0]); //var_dump($country); $ari->t->assign("address_country_selected", $country->get("id")); } else { $errores[] = "NO_COUNTRY"; } if (!isset($_POST['destiny'])) { $errores[] = "NO_DESTINY_OPTION"; } else { //verifico si el destino es uno nuevo o existente if ($_POST['destiny'] == ID_UNDEFINED) { //destino nuevo $destiny = new address_state(ID_UNDEFINED); $destiny->set("country", $country); $destiny->set("status", USED); if (isset($_POST['new_name'])) {