<?php 
//INSTANCIO LA BASE DE DATOS DEL AVANWS--------------------------------------------------------------------
$bd_conn = new connexion($host_avanws,$user_avanws,$pass_avanws,$name_avanws,$port_avanws);
$bd_conn->query("SET NAMES 'utf8'");
//SERVICES--------------------------------------------------------------------------------------------------
if ( $_SERVER['REQUEST_METHOD'] === "POST" ) {
	switch ( $_POST["service"] ) {
		case 'servToken'://CONSULTA LISTADO DE MARCAS DE VEHICULOS
			include("servToken.php");
			break;	
		case 'servAddCar'://CONSULTA LISTADO DE MARCAS DE VEHICULOS
			include("servAddCar.php");
			break;
		case 'servAddDoc'://CONSULTA LISTADO DE MARCAS DE VEHICULOS
			include("servAddDoc.php");
			break;
		case 'servUpdateCar'://ACTUALIZA Y CREA VEHICULOS
			include("servUpdateCar.php");
			break;	
	}
}elseif ( $_SERVER['REQUEST_METHOD'] === "GET" ) {
	$uri = explode('/', $_SERVER['REQUEST_URI']);
	$service = ! empty($uri[3]) ? $uri[3] : '';
	switch ($service) {
		case 'getCarTradeMark':
			include("ServGetCarTradeMark.php");
			break;
		case 'getCarModels':
			include("ServGetCarModels.php");
			break;
		case 'getDocs':
			include("ServGetDocs.php");
			break;
		default:
			include("ServNotFound.php");
			break;
	}
}
?>