require_once 'version.php'; $path_e = array(); $section_params = array(); $section_content = ''; $section = '404'; if(isset($_GET['path'])){ $path_e = explode("/",$_GET['path']); if(in_array($path_e[0],['ru','en','ua'])){ $lang = $path_e[0]; }else{ $path_e[0] = 'ru'; $lang = 'ru'; } if(isset($path_e[1]) && $path_e[1]=='pages'){ $section = 'pages'; }elseif(isset($path_e[1]) && $path_e[1]=='catalog'){ $section = 'products'; } }else{ $lang = 'ru'; $section = 'index'; } $folder = 'content_'.$lang; $inc = true; require_once 'json.get_products.php'; if(isset($products)){ $product_slugs = array(); foreach($products as $obj){ $product_slugs[] = $obj->slug; } } if($section){ require_once 'section_'.$section.'.php'; } if(httpcode()==404){ $section_params = array(); $scripts = array(); $styles = array(); $section_content = ''; require_once 'section_404.php'; } if(isset($_POST['return']) && $_POST['return']=='json'){ header('Content-Type: application/json'); echo json_encode(['section'=>$section,'content'=>'