<?php define("BYPASS_INSTANCE_CHECK", false); require_once "../../../server/bootstrap.php"; $page = new GerenciaComponentPage(); $page->addComponent(new TitleComponent("Proveedores")); $page->addComponent(new MessageComponent("Lista de proveedores")); $proveedoresLista = ProveedoresController::Lista(); $tabla = new TableComponent(array("nombre" => "Nombre", "id_categoria_contacto" => "Clasificacion de proveedor", "activo" => "Activo", "consignatario" => "Consignatario"), $proveedoresLista["resultados"]); $tabla->addColRender("id_categoria_contacto", "funcion_clasificacion_proveedor"); $tabla->addColRender("activo", "funcion_activo"); $tabla->addColRender("consignatario", "funcion_consignatario"); $tabla->addOnClick("id_usuario", "(function(a){ window.location = 'proveedores.ver.php?pid=' + a; })"); $page->addComponent($tabla); $page->render();
<?php define("BYPASS_INSTANCE_CHECK", false); require_once "../../../server/bootstrap.php"; $page = new GerenciaComponentPage(); $page->addComponent(new TitleComponent("Clasificaciones de proveedor")); $page->addComponent(new MessageComponent("Lista de clasificaciones de proveedor")); $tabla = new TableComponent(array("nombre" => "Nombre", "descripcion" => "Descripcion", "activa" => "Activa"), ProveedoresController::ListaClasificacion()); $tabla->addColRender("activa", "funcion_activa"); $tabla->addOnClick("id_clasificacion_proveedor", "(function(a){ window.location = 'proveedores.clasificacion.ver.php?cid=' + a; })"); $page->addComponent($tabla); $page->render();
protected function GenerateResponse() { try { $this->response = ProveedoresController::ListaClasificacion(isset($_GET['activo']) ? $_GET['activo'] : null, isset($_GET['orden']) ? $_GET['orden'] : null); } catch (Exception $e) { //Logger::error($e); throw new ApiException($this->error_dispatcher->invalidDatabaseOperation($e->getMessage())); } }
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/")) { $page->addComponent(" <div id=''>ALERTA: No se pueden subir archivos. Contacte a un administrador de POS ERP</div>"); } $page->nextTab("Importar"); $page->addComponent(new TitleComponent("Importar clientes de CSV/AdminPAQ/Excel", 2));