public function testImportarProductos() { $p = ProductosController::Importar(file_get_contents("adminpaq.catalogo.productos.csv")); }
protected function GenerateResponse() { try { $this->response = ProductosController::Importar(isset($_POST['raw_content']) ? $_POST['raw_content'] : null); } catch (Exception $e) { //Logger::error($e); throw new ApiException($this->error_dispatcher->invalidDatabaseOperation($e->getMessage())); } }
public function testImportarProductos() { $p = ProductosController::Importar(file_get_contents("adminpaq.catalogo.productos.csv")); //$this->assertEquals(1,2); }
define("BYPASS_INSTANCE_CHECK", false); require_once "../../../server/bootstrap.php"; if (!empty($_FILES)) { if (!SesionController::isLoggedIn()) { throw new ApiException($this->error_dispatcher->invalidAuthToken()); } set_time_limit(600); Logger::log("Subiendo archivo ... "); if ($_REQUEST["type"] == "csv-clientes") { move_uploaded_file($_FILES["logo"]["tmp_name"], "../../../static_content/" . IID . "-clientes.csv"); ClientesController::Importar(file_get_contents("../../../static_content/" . IID . "-clientes.csv")); } if ($_REQUEST["type"] == "csv-productos") { move_uploaded_file($_FILES["logo"]["tmp_name"], "../../../static_content/" . IID . "-productos.csv"); ProductosController::Importar(file_get_contents("../../../static_content/" . IID . "-productos.csv")); } if ($_REQUEST["type"] == "csv-proveedores") { move_uploaded_file($_FILES["logo"]["tmp_name"], "../../../static_content/" . IID . "-proveedores.csv"); ProveedoresController::Importar(file_get_contents("../../../static_content/" . IID . "-proveedores.csv")); } if ($_REQUEST["type"] == "logo") { move_uploaded_file($_FILES["logo"]["tmp_name"], "../static/" . IID . ".jpg"); } echo '{"status":"ok"}'; exit; } $page = new GerenciaTabPage(); $page->addComponent("<script>Ext.Ajax.timeout = 5 * 60 * 1000; /* 5 minutos */ </script>"); $page->addComponent(new TitleComponent("Configuracion de POS ERP")); if (!is_writable("../../../static_content/")) {