include "library/levam_oem.php";
include "library/translations.php";
include "config.php";
include "main/head.php";
$page = $_GET['page'];
if(ADD_LANG_TO_URL)
$homePage = HOME_URL.'/'.$lang."/";
else
$homePage = HOME_URL;
?>
$errorText = array();
switch($page){
case '':
$type = $_GET['type'];
if($type == ''){
$type = 0;
}
$out = ListCatalogs($api_key,$type);
$out = json_decode($out,true);
if($out['error']!='')
$errorText['CatalogsListGet'] = $out['error'];
if(empty($errorText))
include "main/main.php";
else
include "main/error.php";
break;
case 'model':
$type = $_GET['type'];
if($type == ''){
$type = 0;
}
$brandCode = $_GET['brand'];
$out = ListCatalogs($api_key,$type);
$out = json_decode($out,true);
if($out['error']!='')
$errorText['CatalogsListGet'] = $out['error'];
$models = FindModels($api_key,$brandCode,$type);
$models = json_decode($models,true);
if($models['error']!='')
$errorText['ModelsListGet'] = $models['error'];
if(empty($errorText))
include "main/models.php";
else
include "main/error.php";
break;
case 'params':
$type = $_GET['type'];
if($type == ''){
$type = 0;
}
$brandCode = $_GET['brand'];
$familyCode = $_GET['family'];
$modelCode = $_GET['model'];
$catalogCode = $_GET['catalog_code'];
$param = '';
$ssd = $_GET['ssd'];
$out = ListCatalogs($api_key,$type);
$out = json_decode($out,true);
if($out['error']!='')
$errorText['CatalogsListGet'] = $out['error'];
$models = FindModels($api_key,$brandCode,$type);
$models = json_decode($models,true);
if($models['error']!='')
$errorText['ModelsListGet'] = $models['error'];
$params = FindParams($api_key,$catalogCode,$modelCode,$ssd,$param,$lang);
$params = json_decode($params,true);
if($params['error']!='')
$errorText['VehicleParamsSet'] = $params['error'];
$paramArray = explode(';',$params['client']['param']);
$paramValues = array();
foreach($paramArray as $oneParamArr){
$expl = explode(':',$oneParamArr);
$paramValues[$expl[0]] = $expl[1];
}
if(empty($errorText))
include "main/params.php";
else
include "main/error.php";
break;
case 'modifications':
$brandCode = $_GET['brand'];
$familyCode = $_GET['family'];
$modelCode = $_GET['model'];
$ssd = $_GET['ssd'];
$modifications = FindModifications($api_key,$ssd,$lang);
$modifications = json_decode($modifications,true);
if($modifications['error']!='')
$errorText['VehicleModificationsGet'] = $modifications['error'];
if(empty($errorText))
include "main/modifications.php";
else
include "main/error.php";
break;
case 'groups':
$ssd = $_GET['ssd'];
$link = $_GET['link'];
$group = $_GET['group'];
$groupsBegin = FindGroups($api_key,$lang,$ssd,$link,'');
$groupsBegin = json_decode($groupsBegin,true);
if($groupsBegin['error']!='')
$errorText['PartGroupsGet_first'] = $groupsBegin['error'];
$groups = FindGroups($api_key,$lang,$ssd,$link,$group);
$groups = json_decode($groups,true);
if($groups['error']!='')
$errorText['PartGroupsGet_second'] = $groups['error'];
if(empty($errorText))
include "main/groups.php";
else
include "main/error.php";
break;
case 'parts':
$ssd = $_GET['ssd'];
$link = $_GET['link'];
$group = $_GET['group'];
$parts = FindParts($api_key,$lang,$ssd,$link,$group);
$parts = json_decode($parts,true);
if($parts['error']!='')
$errorText['PartsGet'] = $parts['error'];
if(empty($errorText))
include "main/parts.php";
else
include "main/error.php";
break;
case 'vin':
$vin = $_GET['vin'];
$vin = FindVin($api_key,$lang,$vin);
$vin = json_decode($vin,true);
if($vin['error']!='')
$errorText['VinFind'] = $vin['error'];
if(empty($errorText))
include "main/vin.php";
else
include "main/error.php";
break;
case 'frame':
$frame = $_GET['frame'];
$frame = FindFrame($api_key,$lang,$frame);
$frame = json_decode($frame,true);
if($frame['error']!='')
$errorText['FrameFind'] = $frame['error'];
if(empty($errorText))
include "main/frame.php";
else
include "main/error.php";
break;
default:
echo "404 This page not found!
";
}
include "main/bottom.php";