-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
467 additions
and
79 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-96.2 KB
public/calculos/Ingresos_Egresos_Octubre_2019ALBERTORAMIREZGARCIA.xlsx
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
use \Psr\Http\Message\ServerRequestInterface as Request; | ||
use \Psr\Http\Message\ResponseInterface as Response; | ||
//Obtener todos los clientes | ||
$app->post('/api/busqueda_catalogo/producto_servicio', function(Request $request, Response $response){ | ||
$busqueda = $request->getParam('busqueda'); | ||
// Verificacion del token | ||
// $auth = new Auth(); | ||
// $token = $auth->Check($token); | ||
// if($token['status'] === false){ | ||
// echo json_encode($token); | ||
// return; | ||
// } | ||
// Fin Verificacion | ||
$consulta = "SELECT * FROM producto_servicio WHERE id LIKE '%{$busqueda}%' OR descripcion LIKE '%{$busqueda}%' OR palabrasSimilares LIKE '%{$busqueda}%' "; | ||
try{ | ||
// Instanciar la base de datos | ||
$db = new db_sat(); | ||
|
||
// Conexión | ||
$db = $db->connect(); | ||
$ejecutar = $db->query($consulta); | ||
$clientes = $ejecutar->fetchAll(PDO::FETCH_OBJ); | ||
$db = null; | ||
|
||
//Exportar y mostrar en formato JSON | ||
$mensaje = array( | ||
'status' => true, | ||
'mensaje' => 'Catalogo productos y servicios cargados', | ||
'rest' => $clientes | ||
); | ||
echo json_encode($mensaje); | ||
return; | ||
} catch(PDOException $e){ | ||
$mensaje = array( | ||
'status' => false, | ||
'mensaje' => 'Error al cargar productos y servicios', | ||
'error' => $e->getMessage() | ||
); | ||
echo json_encode($mensaje); | ||
return; | ||
} | ||
}); | ||
$app->post('/api/busqueda_catalogo/unidades_medida', function(Request $request, Response $response){ | ||
$busqueda = $request->getParam('busqueda'); | ||
$consulta = "SELECT * FROM clave_unidad WHERE id LIKE '%{$busqueda}%' OR nombre LIKE '%{$busqueda}%' "; | ||
try{ | ||
// Instanciar la base de datos | ||
$db = new db_sat(); | ||
|
||
// Conexión | ||
$db = $db->connect(); | ||
$ejecutar = $db->query($consulta); | ||
$unidades = $ejecutar->fetchAll(PDO::FETCH_OBJ); | ||
$db = null; | ||
|
||
//Exportar y mostrar en formato JSON | ||
$mensaje = array( | ||
'status' => true, | ||
'mensaje' => 'Catalogo undades de medida cargados', | ||
'rest' => $unidades | ||
); | ||
echo json_encode($mensaje); | ||
return; | ||
} catch(PDOException $e){ | ||
$mensaje = array( | ||
'status' => false, | ||
'mensaje' => 'Error al cargar unidades de medida', | ||
'error' => $e->getMessage() | ||
); | ||
echo json_encode($mensaje); | ||
return; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
use \Psr\Http\Message\ServerRequestInterface as Request; | ||
use \Psr\Http\Message\ResponseInterface as Response; | ||
//Obtener todos los clientes | ||
$app->post('/api/clientes_cliente/get', function(Request $request, Response $response){ | ||
$idcliente = $request->getParam('idcliente'); | ||
$token = $request->getParam('token'); | ||
// Verificacion del token | ||
// $auth = new Auth(); | ||
// $token = $auth->Check($token); | ||
// if($token['status'] === false){ | ||
// echo json_encode($token); | ||
// return; | ||
// } | ||
// Fin Verificacion | ||
$consulta = "SELECT * FROM cliente_cliente WHERE idcliente='$idcliente'"; | ||
try{ | ||
// Instanciar la base de datos | ||
$db = new db(); | ||
|
||
// Conexión | ||
$db = $db->connect(); | ||
$ejecutar = $db->query($consulta); | ||
$clientes = $ejecutar->fetchAll(PDO::FETCH_OBJ); | ||
$db = null; | ||
|
||
//Exportar y mostrar en formato JSON | ||
$mensaje = array( | ||
'status' => true, | ||
'mensaje' => 'Clientes cargados correctamente', | ||
'rest' => $clientes | ||
); | ||
return json_encode($mensaje); | ||
} catch(PDOException $e){ | ||
$mensaje = array( | ||
'status' => false, | ||
'mensaje' => 'Error al cargar clientes', | ||
'error' => $e->getMessage() | ||
); | ||
return json_encode($mensaje); | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.